Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91588 - diffutils configure hangs on 'checking for working C stack overflow detection...'
Summary: diffutils configure hangs on 'checking for working C stack overflow detection...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-05 09:58 UTC by jrkacmar
Modified: 2011-01-14 16:28 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
first and last (before hard reboot) relevant log entries showing mem/swap usage (diffutils.log,3.44 KB, text/plain)
2005-05-05 10:01 UTC, jrkacmar
Details
c-stack-overflow.c (c-stack-overflow.c,2.01 KB, text/plain)
2005-05-07 02:53 UTC, SpanKY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jrkacmar 2005-05-05 09:58:59 UTC
this configure step seems to be allocating large amounts of swap space -- the system then becomes unresponsive and the configure step never completes.  I don't have phyical access to this particular machine; my ssh connection was reset and all future connection attempts timed out. So, for all intents and purposes, the machine is locked up until someone with physical access can do a hard reboot.

I found references to a similar problem configuring coreutils:
http://sources.redhat.com/ml/bug-gnu-utils/2003-02/msg00091.html

Reproducible: Always
Steps to Reproduce:
1. emerge -u diffutils
2.
3.

Actual Results:  
machine becomes unresponsive and the SSH connection is reset.  All future SSH
connection attempts fail.

Expected Results:  
the configure step should have succeeded or failed gracefully.

This machine is using hardened sources with grsecurity -> security level = high

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.10-hardened i686)
=================================================================
System uname: 2.6.10-hardened i686 Intel(R) Celeron(R) CPU 1.70GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 18 2005, 21:26:24)]
dev-lang/python:     2.3.4-r1
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer"
CHOST="i386-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/
ftp://gentoo.chem.wisc.edu/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 alsa apache2 apm berkdb crypt curl emboss fortran gd gdbm gif imap
imlib ipv6 jpeg libg++ libwww maildir mp3 mpeg mysql ncurses nls pam pdflib perl
php png python readline spell ssl tcpd tiff truetype truetype-fonts type1-fonts
xml2 zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 jrkacmar 2005-05-05 10:01:04 UTC
Created attachment 58146 [details]
first and last (before hard reboot) relevant log entries showing mem/swap usage
Comment 2 SpanKY gentoo-dev 2005-05-07 02:53:36 UTC
Created attachment 58262 [details]
c-stack-overflow.c

try to compile and run this code
Comment 3 jrkacmar 2005-05-07 17:15:13 UTC
running it produces the same symptoms/results.  -- you'll forgive me if I don't run any more code samples though; while the machine isn't mission-critical, it is in production ;)   That's why I was surprised when my local test machine had no issues with the update and the production machine choked.
Comment 4 SpanKY gentoo-dev 2005-05-07 17:59:19 UTC
then it's prob a kernel issue ...
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2005-07-08 12:30:25 UTC
Hardened may be the issue - there's not much we can do to solve this without you
a) Trying newer kernel versions and b) Trying without hardened. If you can do
this for us, please reopen the bug. Thanks!
Comment 6 Siarhei Siamashka 2010-04-08 09:14:23 UTC
Looks like it's a bug in the test, which gets optimized to an endless loop, gcc bugzilla has some details: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42375

Just got hit by it, trying to use gcc 4.5.0 with gentoo.
Comment 7 David Carlos Manuelda 2010-05-21 18:21:40 UTC
In last comment, they say it's only reproducible on non x86 machines (I had it on a x86 machine, and diffutils compiled good (it passed the stack overflow detection), but when I switched to amd64, it can no longer pass this test.
Comment 8 David Carlos Manuelda 2010-05-21 18:24:49 UTC
By the way (and sorry for double posting):
It is NOT related to kernel nor hardened profile.
I can reproduce with all in-tree kernels (I tested several, included 2.6.34), on an amd64 machine WITHOUT hardened profile (nor SELinux nor anything other than a "normal" amd64 user would use :)
Comment 9 Siarhei Siamashka 2010-05-21 18:31:45 UTC
David, as can be read in gcc bugzilla, it's a diffutils bug. It has been already fixed in newer releases of diffutils, so just stabilizing a newer diffutils version is needed.
Comment 10 David Carlos Manuelda 2010-05-22 18:04:23 UTC
Yes, it is, but it is also a bug in gcc because every code generated from c source code should behave the same way arch independant, and this bug is not reproducible in x86 arch
Comment 11 Siarhei Siamashka 2010-05-22 18:35:55 UTC
> it is also a bug in gcc because every code generated from c source code should behave the same way arch independant

The point is that *correct* code should behave the same on different architectures. There are no guarantees for buggy code whatsoever. And the stack overflow configure check in the current gentoo stable version of diffutils (2.8.7-r2) is buggy. If you don't agree, please go and complain in gcc bugzilla.

Regarding this issue. Can somebody, who has enough permissions, reopen it so that it could be added as a dependency to GCC 4.5 porting tracker bug 296658?
Comment 12 nE0sIghT 2010-08-21 07:13:31 UTC
Same issue with gcc 4.5.1 on amd64

