BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002414 [uClibc] Posix Threads major always 03-03-08 14:52 10-14-08 00:24
Reporter pqa View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status feedback   Product Version
Summary 0002414: Order of linking libraries can causes application not to run
Description Using uClibc version 0.9.29, linking with -nodefaultlibs -lc -lpthreads causes the application to consume 100% CPU time indefinitely, before main() is called. Linking with -nodefaultlibs -lpthreads -lc allows the application to run.

Application is cross compiled to run on bcrm47xx mipsel processor, using gcc 4.1.2 and is using libpthreads.old.

I can provide further information if needed, but I am not sure what other information would be helpful.

Attached file builds example application in form that works and form that doesn't.
Additional Information
Attached Files  pthread.proc [^] (631 bytes) 03-03-08 14:52
 ld-uClibc.so.0.elf [^] (1,166 bytes) 10-12-08 00:55
 libc.so.0.elf [^] (1,157 bytes) 10-12-08 00:56
 libpthread.so.0.elf [^] (1,273 bytes) 10-12-08 00:56
 pqa-pfirst.elf [^] (1,260 bytes) 10-12-08 00:56
 pqa-plast.elf [^] (1,260 bytes) 10-12-08 00:56

- Relationships

- Notes
(0006084)
xi
03-26-08 14:49
edited on: 03-26-08 14:56

This is very similar to what I encountered with our MIPS toolchain and NPTL. 0002264 might be the same problem too.

I found one potential cause:

- Once libpthread is linked, standard loader is used instead of uClibc loader


Here is a console log showing this problem with ldd:

$ /opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-gcc -o test testc.o
/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-ldd test
checking sub-depends for 'not found'
        libc.so.0 => not found (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)


/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-gcc -o test testc.o –lpthread
$ /opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-ldd test
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for '/lib/libc.so.6'
        libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
        libc.so.0 => not found (0x00000000)
        libc.so.6 => /lib/libc.so.6 (0x00000000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
$

 
(0013314)
carmelo73
10-11-08 23:49

The fact that there is a dependencies on /lib/libc.so.6, means that some libraries
are not correclty built.
Wrong compiler configuration ? wrong libraries used ?

Please post the output of the command 'readelf -d' executed over your test and linked libraries to check which is the offending one.
 
(0013354)
pqa
10-12-08 00:58

Output of readelf -d uploaded for libraries and programs. As a reminder, pqa-plast has the problem, pqa-pfirst works Ok.
 
(0013384)
bernhardf
10-12-08 13:54

Can you please verify that this problem can still be observed with:
- uClibc-trunk
- gcc-4.3.2 (i.e. the current, stable gcc, just in case)
- binutils >= 2.18 (preferably 2.18.50.0.9)

If this fails, please double-check against the uClibc-nptl branch.
TIA,
 
(0013514)
pqa
10-13-08 17:06

Hi Bernhard,

I am happy to try as you suggest with the latest versions of uClibc, gcc and binutils, but some suggestions as to how best to do that would be appreciated. I currently use OpenWRT, and so have been using the toolchain provided in that, and am not familiar with how to change the toolchain or the components in it.

I have also noted that the svn repository on uclibc.org for buildroot doesn't support gcc 4.3.2 and the latest binutils is 2.18.50.0.1, so I assume I am looking in the wrong place there.
 
(0013544)
bernhardf
10-14-08 00:24

My repo is here: http://repo.or.cz/w/buildroot.git/ [^]
but try to use uClibc trunk first with your existing toolchain.
Also, which pthreads do you use, linuxthreads.old or the (new) linuxthreads?
Try to use the other one.
 

- Issue History
Date Modified Username Field Change
03-03-08 14:52 pqa New Issue
03-03-08 14:52 pqa Status new => assigned
03-03-08 14:52 pqa Assigned To  => uClibc
03-03-08 14:52 pqa File Added: pthread.proc
03-26-08 14:49 xi Note Added: 0006084
03-26-08 14:54 xi Note Edited: 0006084
03-26-08 14:56 xi Note Edited: 0006084
10-11-08 23:49 carmelo73 Note Added: 0013314
10-11-08 23:49 carmelo73 Status assigned => feedback
10-12-08 00:55 pqa File Added: ld-uClibc.so.0.elf
10-12-08 00:56 pqa File Added: libc.so.0.elf
10-12-08 00:56 pqa File Added: libpthread.so.0.elf
10-12-08 00:56 pqa File Added: pqa-pfirst.elf
10-12-08 00:56 pqa File Added: pqa-plast.elf
10-12-08 00:58 pqa Note Added: 0013354
10-12-08 13:54 bernhardf Note Added: 0013384
10-13-08 17:06 pqa Note Added: 0013514
10-14-08 00:24 bernhardf Note Added: 0013544


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker