[EMAIL PROTECTED] wrote:
> I tried that and resolved all entry points. It is neither dlopen() nor
> dlsym() that fail, it is when I try using that entry point that it fails.
>
> code snippet:
>
> if ((phandle = dlopen(filename, RTLD_LAZY)) == NULL) {
Change this to "RTLD_NOW".
> /* failed to load input plug */
> event_printf(EVENT_LOG, 0, "dlopen: %s.", dlerror());
> return(-1);
> }
Add:
else printf( "dlopen failed: %s\n", dlerror());
> if ((gpi = dlsym(phandle, "get_iplugin_info")) != NULL) {
> /* initialise as an input plugin */
> fails here----> ip = (InputPlugin *) gpi();
This can only happen if the "get_iplugin_info" function in your
module references symbols defined in a shared object not loaded
before it was loaded.
Use "nm foo.So" for the shared object for the module "foo.so" to
see what external suymbols are referenced by the module.
> the backtrace shows that calling get_iplugin_info() leads to a
> g_strdup_printf() that later fails in vfprintf() from libc_r.so.4
>
> so it fails in a call to glib. You'll tell me there is a bug in the
> plugin, but I know there is not, this plugin (shared lib) works perfectly
> with xmms.
Ah. You are using glib. That's implicitly broken. Don't use
glib, and your problem will go away.
> Which leads me to thinking there is a problem between differing libs, or
> something. Any other ideas ?
Create a module "wrapper.so" that dlopen's glib.so.xxx, and *then*
dlopen's your module, and then reflects the interfaces down.
Alternately, don't use glib: it's intrinsically broken, by design.
-- Terry
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message