[M3devel] What is this??? How's it possible?

Dragiša Durić dragisha at m3w.org
Thu Mar 6 19:30:33 CET 2008


My situation was like this:

In hm3-m3lib0 library I have two types:

Killer.T
Killer.Client

That library is linked to xli binary, dynamically.

hm3-web is one of libraries I am loading dynamically at runtime (using
dlopen and co). Its FastCGI and WebServer modules are using above
mentioned two types. I've changed hm3-m3lib0, and hm3-web remained
unchanged. 

So, when I invoke this code:

      dl:=NEW(DL.T).init(pIn, global);
      FOR i:=1 TO r.size() DO
        RTLinker.AddUnit(LOOPHOLE(dl.sym(NARROW(r.get(i-1), TEXT) & "_M3").addr, RT0.Binder));
        (*
        IO.Put("Adding: " & NARROW(r.get(i-1), TEXT) & "\n");
        *)
      END;

RTLinker.AddUnit fails. Message is one I've sent.

When this error happens during "normal" initialization, runtime error is
obviuosly normal behaviour. You can't ignore one of linked libraries and
expect system to work.

But, as some of these additional libraries (in my case scripting engine
plugins) are optional, it's probably wise to allow interception of this
runtime error. This is probably what RuntimeError.E is for? I'll try it
tonight.

dd

On Thu, 2008-03-06 at 18:23 +0100, Olaf Wagner wrote:
> Quoting Tony Hosking <hosking at cs.purdue.edu>:
> 
> > This usually means you did not rebuild a clean set of binaries.  i.e.,
> > some old binaries were lying around that made old assumptions about
> > type ids.
> 
> > On Mar 6, 2008, at 10:50 AM, Dragiša Durić wrote:
> >
> >> ***
> >> *** runtime error:
> >> ***    A compile-time type is missing.
> >> ***    file "../src/runtime/common/RTLinker.i3"
> >> ***
> 
> Well, we'd have to admit it _is_ a little bit cryptic and may not
> be very helpful and encouraging to the casual user :-)
> 
> In theory, CM3 should be able to detect such version conflicts
> even at link time (using fingerprints for compiled units etc.).
> I seem to remember that older M3 versions (i.e. DEC SRC M3) were
> more reliable in detecting such things; but my memory may be wrong
> or the environment completely different (no shared objects for example).
> 
> I'd like to better understand this kind of error: does it only show
> up in connection with old libraries, only in connection with old
> runtime modules (some special rules here), only when using shared
> libraries and so on. Conceptually, it's a kind of version error and
> should be notified as early as possible.
> 
> Then we can think of ways to (a) detect it earlier (if possible) and
> (b) improve the user notification ;-)
> 
> Olaf
-- 
Dragiša Durić <dragisha at m3w.org>




More information about the M3devel mailing list