[uClibc 0002264]: pthread issues with 0.9.29

bugs at busybox.net bugs at busybox.net
Sat Feb 23 01:25:33 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=2264 
====================================================================== 
Reported By:                kannappan
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   2264
Category:                   Posix Threads
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             02-20-2008 03:29 PST
Last Modified:              02-22-2008 17:25 PST
====================================================================== 
Summary:                    pthread issues with 0.9.29
Description: 
I am using uclibc0.9.29, binutils 2.18 for ARM926T
I am facing problems executing applications which uses pthread.
when including pthread library my application crashes giving message
"segmentation fault". But the same is working with glibc .

When I debugged using strace It gave following error message

# strace  ./run_loop
execve("./run_loop", ["./run_loop"], [/* 16 vars */]) = -1 ENOEXEC (Exec
format
error)
write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format
error
) = 32
exit(1)                                 = ?
Process 738 detached

====================================================================== 

---------------------------------------------------------------------- 
 carmelo73 - 02-20-08 04:40  
---------------------------------------------------------------------- 
>From your output there is no evidence of a segfault. Please provide more
information.
Command line used to build your application. Source code if available.
Further I suggest you to build with debug synmbol (both your application
and uclibc) and start using gdb to debug.
The info you provide are not enough to figure out what is going wrong 

---------------------------------------------------------------------- 
 kannappan - 02-22-08 00:06  
---------------------------------------------------------------------- 
The problem happens when -lpthread is used along with -lc.

for example:

# arm-linux-gcc -lc -lpthread sample.c 

The strace for this attached.

The same program works when i compile with
# arm-linux-gcc -lpthread sample.c 

---------------------------------------------------------------------- 
 carmelo73 - 02-22-08 00:13  
---------------------------------------------------------------------- 
As a general suggestion, you don't need to link explicitly against libc
(-lc)...
it is done by default by the compiler (append -v at your build command and
you will see what it is doing silently)
Further are you sure arm-linux-gcc is properly configured for uClibc ?
Could you post the output of the command readelf -l <executable> ? 

---------------------------------------------------------------------- 
 vapier - 02-22-08 17:25  
---------------------------------------------------------------------- 
straces are not terribly useful when talking about a threading crash

please post a source code test case which we can compile/debug 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-20-08 03:29  kannappan      New Issue                                    
02-20-08 03:29  kannappan      Status                   new => assigned     
02-20-08 03:29  kannappan      Assigned To               => uClibc          
02-20-08 04:40  carmelo73      Note Added: 0005174                          
02-20-08 04:40  carmelo73      Status                   assigned => feedback
02-22-08 00:03  kannappan      File Added: a                                
02-22-08 00:06  kannappan      Note Added: 0005224                          
02-22-08 00:13  carmelo73      Note Added: 0005234                          
02-22-08 17:25  vapier         Note Added: 0005254                          
======================================================================




More information about the uClibc-cvs mailing list