Bug 211084
Summary: | Segmentation fault in main | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Dominic Scheirlinck <dominics> | ||||||
Component: | setuptool | Assignee: | Nalin Dahyabhai <nalin> | ||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | David Lawrence <dkl> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 4.0 | ||||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | i386 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2006-10-18 15:51:13 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Dominic Scheirlinck
2006-10-17 09:10:54 UTC
This looks like it happens if $sysconfdir/setuptool.d is empty or doesn't contain anything recognizable as a setuptool configuration file ($sysconfdir defaults to /etc in the binaries). Can you double-check that your system is not missing some or all of these files? (The particular bug should be fixed in 1.19, but I'm trying to figure out how you came across it.) Contents of /etc/setuptool.d/: -rw-r--r-- 1 root root 42 Mar 2 2005 98netconfig -rw-r--r-- 1 root root 47 Mar 2 2005 98system-config-display -rw-r--r-- 1 root root 62 Mar 2 2005 98system-config-keyboard -rw-r--r-- 1 root root 40 Mar 2 2005 99Xconfigurator -rw-r--r-- 1 root root 50 Mar 2 2005 99authconfig -rw-r--r-- 1 root root 43 Mar 2 2005 99kbdconfig -rw-r--r-- 1 root root 40 Mar 2 2005 99lokkit -rw-r--r-- 1 root root 42 Mar 2 2005 99mouseconfig -rw-r--r-- 1 root root 33 Mar 2 2005 99ntsysv -rw-r--r-- 1 root root 46 Mar 2 2005 99printconf-tui -rw-r--r-- 1 root root 45 Mar 2 2005 99sndconfig -rw-r--r-- 1 root root 58 Mar 2 2005 99system-config-network-tui -rw-r--r-- 1 root root 58 Mar 2 2005 99system-config-printer-tui -rw-r--r-- 1 root root 44 Mar 2 2005 99timeconfig They all seem to be there - contents seem to be pretty normal. Copying across the setuptool.d directory from the source RPM (with a chown to root) doesn't seem to help either. Keep in mind that 'configure' sets the default value of $sysconfdir to /usr/local/etc unless it's overridden (when invoked from 'rpmbuild -bc' , it's passed '--sysconfdir=/etc'), so I'm not certain that you're hitting the same problem in both cases. Ah, you're quite right. Invoking configure from rpmbuild -bc still gives a segfault, but it's happening in a different place: Program received signal SIGSEGV, Segmentation fault. 0x08049539 in main (argc=1, argv=0xbf8c1a14) at setup.c:98 98 if (strlen(p) == 0) { (gdb) print p $1 = 0xbf8c1140 "" Although this still looks like something to do with the configuration directory... Can you run 'cat /etc/setuptool.d/*' and add the result here? Either strtok() is behaving strangely, or one of the configuration files has bad data in it, and neither of those should be happening. (Though this is another bug that needs to be fixed for 1.19.) [root@milwaukeemicrobusiness setuptool.d]# cat /etc/setuptool.d/* /usr/sbin/netconfig|Network configuration /usr/bin/system-config-display|X configuration /usr/bin/system-config-keyboard --text|Keyboard configuration /usr/sbin/Xconfigurator|X configuration /usr/sbin/authconfig|Authentication configuration /usr/sbin/kbdconfig|Keyboard configuration /usr/sbin/lokkit|Firewall configuration /usr/sbin/mouseconfig|Mouse configuration /usr/sbin/ntsysv|System services /usr/sbin/printconf-tui|Printer configuration /usr/sbin/sndconfig|Sound card configuration /usr/sbin/system-config-network-tui|Network configuration /usr/sbin/system-config-printer-tui|Printer configuration /usr/sbin/timeconfig|Timezone configuration Okay, this doesn't make much sense to me -- those all look like correct configuration files, and in each case strtok() should be returning the first part of each line. Created attachment 138686 [details]
test update
Can you try rebuilding the attached source package? It should fix both of
the problems we've seen here.
Here's the build process: [root@milwaukeemicrobusiness redhat]# rpm -i /root/setuptool-1.17-3.src.rpm warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root [root@milwaukeemicrobusiness redhat]# rpmbuild -bc SPECS/setuptool.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.50028 + umask 022 + cd /usr/src/redhat/BUILD + cd /usr/src/redhat/BUILD + rm -rf setuptool-1.17 + /bin/gzip -dc /usr/src/redhat/SOURCES/setuptool-1.17.tar.gz + tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd setuptool-1.17 ++ /usr/bin/id -u + '[' 0 = 0 ']' + /bin/chown -Rhf root . ++ /usr/bin/id -u + '[' 0 = 0 ']' + /bin/chgrp -Rhf root . + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + echo 'Patch #0 (setuptool-backports.patch):' Patch #0 (setuptool-backports.patch): + patch -p0 -b --suffix .backports -s + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.50028 + umask 022 + cd /usr/src/redhat/BUILD + cd setuptool-1.17 + CFLAGS='-O2 -g -march=i386 -mcpu=i686' + export CFLAGS + CXXFLAGS='-O2 -g -march=i386 -mcpu=i686' + export CXXFLAGS + FFLAGS='-O2 -g -march=i386 -mcpu=i686' + export FFLAGS + ./configure --host=i686-redhat-linux-gnu --build=i686-redhat-linux-gnu --target=i386-redhat-linux --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for i686-redhat-linux-gnu-gcc... no checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking locale.h usability... yes checking locale.h presence... yes checking for locale.h... yes checking for LC_MESSAGES... yes checking libintl.h usability... yes checking libintl.h presence... yes checking for libintl.h... yes checking for dgettext in libc... yes checking for bind_textdomain_codeset... yes checking for msgfmt... /usr/bin/msgfmt checking for dcgettext... yes checking for gmsgfmt... /usr/bin/msgfmt checking for xgettext... /usr/bin/xgettext checking for catalogs to be installed... ar be bg bn bs ca cs cy da de el es et fi fr gu he hi hr hu id is it ja ka ko ku lo lt mk mn mr ms nb nl no pa pl pt pt_BR ru si sk sl sq sv ta tr uk ur vi zh_CN zh_TW checking for perl... /usr/bin/perl checking for XML::Parser... ok configure: creating ./config.status config.status: creating Makefile config.status: creating setuptool.d/Makefile config.status: creating po/Makefile.in config.status: creating config.h config.status: executing depfiles commands config.status: executing default-1 commands config.status: executing default-2 commands + make make all-recursive make[1]: Entering directory `/usr/src/redhat/BUILD/setuptool-1.17' Making all in po make[2]: Entering directory `/usr/src/redhat/BUILD/setuptool-1.17/po' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/src/redhat/BUILD/setuptool-1.17/po' Making all in setuptool.d make[2]: Entering directory `/usr/src/redhat/BUILD/setuptool-1.17/setuptool.d' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/src/redhat/BUILD/setuptool-1.17/setuptool.d' make[2]: Entering directory `/usr/src/redhat/BUILD/setuptool-1.17' if gcc -DHAVE_CONFIG_H -DGETTEXT_PACKAGE=\"setup\" -DSETUPTOOLDDIR=\"/etc/setuptool.d\" -I. -I. -I. -O2 -g -march=i386 -mcpu=i686 -MT setup.o -MD -MP -MF ".deps/setup.Tpo" -c -o setup.o setup.c; \ then mv -f ".deps/setup.Tpo" ".deps/setup.Po"; else rm -f ".deps/setup.Tpo"; exit 1; fi gcc -O2 -g -march=i386 -mcpu=i686 -o setup setup.o -lnewt make[2]: Leaving directory `/usr/src/redhat/BUILD/setuptool-1.17' make[1]: Leaving directory `/usr/src/redhat/BUILD/setuptool-1.17' + exit 0 --- And here's what happens next: [root@milwaukeemicrobusiness redhat]# BUILD/setuptool-1.17/setup ERROR - No tool descriptions found in /etc/setuptool.d. --- But: [root@milwaukeemicrobusiness redhat]# ls /etc/setuptool.d/ 98netconfig 99kbdconfig 99sndconfig 98system-config-display 99lokkit 99system-config-network-tui 98system-config-keyboard 99mouseconfig 99system-config-printer-tui 99Xconfigurator 99ntsysv 99timeconfig 99authconfig 99printconf-tui [root@milwaukeemicrobusiness redhat]# diff /etc/setuptool.d/ BUILD/setuptool-1.17/setuptool.d Only in BUILD/setuptool-1.17/setuptool.d: Makefile Only in BUILD/setuptool-1.17/setuptool.d: Makefile.am Only in BUILD/setuptool-1.17/setuptool.d: Makefile.in This gets weirder and weirder. Can you run "strace -s256 -o /tmp/setup.log setup" and attach the generated log? I'm wondering if the tool is running into some permissions problem, and the log should turn up some clues. Created attachment 138790 [details]
strace log
It looks like it's still using /usr/local/etc/ as the sysconfdir (this binary
was created with rpmbuild -bc). To double check, I did a manual build with
'./configure --sysconfdir=/etc' - same result.
Actually, /usr/local/etc/ does exist, and seems to work fine. Turns out the segmentation fault occurs because none of the tools are available under /usr/sbin/ - installing any one of them, like, say, authconfig - stops the segfault. Okay, so the tool builds the list of options to present in thelistbox, and if it found nothing, it would crash. The additional check for not having any valid options to present is now causing the error message to be produced instead, so I think we're okay there. But this /usr/local/etc thing, that's still unexplained. The code as written scans SETUPTOOLDDIR, which I can see from your build log is getting the right value. Unless the strace log was generated using a different binary, I'm not really sure how it could have ended up scanning the wrong directory. Yep, that's exactly what happened in that strace. I did 'strace -s256 -o /tmp/setup.log setup' not 'strace -s256 -o /tmp/setup.log ./setup' The correct log is working fine: open("/etc/setuptool.d/99system-config-printer-tui", O_RDONLY) = 4 So, I think that's everything. Excellent! I don't think this is a bug you'd run into normally, because authconfig is a required part of the base package set. Given that, I'm just going to mark this as fixed in the next release. |