Fail to run stl_test c++ client

318 views
Skip to first unread message

Zhao Qin

unread,
Nov 6, 2009, 2:56:13 PM11/6/09
to dynamor...@googlegroups.com
Hi:

I tried to build and run stl_test client.
The compilation works fine but failed on loading the client.
The error message as following:
<Application ls (19388) DynamoRIO usage error :
        Error opening instrumentation library /.../bin/libstl_test.so:
        /.../bin/libstl_test.so: undefined symbol: __gxx_personality_v0>
OS: Linux Debian 5.0
gcc version 4.3.2 (Debian 4.3.2-1.1)

Any suggestion to solve this problem?

Best Regards
Qin

Derek Bruening

unread,
Nov 6, 2009, 3:19:01 PM11/6/09
to dynamor...@googlegroups.com
On older distributions this worked fine. Recent gcc packages have not
provided very self-contained static libraries, unfortunately. Xref issue
30 and http://www.govirtual.org/message/1110 referenced there.

__gxx_personality_v0 has to do with the new exception handling model.
If you compile with "-fno-exceptions" it should go away but you may have
other undefined symbols. Currently the best solution, other than using an
older gcc package, is to build libstl yourself with -fno-stack-protector.
You can also take out the -nodefaultlibs and take your chances with a
dynamic copy but you may have problems depending on what routines you use.
We hope to provide a more convenient solution, along with better C++
support in general, in the future.

- Derek

qin

unread,
Nov 9, 2009, 12:08:32 PM11/9/09
to DynamoRIO Users
By using "-fno-exceptions", the program is compiled successfully.
But there is a new runtime error makes the execution fail.
The error message as below:
symbol lookup error: libcpp_test.so: undefined symbol: _Znwm

Any idea.

Qin

On Nov 6, 3:19 pm, Derek Bruening <i...@alum.mit.edu> wrote:
> On older distributions this worked fine.  Recent gcc packages have not
> provided very self-contained static libraries, unfortunately.  Xref issue
> 30 andhttp://www.govirtual.org/message/1110referenced there.

qin

unread,
Nov 9, 2009, 12:23:25 PM11/9/09
to DynamoRIO Users
A bit more test shows:
+ if using stl:
symbol lookup error: libcpp_test.so: undefined symbol: _Znwm
+ if using new
symbol lookup error: libcpp_test.so: undefined symbol: _Znam
+ if using cout
symbol lookup error: libcpp_test.so: undefined symbol:
__dso_handle

Qin

Derek Bruening

unread,
Nov 9, 2009, 12:37:22 PM11/9/09
to dynamor...@googlegroups.com
These are fundamental routines that are missing: operator new(unsigned
long) and operator new[](unsigned long). Are you sure you have libstdc++.a
statically linked in? Are these present in your copy of libstdc++.a (they
should be)?

- Derek

qin

unread,
Nov 9, 2009, 1:16:24 PM11/9/09
to DynamoRIO Users
I used the cmake provided in DynamoRIO samples to build the code

The generated link.txt looks correct to me

/usr/bin/c++ -fPIC -fno-exceptions -DX86_64 -DLINUX -fno-stack-
protector /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a /usr/lib/
gcc/x86_64-linux-gnu/4.3.2/libgcc.a /usr/lib/gcc/x86_64-linux-gnu/
4.3.2
/libgcc_eh.a -Xlinker -wrap=malloc -Xlinker -wrap=realloc -Xlinker -
wrap=free -fPIC -shared -nostartfiles -nodefaultlibs -lgcc -Xlinker -T
-Xlinker "/home/qin_zhao/build/ldscript" -shared -Wl,-
soname,libcpp_test.so -o bin/libcpp_test.so CMakeFiles/cpp_test.dir/
cpp_test.cpp.o /home/qin_zhao/DynamoRIO/dynamorio-bld/exports/lib64/
debug/libdynamorio.so.1.5

Qin
Reply all
Reply to author
Forward
0 new messages