bug-libtool
[Top][All Lists]
Advanced

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

Errors from lt_preopen are overriding errors from the system loader


From: Ari Entlich
Subject: Errors from lt_preopen are overriding errors from the system loader
Date: Mon, 8 Mar 2010 03:40:49 -0500 (EST)

Ok here's how this happens:

My program calls lt_dlopen to load a module.
The system loader (dlopen, in this case) is called on (by tryall_dlopen) to 
load the module.
The dlopen loader fails to load the module, setting a very informative error 
message about an unresolved symbol in the process.
Because dlopen failed to load the module, the lt_preopen loader is called on 
(also by tryall_dlopen) to load the module.
The lt_preopen loader also fails to load the module, because the module was not 
preopened.
The lt_preopen loader sets a completely useless "file not found" error about 
its inability to load the given module,
    erasing the dlopen loader's error message.
This error message is what is returned by lt_dlerror after the lt_dlopen call 
fails.
I spend about an hour trying to figure out why the hell my module won't load.

Needless to say, this is unacceptable. The only way to access to access the 
real error is to poke around libltdl with a
debugger. I've tried a few different solutions, but they all wound up seeming 
like hacks.

Here are some of the things I've tried/thought about:
Skipping over lt_preopen unless it is explicitly given in the vtable parameter 
of tryall_dlopen.
Running the lt_preopen loader first, before any others.
Only allowing the lt_preopen loader to set errors if there is not already an 
error set.

Could I have a little help from people with more experience with libltdl?

Thanks!

Ari




reply via email to

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