NPTL MIPS, current git head, programs block on startup

Timo Teräs timo.teras at iki.fi
Tue Apr 27 10:12:52 UTC 2010


Andreas Schultz wrote:
> With the current git head (00891d9cf07efd992023f255164bba93d657ece4)
> NPTL no longer works on MIPS. It did work with
> a501a33e9761f32b3d38ab9f113892abe7cef3f1.
> 
> The problem is somewhere in the _pthread_cleanup_push_defer:
> 
> Program terminated with signal 5, Trace/breakpoint trap.
> #0  _pthread_cleanup_push_defer (buffer=<value optimized out>,
> routine=<value optimized out>, arg=<value optimized out>) at
> libpthread/nptl/forward.c:148
> 148	FORWARD2(_pthread_cleanup_push_defer,
> (gdb) bt
> #0  _pthread_cleanup_push_defer (buffer=<value optimized out>,
> routine=<value optimized out>, arg=<value optimized out>) at
> libpthread/nptl/forward.c:148
> #1  0x2ac90ef0 in *__GI_openlog (ident=0x7fc74f48 "hotplug",
> logstat=3, logfac=24) at libc/misc/syslog/syslog.c:176
> #2  0x004027cc in main (argc=2, argv=0x7fc74454) at ctrl.c:932
> 
> It seems that it is stuck in a endless loop, where the FORWARD2
> wrapper calls itself instead of the real implementation.

Uh. Is the application linked against libc before libpthread?
Check with ldd the order of how libraries are pulled in.

> Looking at init.c my best guess would be that
> .ptr__pthread_cleanup_push_defer should be initialized with
> __pthread_cleanup_push_defer and not with _pthread_cleanup_push_defer
> (two undelines instead of one).

It's because MIPS ld.so is not supporting protected symbols yet.
Mmm... Using the two underscore variant might help for immediate
problems, but other things will broken unless protected symbols
are implemented.

Changing linking order of application to pull in libpthread first
should fix it too.


More information about the uClibc mailing list