[uClibc] Strange segmentation fault with uClibc on FC1

Andreas 'ads' Scherbaum adsmail at wars-nicht.de
Sun Oct 31 09:52:54 UTC 2004


Hello,

i run into a strange (and reproducible) segfault on a Fedora Core 1
machine:

I tried to compile the cflinux distribution (a small system for flash
cards). Its first compiling and installing uClibc, then it tries to
compile busybox and breaks:

gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep
scripts/mkdep.c
./scripts/mkdep -I include -- \
`find -name \*.c -print | sed -e "s,^./,,"` >> .depend;

First it is compiling a helper tool (using uClibc), then he tries to
execute it and it fails with a SIGSEGV.


This problem appears with more tools compiled from this package, here is
a backtrace:

This GDB was configured as "i386-redhat-linux-gnu"...(no debugging
symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".

Core was generated by `./scripts/config/conf -o sysdeps/linux/Config.in'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from
/home/ads/cflinux-tmp/i386-linux-uclibc//lib/libc.so.0...done.
Loaded symbols for
/home/ads/cflinux-tmp/i386-linux-uclibc//lib/libc.so.0
Reading symbols from
/home/ads/cflinux-tmp/build/tmp-uClibc/lib/ld-uClibc.so.0...done.
Loaded symbols for
/home/ads/cflinux-tmp/build/tmp-uClibc/lib/ld-uClibc.so.0
#0  0xbf5636cb in malloc (bytes=40) at malloc.c:1185
1185            remainder->size = remainder_size;
(gdb) bt
#0  0xbf5636cb in malloc (bytes=40) at malloc.c:1185
#1  0x0804fb5d in prop_alloc ()
#2  0x00000028 in ?? ()


Any time he tries so set remainder->size, this fails.
I tested a little bit around, in this example he tries to allocate 4096
bytes. If i lower the value to less then around 450 bytes, it works well
(but of course crashes later, because the application expects more
memory ;-). Anything more then 460-470 bytes: SIGSEGV.


Has anyone an idea, what's going on here?

This only occurs on a FC1 (and FC2, someone told me). A Debian Woody or
Sarge as example works fine.


kindly regards

-- 
				Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)



More information about the uClibc mailing list