Bug 2173

Summary: Executable dies with segfault when it linked with -lpthread
Product: uClibc Reporter: Andrew <nitr0>
Component: ThreadsAssignee: unassigned
Status: RESOLVED FIXED    
Severity: critical CC: uclibc-cvs
Priority: P5    
Version: 0.9.30.3   
Target Milestone: 0.9.32   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: buggy uClibc config

Description Andrew 2010-07-06 21:57:37 UTC
Created attachment 2179 [details]
buggy uClibc config

I'm developing embedded Linux distro, and I saw that anything that requires pthread library dies with segfault in libpthread. Even simpliest 'Hello world' if it linked with pthread library. Any things like specifying -ldl at 1st place, using -pthread instead of -lpthread does nothing.
I use gcc-3.3.3 in toolchain, and uClibc-0.9.30.3. Sources are compiled for i686 CPU, target kernel - 2.6.32.10. In config I selected legacy pthread library.
uClibc config in attach.

Here is strace of segfault:
(..............)
open("/var/testpoint/LEAF/buildtool/staging/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFIFO, st_size=1741429448180443563, ...}) = 0
close(3)                                = 0
open("/var/testpoint/LEAF/buildtool/staging/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFIFO, st_size=1741429448180443563, ...}) = 0
close(3)                                = 0
open("/var/testpoint/LEAF/buildtool/staging/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFIFO, st_size=1741429448180443563, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFIFO, st_size=1818811431570844075, ...}) = 0
mprotect(0xf77c4000, 4096, PROT_READ)   = 0
mprotect(0xf77c1000, 4096, PROT_READ)   = 0
mprotect(0xf77b8000, 4096, PROT_READ)   = 0
mprotect(0xf77a7000, 4096, PROT_READ)   = 0
mprotect(0xf77cc000, 4096, PROT_READ)   = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
getpid()                                = 20905
getrlimit(RLIMIT_STACK, {rlim_cur=-4286578688, rlim_max=-30920152606563096}) = 0
setrlimit(RLIMIT_STACK, {rlim_cur=-4292878336, rlim_max=-30920152606563096}) = 0
rt_sigaction(SIGRTMIN, {0xf77b73d4, [], SA_RESTORER, 0xf7774b2f}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xf77b7406, [RTMIN], SA_RESTORER, 0xf7774b2f}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0xf77b74a6, [], SA_RESTORER, 0xf7774b2f}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
Comment 1 Bernhard Reutner-Fischer 2011-02-09 17:48:04 UTC
Hi,

This should be fixed on current master.
Please confirm.
Comment 2 Bernhard Reutner-Fischer 2012-04-18 09:03:34 UTC
Should be fixed in current release and master.