using dynamic_cast with Performer lib

New Message Reply Date view Thread view Subject view Author view

From: Markus von der Heyde (MvdH++at++Kyb.Tuebingen.MPG.de)
Date: 06/20/2001 03:09:35


Hi,

as soon as I integrate a dynamic_cast into a program with is linked
with the Performer lib (-lpf) I get a segmentation fault.

example:
------------------- snip --------------------
class MyBaseclass
{
public:
  virtual void foo() {};
};

class MyDerivedClass : public MyBaseclass
{
public:
  virtual void foo() {};
};

main ()
{
  MyBaseclass *Temp = new MyDerivedClass;
  MyDerivedClass *Temp2 = dynamic_cast< MyDerivedClass *> (Temp);
}
------------------- snip --------------------

compile:
g++ -o dynamic dynamic_cast.cpp

works fine, but

g++ -o dynamic dynamic_cast.cpp -lpf

compiles, but gives a segfault with the following stack trace:

(gdb) bt
#0 0x0 in ?? ()
#1 0x40712568 in __user_type_info::dyncast (this=0x8049b38, boff=0,
    target=++at++0x8049b38, objptr=0x8055078, subtype=++at++0x8049b44, subptr=0x8055078)
   from /usr/lib/libstdc++-libc6.2-2.so.3
#2 0x40714013 in __dynamic_cast_2 (
    from=0x80488cc <MyDerivedClass type_info function>,
    to=0x80488cc <MyDerivedClass type_info function>, boff=0,
    address=0x8055078, sub=0x804887c <MyBaseclass type_info function>,
    subptr=0x8055078) from /usr/lib/libstdc++-libc6.2-2.so.3
#3 0x80487ce in main ()
#4 0x4076bf31 in __libc_start_main (main=0x804873c <main>, argc=1,
    ubp_av=0xbffff8c4, init=0x8048564 <_init>, fini=0x8048924 <_fini>,
    rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffff8bc)
    at ../sysdeps/generic/libc-start.c:129

Please note, that my code is not using Performer calls, but the
linkage of the library itself is already enough to segfault. Is there a
special compile option to use with Performer, which is not shown in
the official examples, since the problem occurs in there too, if you
put in the new lines of code.

My System configuration is: Redhat 7.0

coriander(mvdh):performer>gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
coriander(mvdh):performer>ld -V
GNU ld version 2.10.90 (with BFD 2.10.0.18)
  Supported emulations:
   elf_i386
   i386linux
Performer Version 2.4:
/usr/lib/libpf.so.1 (0x40025000)

I know that libc version glibc-2.1.1-6 is recommended, but i there no
other way around this problem, since other packages I rely on require
the libc version I am using now...

Thanks for any help and useful suggestions.
Markus

-------------------------------------------------------------------------
Markus von der Heyde Cognitive and Computational
                                     Psychophysics Department
Max Planck Institute for office: ++49 (0)7071/601-630
Biological Cybernetics fax: ++49 (0)7071/601-616
Spemannstraße 38 web: www.kyb.tuebingen.mpg.de/bu
72076 Tübingen, Germany email: mvdh++at++kyb.tuebingen.mpg.de


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 20 2001 - 03:08:24 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.