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
0005694 [uClibc] Other major always 10-23-08 06:48 11-10-08 09:18
Reporter rhabarber1848 View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status acknowledged   Product Version 0.9.30
Summary 0005694: uClibc-0.9.30-rc2 apps always segfault due to using the downloaded pregenerated locale data
Description I am working on extending the Tuxbox environment with working uClibc support[2].
Currently uClibc 0.9.28.3 is working well with our setup but getting 0.9.30-rc2
to work seems impossible.

Our compile environment includes:
- binutils 2.17.50.0.9 (2.19.50.0.1 shows the same result)
- gcc-3.4.6 including uClibc-patches
- Linux kernel 2.4.36.6
- Busybox 1.7.2

Booting into a uClibc 0.9.30-rc2 environment shows this:

[...]
Mounted devfs on /dev
Freeing unused kernel memory: 72k init
ELF0x30000000
ELF0x3001d09c
ELELELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:747: Beginning relocation fixups

After this point the boot process hangs.
Booting into a uClibc-0.9.28.3 environment, then chroot'ing into
uClibc 0.9.30-rc2 produces SEGFAULT for all binaries tested.
Here is a gdb backtrace, please note that both uClibc 0.9.28.3 and 0.9.30-rc2
were compiled with debug options enabled:

# gdb --args chroot /mnt /bin/busybox ash
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libintl.so.0
_dl_get_ready_to_run:621: Loading: (0x30028000) /lib/libncurses.so.5
_dl_get_ready_to_run:621: Loading: (0x30097000) /lib/libm.so.0
_dl_get_ready_to_run:621: Loading: (0x300cb000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10033cb0
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> [^]
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-tuxbox-linux-uclibc"...
(no debugging symbols found)
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox ash
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
340 dl-elf.c: No such file or directory.
        in dl-elf.c
(gdb) bt full
0 0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
        dynamic_addr = 0
        tpnt = (struct elf_resolve *) 0x0
        ppnt = (Elf32_Phdr *) 0x0
        status = 0x0
        dynamic_info = {2147483501, 2147483511, 2147483518, 2147483531, 2147483543, 2147483554, 2147483570,
  2147483584, 2147483590, 2147483599, 0, 22, 22, 22, 22, 19, 16, 20, 16, 21, 0, 16, 2214592512, 6, 4096, 17,
  100, 3, 268435508, 4, 32, 5, 7, 7, 805306368, 8}
        lpnt = (long unsigned int *) 0x0
        minvma = 0
        maxvma = 0
        i = 0
        flags = 0
        piclib = 0
        relro_addr = 0
        relro_size = 0
        st = {st_dev = 0, st_ino = 9, st_mode = 268449032, st_nlink = 0, st_uid = 0, st_gid = 12, st_rdev = 0,
  st_size = 13, st_blksize = 0, st_blocks = 14, st_atime = 0, __unused1 = 0, st_mtime = 0, __unused2 = 0,
  st_ctime = 0, __unused3 = 0, __unused4 = 0, __unused5 = 0}
        __FUNCTION__ = "\201)\000\020\200\037\0008\220\t\000\024\201?\0008\200\t\000\020\220\037\0008H\000\001\020"
0000001 0x54483d2f in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

[1] Tuxbox is a Linux-based software for digital TV receivers like Dbox2/Dreambox
[2] http://tuxbox-forum.dreambox-fan.de/forum/viewtopic.php?f=7&t=46625 [^]
Additional Information
Attached Files  .config [^] (5,371 bytes) 10-23-08 06:50
 gcc-uclibc-locale.diff [^] (21,100 bytes) 10-23-08 06:54
 kernel_dot_config [^] (19,936 bytes) 10-23-08 06:58
 uclibc-0.9.30-rc3.config [^] (5,479 bytes) 10-30-08 04:06
 uclibc-locale.diff [^] (65,253 bytes) 11-03-08 13:40
 uclibc_compile.diff.bz2 [^] (124,206 bytes) 11-07-08 13:39
 config.bernhard [^] (6,153 bytes) 11-07-08 15:06

- Relationships

- Notes
(0014044)
rhabarber1848
10-23-08 06:50

Attached you will find .config for uClibc 0.9.30-rc2-svn. This code is based
on yesterdays snapshot but the segfaults also happen with 0.9.30-rc2 tarball.
 
(0014054)
rhabarber1848
10-23-08 06:54

gcc-3.4.6 is compiled using two patches, one general uClibc patch[1] based on
trunk/buildroot/toolchain/gcc/3.4.6/200-uclibc-locale.patch which is working
well with 0.9.28.3 and another patch consisting of back-ported code from

trunk/buildroot/toolchain/gcc/4.2.4/203-uclibc-locale-no__x.patch
trunk/buildroot/toolchain/gcc/4.2.4/204-uclibc-locale-wchar_fix.patch
trunk/buildroot/toolchain/gcc/4.2.4/205-uclibc-locale-update.patch

to fix locale-related compile bugs. This gcc-uclibc-locale.diff you will
find attached to this bug report.

[1] http://cvs.tuxbox.org/tuxbox/cdk/Patches/gcc-uclibc.diff?view=markup [^]
 
(0014064)
rhabarber1848
10-23-08 06:57

Please note that updating gcc is not an option for us.

Weird enough binaries linked against uClibc-0.9.30-rc2 work in uClibc 0.9.28.3
environments:

# pwd
/
# ls -la /lib/libuC*
-rw-r--r-- 1 root root 45305281 Oct 23 2008 /lib/libuClibc-0.9.28.so
# /mnt/bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003508
BusyBox v1.7.2 (2008-10-23 14:19:27 CEST) multi-call binary
Copyright (C) 1998-2006  Erik Andersen, Rob Landley, and others.
Licensed under GPLv2.  See source distribution for full notice.
[...]
 
(0014074)
rhabarber1848
10-23-08 06:59

Attached as kernel_dot_config you will also find the kernel .config used.
 
(0014094)
rhabarber1848
10-23-08 14:57

In my compile environment I was able to get uClibc 0.9.29 to work,
even including gcc-3.4.6 patched with gcc-uclibc-locale.diff, so I
think this patch is not the reason for the segfaults reported here.
 
(0014144)
bernhardf
10-25-08 01:28

Please provide a "bt f" at the time of the segfault (on current trunk), not your breakpoint.
 
(0014164)
rhabarber1848
10-25-08 05:28

(gdb) bt f
0 0x300d5c30 in _dl_run_init_array () from /lib/libdl.so.0
No symbol table info available.
0000001 0x300d5cbc in _dl_app_init_array () from /lib/libdl.so.0
No symbol table info available.
2 0x305e82b4 in __uClibc_main () from /lib/libc.so.0
No symbol table info available.
0000003 0x00000000 in ?? ()
No symbol table info available.
 
(0014174)
bernhardf
10-25-08 11:14

.. with DOASSERTS, and debugging enabled..
 
(0014224)
rhabarber1848
10-26-08 04:22

I recompiled uClibc 0.9.28.3 and 0.9.30 (yesterdays SVN snapshot) with debug options enabled and booted into 0.9.28.3.

When starting "chroot /mnt /bin/busybox" I receive

transfering control to application @ 0x10003550
ELF0x30000000
ELF0x3001d09c
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:747: Beginning relocation fixups
Segmentation fault

but when using gdb I can only see a SIGTRAP like the one I posted above.
Weird is that the segfault happens immediatly while SIGTRAP occurs after
~ 60s of visual inactivity:

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
340 dl-elf.c: No such file or directory.
        in dl-elf.c

Please note that I am not an expert with gdb. I tried to run gdb with some options to adjust to the chroot:

# gdb --args chroot /mnt /bin/busybox
GNU gdb 6.8
This GDB was configured as "powerpc-tuxbox-linux-uclibc"...
(no debugging symbols found)
(gdb) set sysroot /mnt
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_start (args=Cannot access memory at address 0x8
) at ./ldso/include/dl-syscall.h:72
72 ./ldso/include/dl-syscall.h: No such file or directory.
        in ./ldso/include/dl-syscall.h

Do you need more informations?
 
(0014234)
rhabarber1848
10-26-08 04:29

Forgot to add "bt f".

This after the 60s pause:

(gdb) set solib-search-path /mnt/lib
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
340 dl-elf.c: No such file or directory.
        in dl-elf.c
(gdb) bt f
0 0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
        dynamic_addr = 0
        tpnt = (struct elf_resolve *) 0x0
        ppnt = (Elf32_Phdr *) 0x0
        status = 0x0
        dynamic_info = {2147483511, 2147483518, 2147483531, 2147483543, 2147483554, 2147483570, 2147483584,
  2147483590, 2147483599, 0, 22, 22, 22, 22, 19, 16, 20, 16, 21, 0, 16, 2214592512, 6, 4096, 17, 100, 3,
  268435508, 4, 32, 5, 7, 7, 805306368, 8, 0}
        lpnt = (long unsigned int *) 0x0
        minvma = 0
        maxvma = 0
        i = 0
        flags = 0
        piclib = 0
        relro_addr = 0
        relro_size = 0
        st = {st_dev = 9, st_ino = 268448996, st_mode = 11, st_nlink = 0, st_uid = 12, st_gid = 0, st_rdev = 13,
  st_size = 0, st_blksize = 14, st_blocks = 0, st_atime = 0, __unused1 = 0, st_mtime = 794978670,
  __unused2 = 794981747, st_ctime = 2036494200, __unused3 = 5591877, __unused4 = 1379758703,
  __unused5 = 1869873224}
        __FUNCTION__ = "\201)\000\020\200\037\0008\220\t\000\024\201?\0008\200\t\000\020\220\037\0008H\000\001\020"
0000001 0x2f004c49 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
 
(0014244)
rhabarber1848
10-26-08 04:30

And this is the second case using sysroot option in gdb:

(gdb) set sysroot /mnt
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_start (args=Cannot access memory at address 0x8
) at ./ldso/include/dl-syscall.h:72
72 ./ldso/include/dl-syscall.h: No such file or directory.
        in ./ldso/include/dl-syscall.h
(gdb) bt f
0 0x300026d4 in _dl_start (args=Cannot access memory at address 0x8
) at ./ldso/include/dl-syscall.h:72
        tmp1 = Cannot access memory at address 0x27c
(gdb)
 
(0014384)
bernhardf
10-27-08 09:50

Please try this patch on top of a clean trunk checkout and let me know how that behaves..
http://uclibc.org/~aldot/uClibc/maybe-fixup-23660+23698.patch [^]
 
(0014394)
rhabarber1848
10-27-08 12:55

Again I recompiled uClibc 0.9.28.3 and 0.9.30 trunk (revision 23822) with debug options enabled, booting into 0.9.30 directly does not work:

[kernel boot messages ...]
Freeing unused kernel memory: 72k init
ELF0x30000000
ELF0x3001d09c
ELELELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:747: Beginning relocation fixups

Here the boot process came to a halt. So I booted into 0.9.28.3 and tried
chroot again:

# ls -la /lib/*uC*
-rw-r--r-- 1 root root 45376884 Oct 27 2008 /lib/libuClibc-0.9.28.so
# chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x3001d09c
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:747: Beginning relocation fixups
Segmentation fault
#

Here is the gdb backtrace:

# gdb --args chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libintl.so.0
_dl_get_ready_to_run:621: Loading: (0x30028000) /lib/libncurses.so.5
_dl_get_ready_to_run:621: Loading: (0x30097000) /lib/libm.so.0
_dl_get_ready_to_run:621: Loading: (0x300cb000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10033e70
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> [^]
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-tuxbox-linux-uclibc"...
(no debugging symbols found)
(gdb) set sysroot /mnt
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_start (args=Cannot access memory at address 0x8
) at ./ldso/include/dl-syscall.h:72
72 ./ldso/include/dl-syscall.h: No such file or directory.
        in ./ldso/include/dl-syscall.h
(gdb) bt f
0 0x300026d4 in _dl_start (args=Cannot access memory at address 0x8
) at ./ldso/include/dl-syscall.h:72
        tmp1 = Cannot access memory at address 0x27c
(gdb)

Here is another gdb backtrace using option solib-search-path,
again with 60s pause during execution:

# gdb --args chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libintl.so.0
_dl_get_ready_to_run:621: Loading: (0x30028000) /lib/libncurses.so.5
_dl_get_ready_to_run:621: Loading: (0x30097000) /lib/libm.so.0
_dl_get_ready_to_run:621: Loading: (0x300cb000) /lib/libdl.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300de000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x300fb000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10033e70
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> [^]
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-tuxbox-linux-uclibc"...
(no debugging symbols found)
(gdb) set solib-search-path /mnt/lib
(gdb) run
Starting program: /sbin/chroot /mnt /bin/busybox
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550
ELF0x30000000
ELF0x30016820
ELFELFELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:197: Cool, ldso survived making function calls
_dl_malloc:899: mmapping more memory
_dl_get_ready_to_run:352: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:621: Loading: (0x30017000) /lib/libcrypt.so.0
_dl_get_ready_to_run:621: Loading: (0x3003d000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:621: Loading: (0x3005a000) /lib/libc.so.0
_dl_get_ready_to_run:744: Beginning relocation fixups
transfering control to application @ 0x10003550

Program received signal SIGTRAP, Trace/breakpoint trap.
0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
340 dl-elf.c: No such file or directory.
        in dl-elf.c
(gdb) bt f
0 0x300026d4 in _dl_load_elf_shared_library (secure=0, rpnt=0x0, libname=0x0) at dl-elf.c:340
        dynamic_addr = 0
        tpnt = (struct elf_resolve *) 0x0
        ppnt = (Elf32_Phdr *) 0x0
        status = 0x0
        dynamic_info = {2147483511, 2147483518, 2147483531, 2147483543, 2147483554, 2147483570, 2147483584,
  2147483590, 2147483599, 0, 22, 22, 22, 22, 19, 16, 20, 16, 21, 0, 16, 2214592512, 6, 4096, 17, 100, 3,
  268435508, 4, 32, 5, 7, 7, 805306368, 8, 0}
        lpnt = (long unsigned int *) 0x0
        minvma = 0
        maxvma = 0
        i = 0
        flags = 0
        piclib = 0
        relro_addr = 0
        relro_size = 0
        st = {st_dev = 9, st_ino = 268448996, st_mode = 11, st_nlink = 0, st_uid = 12, st_gid = 0, st_rdev = 13,
  st_size = 0, st_blksize = 14, st_blocks = 0, st_atime = 0, __unused1 = 0, st_mtime = 794978670,
  __unused2 = 794981747, st_ctime = 2036494200, __unused3 = 5591877, __unused4 = 1379758703,
  __unused5 = 1869873224}
        __FUNCTION__ = "\201)\000\020\200\037\0008\220\t\000\024\201?\0008\200\t\000\020\220\037\0008H\000\001\020"
0000001 0x2f004c49 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

So your patch does not fix the problem. Do you have any ideas
how I can further debug this problem?
 
(0014404)
bernhardf
10-27-08 13:38

export MALLOC_DEBUG=16
is what i aimed at with said patch.

Ok, for a start, turn off FORCE_SHAREABLE_TEXT_SEGMENTS, the "classic" is meaningless by now, COMPAT_ATEXIT doesn't make sense, UCLIBC_SUSV3_LEGACY is something i don't do, UCLIBC_SUSV3_LEGACY_MACROS likewise -- fix you legacy apps instead, UCLIBC_HAS_GETPT doesn't make sense, UCLIBC_LINUX_MODULE_24 is something you don't _want_ anyway, UCLIBC_HAS_BSD_ERR is outdated, UCLIBC_BSD_SPECIFIC is something you likely don't need, UCLIBC_HAS_EPOLL and UCLIBC_HAS_XATTR huh?
UCLIBC_HAS_STDIO_GETC_MACRO, UCLIBC_HAS_STDIO_PUTC_MACRO no thanks, UCLIBC_HAS_SYS_SIGLIST and UCLIBC_HAS_GNU_GETSUBOPT what for?

So.. who trips this? Which app? Small, standalone example that i can reproduce with qemu?
 
(0014494)
bernhardf
10-28-08 11:37

I cannot reproduce this with current trunk (e.g. r23829 or later).
 
(0014604)
rhabarber1848
10-30-08 04:06

Still the same problem with rev 23853.

Attached you will find the updated uClibc .config: uclibc-0.9.30-rc3.config

turn off FORCE_SHAREABLE_TEXT_SEGMENTS, the "classic" is meaningless by now, COMPAT_ATEXIT doesn't make sense, UCLIBC_SUSV3_LEGACY is something i don't do, UCLIBC_SUSV3_LEGACY_MACROS likewise -- fix you legacy apps instead,
UCLIBC_HAS_GETPT doesn't make sense, UCLIBC_LINUX_MODULE_24 is something you don't _want_ anyway, UCLIBC_HAS_BSD_ERR is outdated, UCLIBC_BSD_SPECIFIC is something you likely don't need, UCLIBC_HAS_EPOLL and UCLIBC_HAS_XATTR huh?
UCLIBC_HAS_STDIO_GETC_MACRO, UCLIBC_HAS_STDIO_PUTC_MACRO no thanks, UCLIBC_HAS_SYS_SIGLIST and UCLIBC_HAS_GNU_GETSUBOPT what for?

I removed the options you mentioned, I only left UCLIBC_BSD_SPECIFIC activated,
because otherwise busybox-1.7.2 would fail to compile:
login.c:(.text.print_login_issue+0x144): undefined reference to `getdomainname'
 
(0014614)
rhabarber1848
10-30-08 04:10

Currently I am having problems chrooting into uClibc 0.9.30-rc3 with a static
bash shell, instead I am posting now the output from the boot process with
"LD_DEBUG=all MALLOC_DEBUG=16" added to the kernel boot arguments:

Kernel command line: root=/dev/nfs rw nfsroot=/root/tuxbox/work_uclibc30/image/cdkroot ip=192.168.1.4:192.168.1.1:192.168.1.8:255.255.255.0:::off console=ttyS0,9600 LD_DEBUG=all MALLOC_DEBUG=16

Linux version 2.4.36.6-dbox2 (root@server) (gcc version 3.4.6) 0000005 Do 30. Okt 12:05:03 CET 2008

I also added some debug code to linux-2.4.36.6/init/main.c

        printk("init debug: before /sbin/init...\n");
        run_init_process("/sbin/init");
        printk("init debug: before /etc/init...\n");
        run_init_process("/etc/init");
        printk("init debug: before /bin/init...\n");
        run_init_process("/bin/init");
        printk("init debug: before /bin/sh...\n");
        run_init_process("/bin/sh");

Now the boot log:

Mounted devfs on /dev
Freeing unused kernel memory: 72k init
init debug: before /sbin/init...
ELF0x30000000
ELF0x3001d370
ELELELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:292: calling mprotect on the application program
_dl_get_ready_to_run:598: file='libcrypt.so.0'; needed by '/sbin/init'
_dl_load_shared_library:212: find library='libcrypt.so.0'; searching
_dl_load_shared_library:288: searching ldso dir='/lib'
_dl_load_elf_shared_library:749:
        file='/lib/libcrypt.so.0'; generating link map
_dl_load_elf_shared_library:750: dynamic: 0x30031818 base: 0x3001e000
_dl_load_elf_shared_library:752: entry: 0x3001e530 phdr: 0x3001e034 phnum: 0x6

_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:598: file='libgcc_s_nof.so.1'; needed by '/sbin/init'
_dl_load_shared_library:212: find library='libgcc_s_nof.so.1'; searching
_dl_load_shared_library:288: searching ldso dir='/lib'
_dl_load_elf_shared_library:749:
        file='/lib/libgcc_s_nof.so.1'; generating link map
_dl_load_elf_shared_library:750: dynamic: 0x3005f0b8 base: 0x30043000
_dl_load_elf_shared_library:752: entry: 0x300447f4 phdr: 0x30043034 phnum: 0x5

_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libgcc_s_nof.so.1
_dl_get_ready_to_run:598: file='libc.so.0'; needed by '/sbin/init'
_dl_load_shared_library:212: find library='libc.so.0'; searching
_dl_load_shared_library:288: searching ldso dir='/lib'
_dl_load_elf_shared_library:749:
        file='/lib/libc.so.0'; generating link map
_dl_load_elf_shared_library:750: dynamic: 0x301343f8 base: 0x30060000
_dl_load_elf_shared_library:752: entry: 0x3006e86c phdr: 0x30060034 phnum: 0x7

_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:598: file='libc.so.0'; needed by '/sbin/init'
_dl_load_shared_library:212: find library='libc.so.0'; searching
_dl_load_shared_library:288: searching ldso dir='/lib'
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0
_dl_get_ready_to_run:598: file='libc.so.0'; needed by '/sbin/init'
_dl_load_shared_library:212: find library='libc.so.0'; searching
_dl_load_shared_library:288: searching ldso dir='/lib'
_dl_get_ready_to_run:620: Loading: (0x30060000) /lib/libc.so.0

INIT/FINI order and dependencies:
lib: /lib/libcrypt.so.0 has deps:
 /lib/libc.so.0
lib: /lib/libgcc_s_nof.so.1 has deps:
 /lib/libc.so.0
lib: /lib/libc.so.0 has deps:

_dl_get_ready_to_run:747: Beginning relocation fixups
_dl_fixup:774: relocation processing: /lib/libc.so.0

__thenan_df
        value=0xc3930 size=0x18 info=0x11 other=0x0 shndx=0x7
        R_PPC_ADDR32 offset=0xd43ec addend=0x0
        patched: 0x0 ==> 0x30123930 @ 0x301343ec
__thenan_df
        value=0xc3930 size=0x18 info=0x11 other=0x0 shndx=0x7
        R_PPC_ADDR32 offset=0xd43f0 addend=0x0
        patched: 0x0 ==> 0x30123930 @ 0x301343f0
__thenan_df
        value=0xc3930 size=0x18 info=0x11 other=0x0 shndx=0x7
        R_PPC_ADDR32 offset=0xd43f4 addend=0x0
        patched: 0x0 ==> 0x30123930 @ 0x301343f4
_stdio_openlist_use_count
        value=0xd5940 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd56d0 addend=0x0
        patched: 0x0 ==> 0x30135940 @ 0x301356d0
stdout
        value=0xd5890 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd56d4 addend=0x0
        patched: 0x0 ==> 0x1006df10 @ 0x301356d4
daylight
        value=0xd5900 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd56d8 addend=0x0
        patched: 0x0 ==> 0x30135900 @ 0x301356d8
__pthread_once
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_GLOB_DAT offset=0xd56e0 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x301356e0
_time_tzlock
        value=0xd44e0 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd56e4 addend=0x0
        patched: 0x0 ==> 0x301344e0 @ 0x301356e4
__locale_mmap
        value=0xd5868 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd56e8 addend=0x0
        patched: 0x0 ==> 0x30135868 @ 0x301356e8
re_syntax_options
        value=0xd58f4 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd56fc addend=0x0
        patched: 0x0 ==> 0x301358f4 @ 0x301356fc
__curlocale_var
        value=0xd587c size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5704 addend=0x0
        patched: 0x0 ==> 0x3013587c @ 0x30135704
optarg
        value=0xd59ec size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5710 addend=0x0
        patched: 0x0 ==> 0x1006df14 @ 0x30135710
opterr
        value=0xd58b0 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd571c addend=0x0
        patched: 0x0 ==> 0x301358b0 @ 0x3013571c
error_message_count
        value=0xd58c4 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5724 addend=0x0
        patched: 0x0 ==> 0x301358c4 @ 0x30135724
__environ
        value=0xd5a00 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5734 addend=0x0
        patched: 0x0 ==> 0x1006df18 @ 0x30135734
tzname
        value=0xd5884 size=0x8 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd573c addend=0x0
        patched: 0x0 ==> 0x30135884 @ 0x3013573c
__libc_tsd_RPC_VARS_data
        value=0xd5a18 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5740 addend=0x0
        patched: 0x0 ==> 0x30135a18 @ 0x30135740
error_print_progname
        value=0xd58c8 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5744 addend=0x0
        patched: 0x0 ==> 0x301358c8 @ 0x30135744
__malloc_state
        value=0xda820 size=0x378 info=0x11 other=0x0 shndx=0x13
        R_PPC_GLOB_DAT offset=0xd5748 addend=0x0
        patched: 0x0 ==> 0x3013a820 @ 0x30135748
__pthread_mutex_unlock
        value=0x86f4c size=0x7c info=0x22 other=0x0 shndx=0x6
        R_PPC_GLOB_DAT offset=0xd5750 addend=0x0
        patched: 0x0 ==> 0x300e6f4c @ 0x30135750
__resolv_lock
        value=0xd4740 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd5760 addend=0x0
        patched: 0x0 ==> 0x30134740 @ 0x30135760
_stdio_openlist
        value=0xd5898 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5764 addend=0x0
        patched: 0x0 ==> 0x30135898 @ 0x30135764
_stdio_openlist_del_count
        value=0xd5944 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd576c addend=0x0
        patched: 0x0 ==> 0x30135944 @ 0x3013576c
optind
        value=0xd58ac size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5770 addend=0x0
        patched: 0x0 ==> 0x1006df1c @ 0x30135770
__pthread_initialize_minimal
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_GLOB_DAT offset=0xd5774 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x30135774
stdin
        value=0xd588c size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5778 addend=0x0
        patched: 0x0 ==> 0x1006df20 @ 0x30135778
_res
        value=0xda5a0 size=0x200 info=0x11 other=0x0 shndx=0x13
        R_PPC_GLOB_DAT offset=0xd5780 addend=0x0
        patched: 0x0 ==> 0x3013a5a0 @ 0x30135780
timezone
        value=0xd5904 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5784 addend=0x0
        patched: 0x0 ==> 0x30135904 @ 0x30135784
_stdio_user_locking
        value=0xd589c size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5788 addend=0x0
        patched: 0x0 ==> 0x3013589c @ 0x30135788
__malloc_lock
        value=0xd4760 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd57a0 addend=0x0
        patched: 0x0 ==> 0x30134760 @ 0x301357a0
__check_rhosts_file
        value=0xd58a8 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd57b8 addend=0x0
        patched: 0x0 ==> 0x301358a8 @ 0x301357b8
__h_errno_location
        value=0x21050 size=0x3c info=0x22 other=0x0 shndx=0x6
        R_PPC_GLOB_DAT offset=0xd57c4 addend=0x0
        patched: 0x0 ==> 0x1006d844 @ 0x301357c4
stderr
        value=0xd5894 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd57d8 addend=0x0
        patched: 0x0 ==> 0x1006df24 @ 0x301357d8
__atexit_lock
        value=0xd4844 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd57e4 addend=0x0
        patched: 0x0 ==> 0x30134844 @ 0x301357e4
optopt
        value=0xd58b4 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd57ec addend=0x0
        patched: 0x0 ==> 0x301358b4 @ 0x301357ec
__pagesize
        value=0xd5a04 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5800 addend=0x0
        patched: 0x0 ==> 0x30135a04 @ 0x30135800
_stdio_openlist_add_lock
        value=0xd4518 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd5804 addend=0x0
        patched: 0x0 ==> 0x30134518 @ 0x30135804
svc_fdset
        value=0xda4e8 size=0x80 info=0x11 other=0x0 shndx=0x13
        R_PPC_GLOB_DAT offset=0xd5810 addend=0x0
        patched: 0x0 ==> 0x3013a4e8 @ 0x30135810
re_max_failures
        value=0xd5880 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5818 addend=0x0
        patched: 0x0 ==> 0x30135880 @ 0x30135818
__errno_location
        value=0x21014 size=0x3c info=0x22 other=0x0 shndx=0x6
        R_PPC_GLOB_DAT offset=0xd5824 addend=0x0
        patched: 0x0 ==> 0x1006d944 @ 0x30135824
_null_auth
        value=0xda568 size=0xc info=0x11 other=0x0 shndx=0x13
        R_PPC_GLOB_DAT offset=0xd582c addend=0x0
        patched: 0x0 ==> 0x3013a568 @ 0x3013582c
error_one_per_line
        value=0xd58d4 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5830 addend=0x0
        patched: 0x0 ==> 0x301358d4 @ 0x30135830
_stdio_openlist_del_lock
        value=0xd4530 size=0x18 info=0x11 other=0x0 shndx=0xe
        R_PPC_GLOB_DAT offset=0xd5834 addend=0x0
        patched: 0x0 ==> 0x30134530 @ 0x30135834
svc_max_pollfd
        value=0xd5960 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd5844 addend=0x0
        patched: 0x0 ==> 0x30135960 @ 0x30135844
rpc_createerr
        value=0xda574 size=0x10 info=0x11 other=0x0 shndx=0x13
        R_PPC_GLOB_DAT offset=0xd5848 addend=0x0
        patched: 0x0 ==> 0x3013a574 @ 0x30135848
svc_pollfd
        value=0xd5964 size=0x4 info=0x11 other=0x0 shndx=0x11
        R_PPC_GLOB_DAT offset=0xd584c addend=0x0
        patched: 0x0 ==> 0x30135964 @ 0x3013584c
__global_locale
        value=0xd5878 size=0x4 info=0x11 other=0x0 shndx=0x10
        R_PPC_GLOB_DAT offset=0xd5850 addend=0x0
        patched: 0x0 ==> 0x30135878 @ 0x30135850
free
        value=0x7aa5c size=0x424 info=0x12 other=0x0 shndx=0x6
        R_PPC_GLOB_DAT offset=0xd5854 addend=0x0
        patched: 0x0 ==> 0x1006da8c @ 0x30135854
__global_locale_data
        value=0xd9510 size=0xb28 info=0x11 other=0x0 shndx=0x13
        R_PPC_ADDR32 offset=0xd5878 addend=0x0
        patched: 0x0 ==> 0x30139510 @ 0x30135878
__global_locale_data
        value=0xd9510 size=0xb28 info=0x11 other=0x0 shndx=0x13
        R_PPC_ADDR32 offset=0xd587c addend=0x0
        patched: 0x0 ==> 0x30139510 @ 0x3013587c_dl_fixup:774: relocation processing: /lib/libgcc_s_nof.so.1

pthread_create
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c014 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x3005f014
pthread_create
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c018 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x3005f018
pthread_create
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c080 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x3005f080
pthread_create
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c08c addend=0x0
        patched: 0x0 ==> 0x0 @ 0x3005f08c
__cxa_finalize
        value=0x0 size=0x10c info=0x22 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c020 addend=0x0
        patched: 0x0 ==> 0x300e21b0 @ 0x3005f020
__deregister_frame_info
        value=0x977c size=0x20 info=0x12 other=0x0 shndx=0x9
        R_PPC_ADDR32 offset=0x1c02c addend=0x0
        patched: 0x0 ==> 0x3004c77c @ 0x3005f02c
__register_frame_info
        value=0x9430 size=0x28 info=0x12 other=0x0 shndx=0x9
        R_PPC_ADDR32 offset=0x1c034 addend=0x0
        patched: 0x0 ==> 0x3004c430 @ 0x3005f034
_Jv_RegisterClasses
        value=0x0 size=0x0 info=0x20 other=0x0 shndx=0x0
        R_PPC_ADDR32 offset=0x1c040 addend=0x0
        patched: 0x0 ==> 0x0 @ 0x3005f040_dl_fixup:774: relocation processing: /lib/libcrypt.so.0
_dl_fixup:774: relocation processing: /sbin/init

stdout
        value=0x1006df10 size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df10 addend=0x0

stdout move 0x4 bytes from 0x30135890 to 0x1006df10 patched: 0x0 ==> 0x301345a8 @ 0x1006df10
optarg
        value=0x1006df14 size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df14 addend=0x0

optarg move 0x4 bytes from 0x301359ec to 0x1006df14 patched: 0x0 ==> 0x0 @ 0x1006df14
__environ
        value=0x1006df18 size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df18 addend=0x0

__environ move 0x4 bytes from 0x30135a00 to 0x1006df18 patched: 0x0 ==> 0x0 @ 0x1006df18
optind
        value=0x1006df1c size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df1c addend=0x0

optind move 0x4 bytes from 0x301358ac to 0x1006df1c patched: 0x0 ==> 0x1 @ 0x1006df1c
stdin
        value=0x1006df20 size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df20 addend=0x0

stdin move 0x4 bytes from 0x3013588c to 0x1006df20 patched: 0x0 ==> 0x30134548 @ 0x1006df20
stderr
        value=0x1006df24 size=0x4 info=0x11 other=0x0 shndx=0x19
        R_PPC_COPY offset=0x1006df24 addend=0x0

stderr move 0x4 bytes from 0x30135894 to 0x1006df24 patched: 0x0 ==> 0x30134608 @ 0x1006df24_dl_get_ready_to_run:825: calling INIT: /lib/libc.so.0


Here the boot hangs.
 
(0014624)
rhabarber1848
10-30-08 04:48

Compile bash 3.2 statically with uClibc 0.9.30-rc3 and tried to start it inside
glibc-2.3.6 environment, it produces this gdb bt :

Program received signal SIGSEGV, Segmentation fault.
0x100fc1f8 in *__GI_memcpy (to=0x101804f6, from=0x10165854, n=6) at libc/string/powerpc/memcpy.c:54
54 libc/string/powerpc/memcpy.c: No such file or directory.
        in libc/string/powerpc/memcpy.c
(gdb) bt f
0 0x100fc1f8 in *__GI_memcpy (to=0x101804f6, from=0x10165854, n=6) at libc/string/powerpc/memcpy.c:54
        rem = 0
        chunks = 0
        tmp1 = 0
        tmp2 = 0
        tmp_to = (unsigned char *) 0x101804f2 ""
        tmp_from = (unsigned char *) 0x10165850 <Address 0x10165850 out of bounds>
0000001 0x100e53bc in _locale_init_l (base=0x1017fbd0) at libc/misc/locale/locale.c:877
No locals.
2 0x100e5524 in _locale_init () at libc/misc/locale/locale.c:941
No locals.
0000003 0x101070ac in *__GI___uClibc_init () at libc/misc/internals/__uClibc_main.c:223
        been_there_done_that = 1
0000004 0x101072f0 in __uClibc_main (main=0x10000244 <main>, argc=1, argv=0x7ffffe64, app_init=0x10000094 <_init>,
    app_fini=0x101104ec <_fini>, rtld_fini=0, stack_end=0x7ffffe60) at libc/misc/internals/__uClibc_main.c:318
        aux_dat = (long unsigned int *) 0x7fffff2c
        auxvt = {{a_type = 0, a_un = {a_val = 0}}, {a_type = 0, a_un = {a_val = 0}}, {a_type = 0, a_un = {
      a_val = 0}}, {a_type = 3, a_un = {a_val = 268435508}}, {a_type = 4, a_un = {a_val = 32}}, {a_type = 5,
    a_un = {a_val = 3}}, {a_type = 6, a_un = {a_val = 4096}}, {a_type = 7, a_un = {a_val = 0}}, {a_type = 8,
    a_un = {a_val = 0}}, {a_type = 9, a_un = {a_val = 268435640}}, {a_type = 0, a_un = {a_val = 0}}, {
    a_type = 11, a_un = {a_val = 0}}, {a_type = 12, a_un = {a_val = 0}}, {a_type = 13, a_un = {a_val = 0}}, {
    a_type = 14, a_un = {a_val = 0}}}
0000005 0x00000000 in ?? ()
No symbol table info available.
(gdb)
 
(0014634)
bernhardf
10-30-08 05:33

so which locale did you set?
 
(0014644)
rhabarber1848
10-30-08 06:36

The data from note 0014624 came from a quick test using only the static binary
in a glibc environment without setting any env variables nor copying any locale
data or uClibc libs to the glibc environment. If this is necessary please forget
this note. Are there any other things I can try to debug in regard to the boot problem? Maybe using a more up-to-date version of Busybox?
 
(0014654)
bernhardf
10-30-08 07:10

Of course you should copy the needed locale data (i admit that it would be nicer to bail out earlier if no data was found), but _that_ is mere a configuration issue. Please do and let me know how that does now (no need for DL_DEBUG or MALLOC_DEBUG anymore).
 
(0014664)
bernhardf
10-30-08 07:16

oh, and using the current stable busybox is always a good idea. At the time of this writing this would be busybox-1.12.1
 
(0014674)
rhabarber1848
10-30-08 12:52

Tried busybox-1.12.1 and dash-0.5.4, both linked dynamic and static, no success.
uClibc 0.9.29 works for me, should I try to find out which SVN commit is
responsible for the segfaults? Or do you have any other idea what I can try
to debug this problem?
 
(0014724)
rhabarber1848
10-31-08 01:43

Tried again with uClibc-0.9.30-rc3, gcc-3.4.6 - this time without formentioned gcc-uclibc-locale.diff - and deactived XLOCALE support. Basically this is the same compiler sourcecode which works well with uClibc 0.9.28.3. Gcc compiled without problems but busybox-1.12.1 shows the same hang when booting:

Freeing unused kernel memory: 72k init
ELF0x30000000
ELF0x3001d370
ELELELFDone relocating ldso; we can now use globals and make function calls!
_dl_get_ready_to_run:172: Cool, ldso survived making function calls
_dl_malloc:920: mmapping more memory
_dl_get_ready_to_run:354: Lib Loader: (0x30000000) /lib/ld-uClibc.so.0
_dl_get_ready_to_run:292: calling mprotect on the application program
_dl_get_ready_to_run:620: Loading: (0x3001e000) /lib/libcrypt.so.0
_dl_get_ready_to_run:620: Loading: (0x30043000) /lib/libm.so.0
_dl_get_ready_to_run:620: Loading: (0x30077000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30077000) /lib/libc.so.0
_dl_get_ready_to_run:620: Loading: (0x30077000) /lib/libc.so.0
_dl_get_ready_to_run:747: Beginning relocation fixups

So the problem seems to have nothing to do with my backported gcc-3.4.6 patches.
 
(0015004)
rhabarber1848
11-03-08 12:27

After compiling dozens of uClibc SVN revision I made some progress:

SVN rev 23625 is the latest revision which does not have this bug and boots.

SVN rev 23626 and later ones (tested 23681, -rc3 & yesterdays 23901) have this bug.
For convinience here is the commit log of rev 23626:
http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=23626&view=rev [^]

Both 23625 and 23626 were compiled with the patch from rev 23901
to circumvent bug 0005254, which I also came across during my compile tests.

Rev 23625 was also compiled with this patch removed
http://www.uclibc.org/cgi-bin/viewcvs.cgi?view=rev&rev=23534 [^]
in order to circumvent a compile bug:
http://www.uclibc.org/lists/uclibc/2008-October/020261.html [^]

Rev 23626 should fixed this compile bug but apparently introduced a new bug.
 
(0015014)
rhabarber1848
11-03-08 13:40

uClibc rev 23919 is able to boot into Busybox 1.12.1 if these patches are removed:

SVN rev 23534
SVN rev 23626
SVN rev 23628
SVN rev 23631
SVN rev 23677

Attached as uclibc-locale.diff you will find the patch I used to compile the
current SVN rev 23919. I left the options in uclibc-0.9.30-rc3.config untouched.
 
(0015214)
bernhardf
11-07-08 10:56

can you please provide a diff of the _generated_files_ between pristine trunk and one with those patches reverted? TIA,
 
(0015224)
rhabarber1848
11-07-08 13:39

I used uClibc SVN rev 23960, copied it into two dirs.
Compiled one dir "make all",
patched the second dir with uclibc-locale.diff,
compiled, reversed the patch afterwards and
created a diff between both dirs.

The diff is attached here as uclibc_compile.diff.bz2
 
(0015234)
bernhardf
11-07-08 14:01

I assume the uClibc.23960 is the unpatched one. In the patched one, where is your codesets.txt ?

please show me full logs for both
$ (make -C extra/locale V=2) 2>&1 >& unpatched.log
and the same for the patched one.

dont't forget to
$ make -C extra/locale clean
in both trees before rebuilding.
 
(0015244)
bernhardf
11-07-08 15:05

For me all of a gcc-3.4 for i386 as well as
$ /there/src/buildroot.git.ppc/powerpc_nofpu_build/staging/usr/bin/powerpc-linux-uclibc-gcc --version
powerpc-linux-uclibc-gcc (GCC) 4.4.0 20081105 (experimental) [trunk revision 141607]

produce bit-identical output of the generated files for trunk compared to your bug revert patch, fwiw.
I attach my config.bernhard for your reference.
 
(0015314)
rhabarber1848
11-09-08 12:35

I found out that rev 23524 and current SVN revs, the latter ones patched with uclibc-locale.diff, did not compile anything in extra/locale, therefore circumventing the segfault. That is also the reason why codesets.txt was missing.
This code produces working binaries, weird.

I even used your .config (most important difference is you have XLOCALE disabled) along with todays SVN snapshot, they segfault...

Anything else I could try to debug? I am under the impression that the linked-in locale stuff at all is responsible for my problems. How is this possible?
 
(0015324)
bernhardf
11-10-08 02:43

XLOCALE is highly experimental, don't turn it on unless you want to help writing the required code.
Does using pregenerated locales (as in download pregen. locales) work or not?
I do not use the pregenerated locales, as you can see from my config.
 
(0015374)
rhabarber1848
11-10-08 09:07

Deactivating UCLIBC_PREGENERATED_LOCALE_DATA solved this bug!
Believe it or not, it did, tested with SVN rev 23974.

I never tried that before because I thought this is totally unrelated.

Anything I can do to improve the precompiled locales, if needed?
Not using them was unproblematic, although I expected problems
because of the associated helptext ("... or you enjoy pain ...")
for this function.
 
(0015384)
bernhardf
11-10-08 09:15

Wow, what a pain. I will see what i can do to eventually update the pregenerated data. Leaving this report open as a reminder.
Thanks for your tremendous patience on this one!
 

- Issue History
Date Modified Username Field Change
10-23-08 06:48 rhabarber1848 New Issue
10-23-08 06:48 rhabarber1848 Status new => assigned
10-23-08 06:48 rhabarber1848 Assigned To  => uClibc
10-23-08 06:50 rhabarber1848 File Added: .config
10-23-08 06:50 rhabarber1848 Note Added: 0014044
10-23-08 06:50 rhabarber1848 Issue Monitored: rhabarber1848
10-23-08 06:54 rhabarber1848 File Added: gcc-uclibc-locale.diff
10-23-08 06:54 rhabarber1848 Note Added: 0014054
10-23-08 06:57 rhabarber1848 Note Added: 0014064
10-23-08 06:58 rhabarber1848 File Added: kernel_dot_config
10-23-08 06:59 rhabarber1848 Note Added: 0014074
10-23-08 14:57 rhabarber1848 Note Added: 0014094
10-25-08 01:28 bernhardf Note Added: 0014144
10-25-08 05:28 rhabarber1848 Note Added: 0014164
10-25-08 11:14 bernhardf Note Added: 0014174
10-26-08 04:22 rhabarber1848 Note Added: 0014224
10-26-08 04:29 rhabarber1848 Note Added: 0014234
10-26-08 04:30 rhabarber1848 Note Added: 0014244
10-27-08 09:50 bernhardf Note Added: 0014384
10-27-08 12:55 rhabarber1848 Note Added: 0014394
10-27-08 13:38 bernhardf Note Added: 0014404
10-28-08 11:37 bernhardf Note Added: 0014494
10-28-08 11:37 bernhardf Status assigned => feedback
10-30-08 04:06 rhabarber1848 Note Added: 0014604
10-30-08 04:06 rhabarber1848 File Added: uclibc-0.9.30-rc3.config
10-30-08 04:10 rhabarber1848 Note Added: 0014614
10-30-08 04:48 rhabarber1848 Note Added: 0014624
10-30-08 05:33 bernhardf Note Added: 0014634
10-30-08 06:36 rhabarber1848 Note Added: 0014644
10-30-08 07:10 bernhardf Note Added: 0014654
10-30-08 07:16 bernhardf Note Added: 0014664
10-30-08 12:52 rhabarber1848 Note Added: 0014674
10-31-08 01:43 rhabarber1848 Note Added: 0014724
11-03-08 12:27 rhabarber1848 Note Added: 0015004
11-03-08 13:40 rhabarber1848 Note Added: 0015014
11-03-08 13:40 rhabarber1848 File Added: uclibc-locale.diff
11-07-08 10:56 bernhardf Note Added: 0015214
11-07-08 13:39 rhabarber1848 Note Added: 0015224
11-07-08 13:39 rhabarber1848 File Added: uclibc_compile.diff.bz2
11-07-08 14:01 bernhardf Note Added: 0015234
11-07-08 15:05 bernhardf Note Added: 0015244
11-07-08 15:06 bernhardf File Added: config.bernhard
11-09-08 12:35 rhabarber1848 Note Added: 0015314
11-10-08 02:43 bernhardf Note Added: 0015324
11-10-08 09:07 rhabarber1848 Note Added: 0015374
11-10-08 09:15 bernhardf Note Added: 0015384
11-10-08 09:18 bernhardf Status feedback => acknowledged
11-10-08 09:18 bernhardf Summary uClibc-0.9.30-rc2 apps always segfault => uClibc-0.9.30-rc2 apps always segfault due to using the downloaded pregenerated locale data


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker