Segmentation fault with "which"
Hello, I have just upgraded my AMD 64 XP system to Suse 9.2 and I have the following problem: The program "/usr/bin/which" produces a Segmentation fault. I tried to rebuild the util-linux package from the sources, During the build of "which", the following messages are generated: make[2]: Entering directory `/usr/src/packages/BUILD/which-2.13' gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c getopt.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c getopt1.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c bash.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c which.c gcc -O2 -g -o which getopt.o getopt1.o bash.o which.o ./tilde/libtilde.a /usr/lib/libiberty.a /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: warning: i386 architecture of input file `/usr/lib/libiberty.a(xmalloc.o)' is incompatible with i386:x86-64 output /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: warning: i386 architecture of input file `/usr/lib/libiberty.a(xexit.o)' is incompatible with i386:x86-64 output make[2]: Leaving directory `/usr/src/packages/BUILD/which-2.13' I suspect that these warnings about libiberty are the source of the problem, but I am not sure about how to fix that. Best regards, Marc Wuilleret.
Marc Wuilleret <mwuilleret@vtxnet.ch> writes:
Hello,
I have just upgraded my AMD 64 XP system to Suse 9.2 and I have the following problem:
The program "/usr/bin/which" produces a Segmentation fault.
Show us an example, please.
I tried to rebuild the util-linux package from the sources, During the build of "which", the following messages are generated:
make[2]: Entering directory `/usr/src/packages/BUILD/which-2.13' gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c getopt.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c getopt1.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c bash.c gcc -DHAVE_CONFIG_H -I. -I. -I. -O2 -g -c which.c gcc -O2 -g -o which getopt.o getopt1.o bash.o which.o ./tilde/libtilde.a /usr/lib/libiberty.a
You should link against /usr/lib64/libiberty.a
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: warning: i386 architecture of input file `/usr/lib/libiberty.a(xmalloc.o)' is incompatible with i386:x86-64 output /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: warning: i386 architecture of input file `/usr/lib/libiberty.a(xexit.o)' is incompatible with i386:x86-64 output make[2]: Leaving directory `/usr/src/packages/BUILD/which-2.13'
I suspect that these warnings about libiberty are the source of the problem, but I am not sure about how to fix that.
No those produce no binary at all, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Andreas Jaeger wrote:
Marc Wuilleret <mwuilleret@vtxnet.ch> writes:
Hello,
I have just upgraded my AMD 64 XP system to Suse 9.2 and I have the following problem:
The program "/usr/bin/which" produces a Segmentation fault.
Show us an example, please.
I have just solved the problem. For some unknown reasons, during the upgrade from 9.1 to 9.2, the package util-linux of 9.1 was not replaced by the package from 9.2. I manually erased the old package (revision util-linux-2.12-72.15) and replaced it by the new one from 9.2 (revision util-linux-2.12c-4) and now everything works fine. Sorry for the confusion. Marc Wuilleret.
Hi Marc, * Marc Wuilleret (mwuilleret@vtxnet.ch) [20050119 02:02]:
The program "/usr/bin/which" produces a Segmentation fault.
You should rather see why and where which segfaults.
gcc -O2 -g -o which getopt.o getopt1.o bash.o which.o ./tilde/libtilde.a /usr/lib/libiberty.a
I suspect that these warnings about libiberty are the source of the problem, but I am not sure about how to fix that.
I doubt that that's the reason for the segfaults. /usr/bin/which from the util-linux-*.x86_64.rpm is linked to the correct libraries. On your system you have /usr/lib/libiberty.a, coming from the installation of binutils-32bit.rpm. Try the following patch for configure, rerun configure and then rebuild. BTW, before anybody asks why I don't patch configure.in, have a look at acinclude.m4 of which-2.13. If you can tell me how to rewrite AC_CHECK_STATICLIB so that current autoconf groks it, I'll redo the patch. Philipp --- configure 2005/01/19 14:55:08 1.1 +++ configure 2005/01/19 14:56:34 @@ -1117,9 +1117,9 @@ echo $ac_n "(cached) $ac_c" 1>&6 else if test -r /etc/ld.so.conf ; then - ld_so_paths="/lib /usr/lib at /etc/ld.so.conf" + ld_so_paths="/lib64 /usr/lib64 /lib /usr/lib at /etc/ld.so.conf" else - ld_so_paths="/lib /usr/lib" + ld_so_paths="/lib64 /usr/lib64 /lib /usr/lib" fi for path in $ld_so_paths; do ac_save_LIBS="$LIBS" -- Philipp Thomas <pth@suse.de> Research & Development SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuremberg, Germany
participants (3)
-
Andreas Jaeger
-
Marc Wuilleret
-
Philipp Thomas