[uClibc]Dynamic loader bug?

Lionel Fourquaux lionel.fourquaux at wanadoo.fr
Thu Dec 26 23:18:08 UTC 2002


Hello!


I've tried to use uClibc, and it looks like I've hit some kind of bug in the
dynamic loader.

Here are the symptoms: nearly all dynamically linked programs (e.g. GNU
fileutils, pdksh) receive a SIGSEGV when they exit. Statically linked
programs, and those who call very few functions in the libc (e.g. ash) are
not affected.

This is on linux, kernel 2.4.19, both with a real kernel and a user-mode
linux.

It happens both with version 0.9.16 of uClibc and with the snapshot dated
from 2002/12/26.

It happens both when I compile these programs on a linux machine (with gcc
3.2) and when I use a cross compiler (sparc-solaris to i686-linux, gcc
3.2.1).

Here is a stack backtrace for pdksh, with the snapshot version of uClibc.

#0  0x40039dde in optopt () from /lib/libc.so.0
#1  0xbffff7f0 in ?? ()
#2  0x4002ecf0 in __exit_handler () from /lib/libc.so.0
#3  0x4002ed28 in exit () from /lib/libc.so.0
#4  0x0805f1b6 in main ()
#5  0x0805f052 in main ()
#6  0x0805ef4c in main ()
#7  0x0805eb2a in main ()
#8  0x40015559 in __uClibc_start_main () from /lib/libc.so.0
#9  0x080496e4 in sigprocmask ()

Some lines from the debug output of the dynamic loader:

Beginning relocation fixups
relocation processing: /lib/ld-uClibc.so.0
relocation processing: /lib/ld-uClibc.so.0; finished
relocation processing: /lib/libc.so.0
relocation processing: /lib/libc.so.0; finished
relocation processing:
relocation processing: ; finished
relocation copy fixups: /lib/libc.so.0
relocation copy fixups: /lib/libc.so.0; finished
relocation copy fixups:
relocation copy fixups: ; finished

Here are the last lines:

resolve function: read  patch 0x80493d6 ==> 0x40031aa0 @ 0x8071dd4
resolve function: memchr        patch 0x8049376 ==> 0x40027974 @ 0x8071dbc
resolve function: memcpy        patch 0x80491d6 ==> 0x400279b8 @ 0x8071d54
resolve function: memchr        patch 0x8049376 ==> 0x40027974 @ 0x8071dbc
resolve function: memset        patch 0x80494a6 ==> 0x40027a5c @ 0x8071e08
resolve function: malloc        patch 0x8049236 ==> 0x400305c4 @ 0x8071d6c
resolve function: strchr        patch 0x8049626 ==> 0x40027bdc @ 0x8071e68
resolve function: strcmp        patch 0x8049536 ==> 0x40027bf8 @ 0x8071e2c
resolve function: free  patch 0x80496a6 ==> 0x4003097f @ 0x8071e88
resolve function: _longjmp      patch 0x8049176 ==> 0x4003141c @ 0x8071d3c
resolve function: free  patch 0x80496a6 ==> 0x4003097f @ 0x8071e88
resolve function: free  patch 0x80496a6 ==> 0x4003097f @ 0x8071e88
resolve function: free  patch 0x80496a6 ==> 0x4003097f @ 0x8071e88
resolve function: free  patch 0x80496a6 ==> 0x4003097f @ 0x8071e88
resolve function: sigprocmask   patch 0x80496b6 ==> 0x40033d94 @ 0x8071e8c
resolve function: sigprocmask   patch 0x80496b6 ==> 0x40033d94 @ 0x8071e8c
resolve function: exit  patch 0x80495b6 ==> 0x4002ecf8 @ 0x8071e4cMemory
fault

Here are the configuration parameters I used:

#
# Automatically generated make config: don't edit
#

#
# Target Architecture Features and Options
#
HAVE_ELF=y
# CONFIG_386 is not set
# CONFIG_486 is not set
# CONFIG_586 is not set
# CONFIG_586MMX is not set
CONFIG_686=y
# CONFIG_PENTIUMIII is not set
# CONFIG_PENTIUM4 is not set
# CONFIG_K6 is not set
# CONFIG_K7 is not set
# CONFIG_CRUSOE is not set
# CONFIG_WINCHIPC6 is not set
# CONFIG_WINCHIP2 is not set
# CONFIG_CYRIXIII is not set
UCLIBC_HAS_MMU=y
UCLIBC_HAS_FLOATS=y
HAS_FPU=y
DO_C99_MATH=y
WARNINGS="-Wall"
KERNEL_SOURCE="/users/98/maths/fourquau/tmp/bootdisk/build/linux-2.4.19"
C_SYMBOL_PREFIX=""
HAVE_DOT_CONFIG=y

#
# General Library Settings
#
DOPIC=y
HAVE_SHARED=y
BUILD_UCLIBC_LDSO=y
LDSO_LDD_SUPPORT=y
UCLIBC_CTOR_DTOR=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_LFS=y
# MALLOC is not set
MALLOC_930716=y
UCLIBC_DYNAMIC_ATEXIT=y
HAS_SHADOW=y
UCLIBC_HAS_REGEX=y
UNIX98PTY_ONLY=y
ASSUME_DEVPTS=y

#
# Networking Support
#
# UCLIBC_HAS_IPV6 is not set
# UCLIBC_HAS_RPC is not set

#
# String and Stdio Support
#
UCLIBC_HAS_WCHAR=y
# UCLIBC_HAS_LOCALE is not set
# USE_OLD_VFPRINTF is not set

#
# Library Installation Options
#
SHARED_LIB_LOADER_PATH="/lib"
DEVEL_PREFIX="/users/98/maths/fourquau/tmp/bootdisk/tools/i686-linux-uclibc"
SYSTEM_DEVEL_PREFIX="/users/98/maths/fourquau/tmp/bootdisk/tools/uclibc"
DEVEL_TOOL_PREFIX="/users/98/maths/fourquau/tmp/bootdisk/tools/uclibc/usr"

#
# uClibc hacking options
#
# DODEBUG is not set
# DOASSERTS is not set
SUPPORT_LD_DEBUG=y
SUPPORT_LD_DEBUG_EARLY=y


If I made some known mistake, can you point it out to me? And if it really
is a bug, is there some additional information I can provide?

Thank in advance!

-- 
  Lionel Fourquaux





More information about the uClibc mailing list