libtool
[Top][All Lists]
Advanced

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

Re: libltdl obscures error messages


From: Gary V . Vaughan
Subject: Re: libltdl obscures error messages
Date: Sat, 28 Jul 2001 12:00:31 +0100

`Tag Marius,

On Saturday 28 July 2001 11:02 am, Marius Vollmer wrote:
> Gary V.Vaughan <address@hidden> writes:
> > > All in all, I don't think this would be better than relying on
> > > dlopen to set errno to ENOENT, if only by accident.  We can lobby
> > > the implementors of dlopen to fix this behavior.
> >
> > Unfortunately, libtool is all about hiding such brokenness from the user.
> > Even if Windows, BeOS, HP-UX and all the different dlopen implementations
> > were fixed tomorrow, that doesn't help the people still running the old
> > version.  And we can't expect them all to upgrade...
>
> Sorry, wrong wording.  With "fix", I meant that dlopen should `fix'
> its current behavior of setting errno, so that we can be sure that
> this bevaior doesn't disappear in the future.  Even if it only sets
> errno accidentally in the existing versions, we can rely on it, since
> it is not going to change.

Do you mean that lt_dlopen should set ENOENT when it detects that the load 
failed due to "No such file"?  I have no strong feelings about that, although 
it doesn't help lt_dlopen in actually detecting that condition in the first 
place.

If you really do mean that dlopen should set ENOENT, libtool has no control 
over that, and even if it is already common for architectures to do so, I 
would be very surprised if it is done consistently for the huge number of 
dlopen implementations out there, let alone the other dynamic loading APIs 
that libltdl supports.  Therefore, this doesn't help lt_dlopen to reliably 
detect failure to open a module due to "No such file" conditions either.

Having thought about this some more, I am beginning to wonder whether correct 
error message propogation within libltdl even needs to rely on system level 
file not found reporting at all?  I think we should be able to hold on to the 
most recent system error message, and if (after tryall_dlopen) libltdl's 
internal reporting has only a FILE_NOT_FOUND passes back the system error 
instead... I think much of the problem remaining in libltdl's error reporting 
is that it always treats FILE_NOT_FOUND as an equivalent severity to the 
other (more informative) error codes.  If we patched it to treat 
FILE_NOT_FOUND as an indicator to keep searching for a way to load a module, 
and only return it as an error code if none of the other load attempts 
returned a different error, things would already be much better...

> [ Testing your German, eh? ;-) ]

[With the aid of a dictionary:] Ich pflegte, im Afrikaans und nicht zum 
schlechten am Deutschen fliessend zu sein. Heutzutage ist mein Japaner besser 
als beide.

Cheers,
        Gary.
-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

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