[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#576484: libc6-prof: segmentation fault when using profiling with pthread.



Package: libc6-prof
Version: 2.10.2-6
Severity: important

# cat a.c  int main() { return 0; } # gcc -g -pg a.c -o a  -static-libgcc -lc_p
# ./a Exit code 0 # gcc -g -pg a.c -o a  -static-libgcc -lc_p -pthread  # ./a
Segmentation fault (core dumped) # gdb ./a ./core .... [New Thread 9335]
warning: Can't read pathname for load map: Input/output error. Reading symbols
from /lib/i686/cmov/libpthread.so.0...Reading symbols from
/usr/lib/debug/lib/i686/cmov/libpthread-2.10.2.so...done. done. Loaded symbols
for /lib/i686/cmov/libpthread.so.0 Reading symbols from
/lib/i686/cmov/libc.so.6...Reading symbols from
/usr/lib/debug/lib/i686/cmov/libc-2.10.2.so...done. done. Loaded symbols for
/lib/i686/cmov/libc.so.6 Reading symbols from /lib/ld-linux.so.2...Reading
symbols from /usr/lib/debug/lib/ld-2.10.2.so...done. done. Loaded symbols for
/lib/ld-linux.so.2 Core was generated by `./a'. Program terminated with signal
11, Segmentation fault. #0  0x0807fed1 in _dl_get_tls_static_info () (gdb) bt
#0  0x0807fed1 in _dl_get_tls_static_info () #1  0x400425ff in
__pthread_initialize_minimal_internal () at nptl-init.c:387 #2  0x40041df8 in
_init ()     at /build/buildd-eglibc_2.10.2-6-i386-fHPOAN/eglibc-2.10.2/build-
tree/i386-i686/nptl/crti.S:24 #3  0x4000e554 in call_init (l=0x40020858,
argc=1, argv=0xbfaa6734,      env=0xbfaa673c) at dl-init.c:70 #4  0x4000e6e6 in
_dl_init (main_map=0x4001d670, argc=1, argv=0xbfaa6734,      env=0xbfaa673c) at
dl-init.c:100 #5  0x4000088f in _dl_start_user () from /lib/ld-linux.so.2 (gdb)
Using -lpthread also gives this error. Removing -pthread from gcc command line
resolves problem in test program.   Unfortunetly in my program i'm using
threads, and after removing -pthread, i have linking error.  recursive.o: In
function `launch_thread': /maradns-1.4.03/server/recursive.c:3544: undefined
reference to `pthread_create'   I found that using -lpthread_p resolves problem
in my test program (it links and runs correctly), but then in my main program i
got on linking this:  /usr/lib/gcc/i486-linux-
gnu/4.4.3/../../../../lib/libpthread_p.a(lowlevellock.op): In function
`__lll_lock_wait_private': /build/buildd-eglibc_2.10.2-6-i386-fHPOAN/eglibc-2.1
0.2/nptl/../nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S:76: multiple
definition of `__lll_lock_wait_private' /usr/lib/gcc/i486-linux-
gnu/4.4.3/../../../../lib/libc_p.a(libc-lowlevellock.op):(.text+0x0): first
defined here /usr/lib/gcc/i486-linux-
gnu/4.4.3/../../../../lib/libpthread_p.a(lowlevellock.op): In function
`__lll_unlock_wake_private': /build/buildd-eglibc_2.10.2-6-i386-fHPOAN/eglibc-2
..10.2/nptl/../nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S:326:
multiple definition of `__lll_unlock_wake_private' /usr/lib/gcc/i486-linux-
gnu/4.4.3/../../../../lib/libc_p.a(libc-lowlevellock.op):(.text+0x30): first
defined here    Could you add this information to
/usr/share/doc/libc6-prof/README.Debian , and solve problem with multiple
definitions?   I also found that executable is probably not linked (compiler
done something wrong) correctly:  # ldd ./a         linux-gate.so.1 =>
(0x4001e000)         libpthread.so.0 => /lib/i686/cmov/libpthread.so.0
(0x4003e000)         libc.so.6 => /lib/i686/cmov/libc.so.6 (0x40057000)
/lib/ld-linux.so.2 (0x40000000) #  Thanks.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.34-rc2-sredniczarny-00184-g01e7770 (PREEMPT)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to pl_PL.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6-prof depends on:
ii  libc6                         2.10.2-6   Embedded GNU C Library: Shared lib

libc6-prof recommends no packages.

libc6-prof suggests no packages.

-- no debconf information



Reply to: