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) {
                /* failed to load input plug */
                event_printf(EVENT_LOG, 0, "dlopen: %s.", dlerror());
                return(-1);
        }
    
        if ((gpi = dlsym(phandle, "get_iplugin_info")) != NULL) {
                /* initialise as an input plugin */
fails here----> ip = (InputPlugin *) gpi();
                ip->handle = phandle;
                ip->filename = (char *)strdup(filename);
                if (ip->init) ip->init();
                event_printf(EVENT_LOG, 0,
"pluginterface_load: Initialised %s", ip->description);
                ipl_add(ip);
                return 1;
        } 

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.

The code to load and init the plugin was lifted from xmms actually.

Which leads me to thinking there is a problem between differing libs, or
something. Any other ideas ?


bruno

> [EMAIL PROTECTED] wrote:
> > Well, if I do link with -export-dynamic, I can not even make the first
> > call to anything in the plugin, it segfaults immediately on some
> > g_vsprintf_XXX function (that seems to come from glib).
> > 
> > What is going on ? I link the program with glib and all necessary libs.
> > 
> > If anybody has some insight on this, please let me know...
> 
> Nothing a tiny bit of instrumentation and a change in the way
> you open it couldn't fix.
> 
> Set RTLD_NOW rather than RTLD_LAZY for testing.  When the dlopen()
> fails, call dlerror() to retrieve the error message; it will tell
> you exactly what is failing.
> 
> -- Terry
> 
> 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to