Re: [info-performer] dynamic loading of performer libraries

Date view Thread view Subject view Author view

From: Marc Mendez (mmendez++at++silicon-worlds.fr)
Date: 06/17/2003 05:34:24


Hi all,

same crash using RH8, gcc 3.2-7, performer 3.0.0

Marc.

Test program is:
===================================================
#include <iostream>
#include <dlfcn.h>

int
main(int argc, char** argv)
{
    void *handle = 0;
    char *error = 0;

    if((handle = dlopen("libpf.so", RTLD_GLOBAL | RTLD_NOW)) == 0)
    {
        std::cerr << dlerror() << std::endl;
        exit(1);
    }
   
    void (*pfInit)() = (void(*)())dlsym(handle, "pfInit");

    if((error = dlerror()) != 0)
        std::cerr << error << std::endl;
    else if(pfInit)
        (*pfInit)();
    else
        std::cerr << "pfInit() address is 0\n";

    return 0;
}
===================================================

Compiled with:
g++ -g -O -ldl -o test main.c

===================================================

Result is:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 2186)]
0x404329a7 in dqFIxD () from /usr/lib/libpf.so
(gdb) where
#0 0x404329a7 in dqFIxD () from /usr/lib/libpf.so
#1 0x4043285a in xJTEAl () from /usr/lib/libpf.so
#2 0x4043350f in h6ON8E () from /usr/lib/libpf.so
#3 0x4040f6ae in pfInit () from /usr/lib/libpf.so
#4 0x080487e9 in main (argc=1, argv=0xbfffd684) at main.c:21
#5 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

C. Skluzacek wrote:

>--- Marc Mendez <mmendez++at++silicon-worlds.fr> wrote:
>
>
>>C. Skluzacek wrote:
>>
>>
>>
>>>Hi,
>>>I have a program that loads in plugin modules at
>>>runtime using the libdl family of functions (I've
>>>
>>>
>>also
>>
>>
>>>tried using the gnu libtool library and got the
>>>
>>>
>>same
>>
>>
>>>result). I get a crash when I try to dynamically
>>>
>>>
>>load
>>
>>
>>>a plugin which itself depends on Performer.
>>>
>>>
>>>
>>What kind of crash exactly ? Is this dlopen, dlsym
>>or the (*runPf)()
>>call that crashes ? That is, are your handles and
>>pointers OK ?
>>
>>
>
>I get a segmentation fault as soon as I try to call a
>performer function (either directly or via the
>function pointer). For example, if I comment out the
>performer code in the runPf() function (as below), it
>runs fine (of course no Performer code is then
>executed). So that means that the library handle and
>function pointer seem to be valid. I'm just wondering
>if Performer does some special initialization that has
>to be done at program startup or something instead of
>dynamically during runtime.
>
>void runPf()
>{
> std::cout<<"runPf()\n";
>#if 0
> pfInit();
> pfConfig()
> for ( ; ; ) {
> pfSync();
> pfFrame();
> }
>#endif
>}
>
>
>
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>-----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-----------------------------------------------------------------------
>
>
>
>

-- 
Marc Mendez
Silicon Worlds SA

12, rue de Chatillon 75014 Paris Tel : +33 (01) 53 90 11 13 Fax : +33 (01) 53 90 11 12

Without C, we would only have Basi, Pasal and Obol. Anonymous. Computers are useless. They can only give you answers. P. Picasso.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jun 17 2003 - 05:36:21 PDT