[opensuse-amd64] After recompiling util-linux, "which" segfaults

Hi, we are running SuSE 10.1/x86_64 and SLES 10/x86_64 (same issue). We need a patched version of util-linux so I first tried to recompile the util-linux.src.rpm by simply rpm -ihv .../suse/src/util-linux-2.12r-35.src.rpm rpmbuild -ba SPECS/util-linux.spec This runs through and creates a new RPM. After installing it, /usr/bin/which segfaults when called with a parameter: backus /root/rpm# /usr/bin/which Usage: /usr/bin/which [options] [--] programname [...] Options: --version, -[vV] Print version and exit successfully. --help, Print this help and exit successfully. ... backus /root/rpm# /usr/bin/which nxloadconfig Segmentation fault strace shows this: backus /root/rpm# strace -f /usr/bin/which nxloadconfig execve("/usr/bin/which", ["/usr/bin/which", "nxloadconfig"], [/* 85 vars */]) = 0 brk(0) = 0x505000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af979b07000 uname({sys="Linux", node="backus", ...}) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=306211, ...}) = 0 mmap(NULL, 306211, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2af979b08000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\322\1\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1475924, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af979b53000 mmap(NULL, 2289896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2af979c09000 madvise(0x2af979c09000, 2289896, MADV_SEQUENTIAL|0x1) = 0 mprotect(0x2af979d2f000, 1048576, PROT_NONE) = 0 mmap(0x2af979e2f000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x126000) = 0x2af979e2f000 mmap(0x2af979e34000, 16616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2af979e34000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af979e39000 arch_prctl(ARCH_SET_FS, 0x2af979e396d0) = 0 mprotect(0x2af979e2f000, 12288, PROT_READ) = 0 munmap(0x2af979b08000, 306211) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 7351 detached What's wrong here? I didn't change the spec file, so how can the recompiled package behave differently? cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org

Ok, I got that. In which-2.13/Makefile there is a line LIBS = /usr/lib/libiberty.a Compiling "which" alone says indeed gcc -g -O2 -o which getopt.o getopt1.o bash.o which.o ./tilde/libtilde.a /usr/lib/libiberty.a /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../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 When changing this into LIBS = /usr/lib64/libiberty.a the compiled "which" works fine. What's the best way to have that fixed for the next release of util-linux (if any) for 10.1? Report it to bugzilla? cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org

* Frank Steiner (fsteiner-mail1@bio.ifi.lmu.de) [20070531 12:34]:
Ok, I got that. In which-2.13/Makefile there is a line
LIBS = /usr/lib/libiberty.a
It's really the definition of AC_CHECK_STATICLIB in acinclude.m4 that's at fault, as it only checks /lib and /usr/lib for static libraries. At the end of this mail is a patch that should fix it and that I'll put into util-linux for the next release of openSUSE.
What's the best way to have that fixed for the next release of util-linux (if any) for 10.1? Report it to bugzilla?
Yes, do report it to bugzilla, though it will most probably not be fixed for 10.1/SLES10. Philipp -- Anything whose specification is too complicated to explain easily probably needs to be redesigned. David Abrahams on boost --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org

* Philipp Thomas (pth@suse.de) [20070604 17:38]:
At the end of this mail is a patch that should fix it
And then forgot to include it ... Here it is: --- acinclude.m4 +++ acinclude.m4 @@ -10,10 +10,13 @@ dnl may have different results. ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` AC_CACHE_VAL(ac_cv_lib_static_$ac_lib_var, +if test ! -z `grep 64 $libdir`; then + libsuffix=64 +fi if test -r /etc/ld.so.conf ; then - ld_so_paths="/lib /usr/lib `cat /etc/ld.so.conf`" + ld_so_paths="/lib${libsuffix} /usr/lib${libsuffix} `cat /etc/ld.so.conf`" else - ld_so_paths="/lib /usr/lib" + ld_so_paths="/lib${libsuffix} /usr/lib${libsuffix}" fi for path in $ld_so_paths; do [ac_save_LIBS="$LIBS" --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org

Philipp Thomas wrote
* Philipp Thomas (pth@suse.de) [20070604 17:38]:
At the end of this mail is a patch that should fix it
Hmm, it doesn't work here, because in which-2.13/configure there is still if eval "test \"`echo '$''{'ac_cv_lib_static_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -r /etc/ld.so.conf ; then ld_so_paths="/lib /usr/lib `cat /etc/ld.so.conf`" else ld_so_paths="/lib /usr/lib" fi and that seems to be unaffected by the patch in ainclude.m4. I couldn't adapt your patch here because the variables are different and I'm not sure where to check for the "64". cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org

Philipp Thomas wrote
Yes, do report it to bugzilla,
I submitted that for 10.1.
though it will most probably not be fixed for 10.1/SLES10.
No problem, I can add your patch if I'm recompiling anyway :-) Thanks! cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org
participants (2)
-
Frank Steiner
-
Philipp Thomas