emerge --info

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.5.1, glibc-2.11.2-r0, 2.6.35-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.35-gentoo-r1-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_5200+-with-gentoo-2.0.1
Timestamp of tree: Wed, 18 Aug 2010 15:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.7.9-r2, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1, 4.5.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -ftree-vectorize -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -ftree-vectorize -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution"
DISTDIR="/mnt/d/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.san.ru/unix/linux/gentoo/gentoo-distfiles http://mirrors.sgu.ru/gentoo/distfiles http://oss.mexmat.sgu.ru/soft/unix/gentoo/distfiles"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage /usr/local/portage/layman/desktop-effects /usr/local/portage/layman/sunrise /usr/local/portage/layman/arcon /usr/local/portage/layman/rion /usr/local/portage/layman/oss-overlay /usr/local/portage/layman/qutim"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac aalib acl acpi alisp alsa amd64 applet archive ares artworkextra audiofile automount bazaar berkdb bittorrent bittorrent-external branding bzip2 cairo caps cdr cdrtools chardet chdir cjk cli consolekit cover cracklib crypt css cue cups cupsddk curl custom-optimization cvs cxx darcs dbus device-mapper dga dht dirac directfb disk-partition divx djvu dri dv dvd dvdr emerald enca encode exif extras fat ffmpeg fileinfo firefox flac fontconfig fortran fts3 fuse gd gdbm gdu gif glade glib glitz gnome gnome-keyring gpm graphite grub gstreamer gtk gzip hddtemp iconv icq icu id3tag idle idn inifile intl jabber java java6 javascript joystick jpeg jpeg2k kate kvm ladspa lame lcms libass libcaca libnotify libsamplerate libtiger lights lirc lm_sensors loop-aes lucene lyrics lzma lzo mad matroska mercurial mikmod mmx mmxext mng modules mp2 mp3 mp4 mp4live mpeg mpeg2 mplayer mpu401 mtp mudflap multilib musepack mysql mysqli nautilus ncurses netplay network nls nptl nptlonly nsplugin nss ntfs nvidia offensive ogg ogm oodict openal opencore-amr opengl openmp openssl opensslcrypt optimization optimized-qmake pam parse-clocks pcf pch pcre pdo perl php png policykit ppds pppd projectm psf python qt3support qt4 rar readline realmedia reflection rtsp ru-dv ru-g ru-i ru-k screenshot sdl secure-delete session slang slp smp sndfile sound sounds speex spell spl sqlite sqlite3 sse sse2 sse3 ssl statistics stream strong-optimization subtitles svg sysfs t1lib taglib tcpd textures theora threads thunderbird tiff timidity tls toolbar trayicon truetype tta twolame udev unicode unzip usb v4l v4l2 vamp vdpau vorbis vorbis-psy vpx wav wavpack wma wmp x264 xanim xattr xcb xcomposite xhtml xinetd xml xmlreader xmlrpc xmlwriter xorg xosd xpm xulrunner xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" LIRC_DEVICES="devinput" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 13 Alexander Holler 2010-08-22 11:09:14 UTC
Just got hit by this bug with gcc 4.5.1 on ARM which means it isn't a x86-hw specific bug. diffutils-3.0 emerged without problems.
Comment 14 mark 2010-10-05 10:49:29 UTC
Just wanted to confirm that I am also seeing this bug on an amd64 no-multilib (not-hardened) dual atom 330 machine with gcc-4.5.1 (to make use -march=atom), while doing a system emerge. I haven't checked the ~amd64 yet, and later I will check it on the same machine with multilib profile.
Comment 15 mark 2010-10-05 10:56:46 UTC
Adding to the above, a system and world emerge on a n270 atom netbook (x86 profile only) with gcc-4.5.1 (to make use of -march=atom) completed flawlessly, so the x86 arch is unaffected. 

Comment 16 dE 2010-12-20 03:58:11 UTC
Reproducible on x64 running in chroot on Debian.

I compile it the whole night after which I got suspicious. Works for 2.9
Comment 17 Alexander Kozyrev 2011-01-05 11:02:00 UTC
Confirming the bug on amd64 no-multilib, diffutils-2.8.7-r2, gcc 4.5.2.
Diffutils-3.0 emerges successfully.
Comment 18 Stuart Shelton 2011-01-12 11:28:41 UTC
I see this also when building =sys-apps/diffutils-2.8.7-r2 on a amd64-profile Atom N330 with gcc-4.5.2 and 'march=atom' in CFLAGS.
Comment 19 3PO 2011-01-14 16:28:42 UTC
> I see this also when building =sys-apps/diffutils-2.8.7-r2 on a amd64-profile
> Atom N330 with gcc-4.5.2 and 'march=atom' in CFLAGS.

--------------------------------------------------------------------------------
I got the same error.
I fixed this with installing sys-apps/diffutils-3.0