On 03/04/2010 07:17 PM, Renato Botelho wrote: > 2010/3/4 Török Edwin <edwinto...@gmail.com>: >> On 03/04/2010 07:01 PM, Renato Botelho wrote: >>> 2010/3/4 Török Edwin <edwinto...@gmail.com>: >>>> On 03/04/2010 06:02 PM, Renato Botelho wrote: >>>>> Without -O2, results changed >>>>> >>>>> #10 0x0000000000000000 in ?? () >>>>> #11 0x0000000000000000 in ?? () >>>>> #12 0x0000000000000000 in ?? () >>>>> #13 0x0000000000000000 in ?? () >>>>> #14 0x0000000000000001 in ?? () >>>>> #15 0x0000000000000000 in ?? () >>>>> #16 0x00007fffffffedf3 in ?? () >>>>> #17 0x00007fffffffedfd in ?? () >>>>> #18 0x00007fffffffee08 in ?? () >>>> Sorry that still doesn't tell me what the bug is. >>>> Can you show me config.log (from libclamav/c++), maybe its linking to a >>>> wrong library. >>> Attached >>> >>>> Could you also post a strace output of the program? (so we see what it >>>> does prior to crashing) >>> Sorry, we don't have strace for freebsd amd64, just for i386 >>> >>>> Also try doing this: >>>> (gdb) breakpoint main >>>> (gdb) run >>>> (gdb) next >>>> (gdb) next >>>> (gdb) quit >>> It seems to segfault before main. >>> >>> testegw# gdb ./llvmunittest_ADT >>> GNU gdb 6.1.1 [FreeBSD] >>> Copyright 2004 Free Software Foundation, Inc. >>> GDB is free software, covered by the GNU General Public License, and you are >>> welcome to change it and/or distribute copies of it under certain >>> conditions. >>> Type "show copying" to see the conditions. >>> There is absolutely no warranty for GDB. Type "show warranty" for details. >>> This GDB was configured as "amd64-marcel-freebsd"... >>> (gdb) break main >>> Breakpoint 1 at 0x462c39: file >>> llvm/utils/unittest/UnitTestMain/TestMain.cpp, line 13. >>> (gdb) run >>> Starting program: >>> /home/garga/clamav-devel/work/clamav-devel-20100303/libclamav/c++/llvmunittest_ADT >>> [New LWP 100101] >>> [New Thread 0x5dd000 (LWP 100101)] >>> [New LWP 100101] >>> >>> Program received signal SIGSEGV, Segmentation fault. >>> [Switching to LWP 100101] >>> 0x00000008006f531d in _pthread_mutex_trylock () from /usr/lib/libthr.so.2 >>> (gdb) next >>> Single stepping until exit from function _pthread_mutex_trylock, >>> which has no line number information. >>> >>> Program terminated with signal SIGSEGV, Segmentation fault. >>> The program no longer exists. >>> (gdb) next >>> The program is not being run. >>> (gdb) quit >>> testegw# >>> >>> I'm thinking this problem could be related with thread library. I'll >>> try to link it with libthr instead of libpthread and see what happens. >>> >> It already links with lthr, maybe try libpthread then? >> LDFLAGS=' -L/usr/local/lib -lthr -Wl,-rpath=/usr/local/lib/gcc42' >> >> Best regards, >> --Edwin >> _______________________________________________ >> http://lurker.clamav.net/list/clamav-devel.html >> Please submit your patches to our Bugzilla: http://bugs.clamav.net >> > > So, something went wrong, unit test binary is linked with libpthread
Can you show me the output of: rm llvmunittest_ADT make llvmunittest_ADT V=1 > > testegw# ldd llvmunittest_ADT > llvmunittest_ADT: > libthr.so.2 => /usr/lib/libthr.so.2 (0x8006e7000) > libstdc++.so.6 => /usr/local/lib/gcc42/libstdc++.so.6 (0x8007fe000) > libm.so.4 => /lib/libm.so.4 (0x800a0a000) > libgcc_s.so.1 => /usr/local/lib/gcc42/libgcc_s.so.1 (0x800b26000) > libpthread.so.2 => /lib/libpthread.so.2 (0x800c33000) > libc.so.6 => /lib/libc.so.6 (0x800d5e000) Ouch, how did the linker even allow that?! Best regards, --Edwin _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net