Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2000 20:56:08 -0600 (CST)
From:      Steven Farmer <steve@megahack.com>
To:        freebsd-stable@freebsd.org
Subject:   savecore snafu, dirname vs dirname()
Message-ID:  <14863.22600.507386.659982@catbert.megahack.com>

next in thread | raw e-mail | index | archive | help
Here's wierd one.  It seems to be a mixup between "char *dirname" in
savecore.c and dirname() in libc...

After today's cvsup/build/install, savecore dies during the reboot:

      pid 133 (savecore), uid 0: exited on signal 10 (core dumped)

When I build savecore after adding -g to CFLAGS in /etc/make.conf, I
see the following.  Note the ld warnings:


% uname -r4.2-BETA
4.2-BETA
% pwd
/usr/src/sbin/savecore
% su
Password:
catbert# make clean
rm -f savecore savecore.o zopen.o savecore.8.gz savecore.8.cat.gz
catbert# make
cc -g -pipe -I/usr/src/sbin/savecore/../../usr.bin/compress   -c /usr/src/sbin/savecore/savecore.c
cc -g -pipe -I/usr/src/sbin/savecore/../../usr.bin/compress   -c /usr/src/sbin/savecore/../../usr.bin/compress/zopen.c
cc -g -pipe -I/usr/src/sbin/savecore/../../usr.bin/compress    -static -o savecore savecore.o zopen.o  
/usr/libexec/elf/ld: Warning: size of symbol `dirname' changed from 4 to 206 in dirname.o
/usr/libexec/elf/ld: Warning: type of symbol `dirname' changed from 1 to 2 in dirname.o
gzip -cn /usr/src/sbin/savecore/savecore.8 > savecore.8.gz

catbert# cd /usr/obj/usr/src/sbin/savecore
catbert# ./savecore /var/crash
Bus error (core dumped)
catbert# gdb ./savecore ./savecore.core
GNU gdb 4.18
Copyright 1998 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 "i386-unknown-freebsd"...
Core was generated by `savecore'.
Program terminated with signal 10, Bus error.
#0  0x8048298 in main (argc=1, argv=0xbfbff794)
    at /usr/src/sbin/savecore/savecore.c:178
178                     dirname = argv[0];
(gdb) 

catbert# nm ./savecore | grep dirname
0804b9b4 T dirname

If there's any more information I can provide, I'll do my best.

Cheers,

Steve


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14863.22600.507386.659982>