uclibc segfault in ldso

Nigel Kukard nkukard at lbsd.net
Thu Mar 27 14:21:55 UTC 2008


Ok,

I've tracked this error now in uclibc svn to these lines in
ldso/ldso.c...

Segfault now occurs on that line ...

        if (tpnt->dynamic_info[DT_INIT]) {                                                                                                                             
            void (*dl_elf_func) (void);                                                                                                                                                                                                                                                  
                                                                                                                                                                       
            dl_elf_func = (void (*)(void)) DL_RELOC_ADDR(tpnt->loadaddr, tpnt->dynamic_info[DT_INIT]);                                                                                                                                                                                    
                                                                                                                                                                       
            _dl_if_debug_dprint("calling INIT: %s\n\n", tpnt->libname);                                                                                                                                                                                                                   
                                                                                                                                                                       
======>>>>>            DL_CALL_FUNC_AT_ADDR (dl_elf_func, tpnt->loadaddr, (void(*)(void)));                                                                                       
            _dl_debug_early("We got here: %i\n",__LINE__);                                                                                                                     
        }        


Here is the GDB trace...
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-linux-uclibc"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /bin/rpm 
argc=1 argv=0xbf9ef704 envp=0xbf9ef70c
ELF header=0xb7fca000
First Dynamic section entry=0xb7fd5ef8
Scanning DYNAMIC section
Done scanning DYNAMIC section
About to do library loader relocations
Done relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_get_ready_to_run:264: Position Independent Executable: app_tpnt->loadaddr=0x80000000
_dl_malloc:937: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0xb7fca000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:292: calling mprotect on the application program
_dl_get_ready_to_run:621: Loading: (0xb7f3a000) /usr/lib/librpm-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7de8000) /usr/lib/librpmdb-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7d34000) /usr/lib/librpmio-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7d2c000) /usr/lib/libpopt.so.0
_dl_get_ready_to_run:621: Loading: (0xb7d11000) /usr/lib/libelf.so.0
_dl_get_ready_to_run:621: Loading: (0xb7cdc000) /usr/lib/libbeecrypt.so.6
_dl_get_ready_to_run:621: Loading: (0xb7cc7000) /usr/lib/libneon.so.25
_dl_get_ready_to_run:621: Loading: (0xb7ca6000) /usr/lib/libexpat.so.1
_dl_get_ready_to_run:621: Loading: (0xb7c95000) /lib/libm.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c90000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c7a000) /usr/lib/libz.so.1
_dl_get_ready_to_run:621: Loading: (0xb7c64000) /lib/libpthread.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7de8000) /usr/lib/librpmdb-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7d34000) /usr/lib/librpmio-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7d2c000) /usr/lib/libpopt.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7d34000) /usr/lib/librpmio-4.4.so
_dl_get_ready_to_run:621: Loading: (0xb7d2c000) /usr/lib/libpopt.so.0
_dl_get_ready_to_run:621: Loading: (0xb7d11000) /usr/lib/libelf.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c64000) /lib/libpthread.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7cdc000) /usr/lib/libbeecrypt.so.6
_dl_get_ready_to_run:621: Loading: (0xb7cc7000) /usr/lib/libneon.so.25
_dl_get_ready_to_run:621: Loading: (0xb7c95000) /lib/libm.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c90000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c7a000) /usr/lib/libz.so.1
_dl_get_ready_to_run:621: Loading: (0xb7c64000) /lib/libpthread.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c64000) /lib/libpthread.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c90000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c7a000) /usr/lib/libz.so.1
_dl_get_ready_to_run:621: Loading: (0xb7ca6000) /usr/lib/libexpat.so.1
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0xb7c05000) /lib/libc.so.0
_dl_malloc:937: mmapping more memory
_dl_get_ready_to_run:748: Beginning relocation fixups
_dl_get_ready_to_run:764: We got here: 764
_dl_get_ready_to_run:769: We got here: 769
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:771: We got here: 771
_dl_get_ready_to_run:782: We got here: 782
_dl_get_ready_to_run:792: We got here: 792
_dl_get_ready_to_run:811: We got here: 811
_dl_get_ready_to_run:818: We got here: 818
_dl_get_ready_to_run:822: We got here: 822
_dl_get_ready_to_run:828: We got here: 828
_dl_get_ready_to_run:832: We got here: 832
_dl_get_ready_to_run:835: We got here: 835
_dl_get_ready_to_run:838: We got here: 838

Program received signal SIGSEGV, Segmentation fault.
0xb7c368fd in ?? ()
(gdb) bt
#0  0xb7c368fd in ?? ()
#1  0xb7fcb2a8 in _dl_do_reloc (tpnt=0xb7c63820, scope=0x0, rpnt=0xb8, symtab=0xb7c59ab0, strtab=0x1000 "5\a") at ldso/ldso/i386/elfinterp.c:238
#2  0xb7c59ace in ?? ()
#3  0xb7c63820 in ?? ()
#4  0x00000000 in ?? ()
(gdb) 


Not sure if I"m doing anything wrong, I enabled -g3 in uclibc build and all debugging options, but I'm still getting ?? 's there.

Anywhere I can look to try find the problem?

Regards
Nigel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20080327/8cbf7738/attachment-0002.pgp 


More information about the uClibc mailing list