bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error reporting should be improved


From: Peter Rosin
Subject: Re: Error reporting should be improved
Date: Wed, 30 Dec 2009 04:50:36 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Den 2009-12-30 03:48 skrev Bob Friesenhahn:
*snip*

The "file not found" overwrite comes from vm_open() in loaders/preopen.c. It seems that if other loaders fail, then preopen is tried last since it is last in the loaders list:

  LT__SETERROR (FILE_NOT_FOUND);

 done:
  return module;

A possible simple solution is to change this sort of code to:

  if (!lt__get_last_error())
    LT__SETERROR (FILE_NOT_FOUND);

 done:
  return module;

so that existing errors are preserved, but this assumes that all prior loaders are producing useful error messages and errors were purged before attempting to load the module.

The code which loops through the loaders is in ltdl.c/tryall_dlopen().

I have been barking up that tree as well, but...

How will that scale when there are multiple loaders (in addition to
the preloader)? I don't think the perfect solution can depend on
the loader to know if the error is "weak" (as above) or "strong"
and worth preserving. But maybe the preloader is an acceptable
exception to this rule?

I just don't see how we can select which error to report when there
are multiple loaders failing with different messages, but I'm also
too tired to see how it really fits together.

If the preloader is capable of generating "weak" errors, then maybe
that's enough as that (hopefully) solves the issue for the majority
that don't have more that one loader (is that the case?). So maybe
the solution is to have the loaders generate "weak" errors whenever
they know for sure that the error is the equivalent of "file not
found" and have everything else overwrite the last error just as is
done today, and the last non-weak error "wins".

Cheers,
Peter

--
They are in the crowd with the answer before the question.
> Why do you dislike Jeopardy?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]