MIPS NPTL 0.9.32-rc2 - partially working

Tony Wu tung7970 at gmail.com
Fri Feb 11 13:43:52 UTC 2011


Hello,

I am having some issue with 0.9.32-rc2 NPTL on MIPS. Basically,
everything works fine except for shared-linked binaries that are not
linked with pthread. In other words, If a shared-linked binary is not
linked against pthread, it crashes.

Here's the experiments I have done:

1. static linked binaries with and without pthread - worked
2. shared linked binaries linked with pthread - worked (no matter they
actually use pthread or not)
3. shared linked binaries  not linked with pthread - crashed

I am not the expert on this, but I guess it has something to do with
the TLS part of the ldso. I appreciate if anyone can give me some
direction to continue debugging or to share some experiences in
getting NPTL to work on MIPS.

Thanks,
Tony

---- here's some debug information ---
# cp
_dl_get_ready_to_run:320: Cool, ldso survived making function calls
_dl_malloc:196: mmapping more memory
_dl_get_ready_to_run:495: Lib Loader: (0x2aaa8000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:434: calling mprotect on the application program
_dl_load_elf_shared_library:740: Found TLS header for /lib/libc.so.0
_dl_load_elf_shared_library:763: Relocated TLS initial image from
0x50d3c to 0x2ab12d3c (size = 0x4)
_dl_get_ready_to_run:804: Loading: (0x2aac2000) /lib/libc.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab19000) /lib/libgcc_s.so.1
_dl_get_ready_to_run:804: Loading: (0x2aac2000) /lib/libc.so.0
_dl_get_ready_to_run:945: Calling init_tls()!
_dl_malloc:196: mmapping more memory
_dl_get_ready_to_run:963: Beginning relocation fixups
TLS_TPREL  : , 0x4, 0xffff9004
TLS_TPREL  : , 0xc, 0xffff900c
TLS_DTPMOD : , 0, 1
TLS_TPREL  : , 0x0, 0xffff9000
TLS_TPREL  : , 0x8, 0xffff9008
_dl_get_ready_to_run:992: Calling _dl_allocate_tls_init()!
_dl_get_ready_to_run:1017: Calling _dl_find_hash!
_dl_get_ready_to_run:1048: Calling _run_array_forward!
_dl_get_ready_to_run:1054: Calling _run_array_forward, done!
_dl_get_ready_to_run:1069: calling INIT: /lib/libc.so.0 - 0x2ab09c90
_dl_get_ready_to_run:1069: calling INIT: /lib/libgcc_s.so.1 - 0x2ab242c8
_dl_get_ready_to_run:1078: Calling _dl_find_hash!
_dl_start:327: transfering control to application
Segmentation fault
#

# pthread-join
_dl_get_ready_to_run:320: Cool, ldso survived making function calls
_dl_malloc:196: mmapping more memory
_dl_get_ready_to_run:495: Lib Loader: (0x2aaa8000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:434: calling mprotect on the application program
_dl_get_ready_to_run:804: Loading: (0x2aac2000) /lib/libpthread.so.0
_dl_get_ready_to_run:804: Loading: (0x2aae9000) /lib/libm.so.0
_dl_load_elf_shared_library:740: Found TLS header for /lib/libc.so.0
_dl_load_elf_shared_library:763: Relocated TLS initial image from
0x50d3c to 0x2ab60d3c (size = 0x4)
_dl_get_ready_to_run:804: Loading: (0x2ab10000) /lib/libc.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab67000) /lib/libgcc_s.so.1
_dl_get_ready_to_run:804: Loading: (0x2ab9f000) /lib/libdl.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab10000) /lib/libc.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab10000) /lib/libc.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab10000) /lib/libc.so.0
_dl_get_ready_to_run:804: Loading: (0x2ab10000) /lib/libc.so.0
_dl_get_ready_to_run:945: Calling init_tls()!
_dl_malloc:196: mmapping more memory
_dl_get_ready_to_run:963: Beginning relocation fixups
TLS_TPREL  : , 0x4, 0xffff9004
TLS_TPREL  : , 0xc, 0xffff900c
TLS_DTPMOD : , 0, 1
TLS_TPREL  : , 0x0, 0xffff9000
TLS_TPREL  : , 0x8, 0xffff9008
TLS_TPREL  : errno, 0x0, 0xffff9004
TLS_DTPMOD : h_errno, 0, 1
TLS_DTPREL : h_errno, 0x0, 0xffff8008
TLS_TPREL  : __resp, 0x0, 0xffff9000
_dl_get_ready_to_run:992: Calling _dl_allocate_tls_init()!
_dl_get_ready_to_run:1017: Calling _dl_find_hash!
_dl_get_ready_to_run:1048: Calling _run_array_forward!
_dl_get_ready_to_run:1054: Calling _run_array_forward, done!
_dl_get_ready_to_run:1069: calling INIT: /lib/libc.so.0 - 0x2ab57c90
_dl_get_ready_to_run:1069: calling INIT: /lib/libgcc_s.so.1 - 0x2ab722c8
_dl_get_ready_to_run:1069: calling INIT: /lib/libpthread.so.0 - 0x2aacb484
_dl_get_ready_to_run:1078: Calling _dl_find_hash!
_dl_start:327: transfering control to application
_dl_update_slotinfo:704: Updating slotinfo for module 1
Main: creating thread 0
Main: creating thread 1
Main: creating thread 2
Thread 1 starting...
Thread 0 starting...
Main: creating thread 3
Thread 2 starting...
Thread 3 starting...
Thread 0 done. Result = 2.070954e+02
Thread 1 done. Result = 2.070954e+02
Thread 3 done. Result = 2.070954e+02
Main: completed join with thread 0 having a status of 0
Main: completed join with thread 1 having a status of 1
Thread 2 done. Result = 2.070954e+02
Main: completed join with thread 2 having a status of 2
Main: completed join with thread 3 having a status of 3
Main: program completed. Exiting.


More information about the uClibc mailing list