Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487700 - various packages hang/super slow during configure (checking sleep/re_compile_pattern/etc...) as they hit futexes
Summary: various packages hang/super slow during configure (checking sleep/re_compile_...
Status: RESOLVED DUPLICATE of bug 487558
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
: 487782 488136 491438 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-11 21:19 UTC by reagentoo
Modified: 2013-11-17 17:50 UTC (History)
15 users (show)

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


Attachments
re_compile_pattern conftest strace (conftest.strace,5.55 KB, text/plain)
2013-10-23 18:45 UTC, Victor Mataré
Details
re_compile_pattern conftest valgrind output (conftest.valgrind,4.60 KB, text/plain)
2013-10-23 18:48 UTC, Victor Mataré
Details

Note You need to log in before you can comment on or make changes to this bug.
Description reagentoo 2013-10-11 21:19:46 UTC
Stops tests on this:
...
checking whether sleep is declared... yes
checking for working sleep...
(inf. time)

# emerge --info
Portage 2.2.7 (!/var/lib/layman/0x1u1z/profiles/0x1u1z/desktop, gcc-4.7.3, glibc-2.17, 3.10.14-gentoo x86_64)
=================================================================
System uname: Linux-3.10.14-gentoo-x86_64-Intel-R-_Core-TM-_i5-3450_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:     6063944 total,     64788 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Fri, 11 Oct 2013 16:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1, 4.8.1-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo crossdev 0x1u1z local
Installed sets: @0x1u1z
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx-i -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core-avx-i -O2 -pipe"
DISTDIR="/mnt/routine/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="ru_RU.utf8"
LC_ALL="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/mnt/routine/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/routine/portage"
PORTDIR_OVERLAY="/mnt/routine/overlays/crossdev /mnt/routine/overlays/0x1u1z /mnt/routine/overlays/local"
USE="X a52 aac aacplus aacs acl aften aio alsa amd64 amr avx berkdb bluray bzip2 c++0x cairo cli consolekit corefonts cracklib crypt cxx dbus declarative djvu dri dts dv dvb dvd enca exif faac faad ffmpeg flac fontconfig g3dvl gd gdbm gif gmp gnutls gpg gstreamer gudev hdri highlight hwdb iconv icu idn ipv6 jpeg jpeg2k kde kdrive keymap kipi lame lcms libass lzma lzo mad matroska minizip mmx mmxext mng modplug modules mp3 mpeg mtp mudflap multilib multimedia natspec ncurses network nls nptl ogg openal openexr opengl openmp openssl opus pam pango pcre pdf plasma png policykit postgres qt3support qt4 quicktime raw readline rtmp session sndfile speex spell sqlite sse sse2 sse3 sse4_1 ssl ssse3 svg taglib tcpd theora threads tiff tray truetype udev udisks unicode usb v4l vaapi vcd vdpau vorbis vpx webdav webdav-serf webp x264 xa xcb xinerama xml xmlpatterns xmp xorg xv xvid zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FOO2ZJS_DEVICES="hp1020" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 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, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

Reproducible: Always
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-10-11 21:42:05 UTC
> checking whether sleep is declared... yes
> checking for working sleep... yes

Can't reproduce, it does wait a small bit; but not really too long.

Could you attach the complete build.log as well as the complete config.log?

So, we need to dig a little bit deeper as to why it hangs there; can you also try to obtain the process tree (`ps axjf`) of everything that runs under emerge?

If you see a process that seems related to that sleep check; you might want to try to attach to it with a debugger and obtain a backtrace, which is explained at http://www.gentoo.org/proj/en/qa/backtraces.xml

(Alternatively there are things like strace and ltrace to experiment with)
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-10-12 14:05:22 UTC
Can you try a stable version of portage (eg. 2.1.1) to see if this is a recent regression in the way portage restricts the build environment?
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-10-12 14:06:38 UTC
Sorry, meant 2.2.1.
Comment 4 reagentoo 2013-10-12 15:28:20 UTC
Hmm, this bug reproduce on my home machine without portage. (make manually)
It's not portage regression.

But now, for some reason, everything works correctly. Im not know why!
Configure tests were stops on some other packets!
Comment 5 reagentoo 2013-10-12 18:12:57 UTC
Now same problem with dev-libs/pth-2.0.7-r3
...
checking for stack setup via makecontext... ok
checking for sigaltstack... (cached) yes
checking for typedef stack_t... (cached) yes
checking for stack setup via sigaltstack...
(INF!!!)

CPU usage: 30% on i5 ivy...
GCC 4.8.1-r1, and 4.7.3-r1.
Comment 6 SpanKY gentoo-dev 2013-10-16 06:14:20 UTC
*** Bug 487782 has been marked as a duplicate of this bug. ***
Comment 7 SpanKY gentoo-dev 2013-10-16 06:14:29 UTC
*** Bug 488136 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2013-10-16 06:16:01 UTC
what desktop environment are people using ?  are you building locally (i.e. in a terminal), or are you sshing into a remote system ?
Comment 9 dyle 2013-10-16 06:26:52 UTC
(In reply to SpanKY from comment #8)
> what desktop environment are people using ?  are you building locally (i.e.
> in a terminal), or are you sshing into a remote system ?

I do have the problems mentioned here and in https://bugs.gentoo.org/show_bug.cgi?id=487782

I for myself compile locally in a KDE Konsole. checking hangs INF in sleep for the findutils.
Comment 10 shinydoofy 2013-10-16 06:53:15 UTC
(In reply to SpanKY from comment #8)
> what desktop environment are people using ?  are you building locally (i.e.
> in a terminal), or are you sshing into a remote system ?
I'm building on my local system in KDE's Konsole, su'd to root. As pointed out in bug 488136, comment 5, it can be solved by compiling on tty1, logging in as root normally.
Comment 11 SpanKY gentoo-dev 2013-10-16 06:57:16 UTC
what if you guys launch `screen` first ?  or if you ssh to the localhost and run emerge ?  does it work any better ?
Comment 12 Lee Trager 2013-10-16 07:50:13 UTC
This is happening to me with tar-1.27, it hangs on

checking for working re_compile_pattern... 

# emerge --info
Portage 2.2.7 (default/linux/amd64/13.0/desktop/gnome, gcc-4.8.1, glibc-2.17, 3.11.5-gentoo x86_64)
=================================================================
System uname: Linux-3.11.5-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:     8149096 total,   2409064 free
KiB Swap:   15624976 total,  15624968 free
Timestamp of tree: Wed, 16 Oct 2013 06:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.2
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.6.4, 4.7.3-r1, 4.8.1-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo hasufell ltrager
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x Google-TOS google-chrome NVIDIA-CUDA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CPPFLAGS="-O2 -pipe -fomit-frame-pointer -march=native"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/hasufell /home/nuke/overlay"
USE="X a52 aac acl acpi aim alsa amd64 apm apng applet autoipd avahi bash-completion bashcompletion berkdb bluetooth bluray branding btrfs bzip2 cairo call caps cdda cddb cli clutter colord cracklib crypt cuda cups cxx daap dbus dconf device-mapper dga dhcpcd dirac djvu dri dts dv dvb dvd dvdnav dvdr eds efi emacs emboss encode espeak evo exif faac faad fam fat ffmpeg firefox flac fluidsynth fontconfig foomaticdb fortran ftp fuse g3dvl gconf gcrypt gd gdbm gdu geoip gif gimp glade glut gmp gnome gnome-keyring gnome-online-accounts gnuplot gnutls gphoto2 gpm graphviz gsm gstreamer gtk gtk3 gtkspell gudev gui guile gzip gzip-el hddtemp hwdb iconv id3tag idn ieee1394 imagemagick imap imlib introspection ipv6 irc jabber java java6 javascript jingle jit joystick jpeg jpeg2k kate kerberos kqemu kvm lame latex lcms ldap libass libnotify libsecret libtiger libv4l libv4l2 live lm_sensors lzma lzo mad matroksa md5sum midi mikmod mime minizip mmap mmx mmxext mng mod modules mozilla mp3 mp4 mpeg mpeg123 mplayer mtp mudflap multilib musepack nautilus ncat ncurses ndiff network networking nfs nls nmap-update nntp nocd nping nptl nsplugin numa offensive office ogg openal opencl openexr opengl openmp openssl openvg opus oscar osdmenu pam pango parted pcap pcre pdf pdfimport perl pgo png policykit posix ppds prediction pulseaudio python qemu qt qt3support qt4 quicktime rar raw readline real realtime rtc rtmp rtsp schroedinger sdl sdl-image seamonkey session shine smp socialweb sound sox speex spell spice sqlite sse sse2 sse3 sse4_1 ssl ssse3 startup-notification stream subversion svg syslog systemd tcpd telepathy templates theora threads tiff toolkit-scroll-bars transcode truetype twopack udev udisks uml unicode unlock-notify upnp upnp-av upower usb usbredir utp v4l v4l2 vala vdpau videos vim-syntax virt-network vorbis vpx wav wavpack webkit webm wmf wxwidgets x264 xattr xcb xcomposite xft xml xosd xpm xscreensaver xv xvfb xvid xvmc youtube zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="openssl" DVB_CARDS="cx23885" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev mouse keyboard joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer nlpsolver wiki-publisher" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 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:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 13 Lee Trager 2013-10-16 08:19:09 UTC
I'm doing this under gnome-3.8.0 with gnome-terminal, not sure why it would make a difference. I tried in a screen session and there was no change. Below is the output from config when I attached to it with strace -f -p <pid>

[pid 32085] execve("./conftest", ["./conftest"], [/* 239 vars */]) = 0
[pid 32085] brk(0)                      = 0x9ee000
[pid 32085] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3def312000
[pid 32085] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] fstat(3, {st_mode=S_IFREG|0644, st_size=229275, ...}) = 0
[pid 32085] mmap(NULL, 229275, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3def2da000
[pid 32085] close(3)                    = 0
[pid 32085] open("/usr/lib64/libsandbox.so", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220>\0\0\0\0\0\0"..., 832) = 832
[pid 32085] fstat(3, {st_mode=S_IFREG|0755, st_size=72264, ...}) = 0
[pid 32085] mmap(NULL, 2193032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3deeeda000
[pid 32085] mprotect(0x7f3deeeea000, 2097152, PROT_NONE) = 0
[pid 32085] mmap(0x7f3def0ea000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f3def0ea000
[pid 32085] mmap(0x7f3def0ec000, 22152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3def0ec000
[pid 32085] close(3)                    = 0
[pid 32085] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
[pid 32085] open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0M\2\0\0\0\0\0"..., 832) = 832
[pid 32085] fstat(3, {st_mode=S_IFREG|0755, st_size=1728760, ...}) = 0
[pid 32085] mmap(NULL, 3841080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3deeb30000
[pid 32085] mprotect(0x7f3deecd1000, 2093056, PROT_NONE) = 0
[pid 32085] mmap(0x7f3deeed0000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a0000) = 0x7f3deeed0000
[pid 32085] mmap(0x7f3deeed6000, 15416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3deeed6000
[pid 32085] close(3)                    = 0
[pid 32085] open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\20\0\0\0\0\0\0"..., 832) = 832
[pid 32085] fstat(3, {st_mode=S_IFREG|0755, st_size=14480, ...}) = 0
[pid 32085] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3def2d9000
[pid 32085] mmap(NULL, 2109720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3dee92c000
[pid 32085] mprotect(0x7f3dee92f000, 2093056, PROT_NONE) = 0
[pid 32085] mmap(0x7f3deeb2e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f3deeb2e000
[pid 32085] close(3)                    = 0
[pid 32085] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3def2d8000
[pid 32085] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3def2d7000
[pid 32085] arch_prctl(ARCH_SET_FS, 0x7f3def2d8700) = 0
[pid 32085] mprotect(0x7f3deeed0000, 16384, PROT_READ) = 0
[pid 32085] mprotect(0x7f3deeb2e000, 4096, PROT_READ) = 0
[pid 32085] mprotect(0x7f3def0ea000, 4096, PROT_READ) = 0
[pid 32085] mprotect(0x600000, 4096, PROT_READ) = 0
[pid 32085] mprotect(0x7f3def313000, 4096, PROT_READ) = 0
[pid 32085] munmap(0x7f3def2da000, 229275) = 0
[pid 32085] rt_sigaction(SIGALRM, {SIG_DFL, [ALRM], SA_RESTORER|SA_RESTART, 0x7f3deeb685c0}, {SIG_DFL, [], 0}, 8) = 0
[pid 32085] alarm(2)                    = 0
[pid 32085] brk(0)                      = 0x9ee000
[pid 32085] brk(0xa0f000)               = 0xa0f000
[pid 32085] open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] fstat(3, {st_mode=S_IFREG|0644, st_size=1852416, ...}) = 0
[pid 32085] mmap(NULL, 1852416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3dee767000
[pid 32085] close(3)                    = 0
[pid 32085] open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
[pid 32085] fstat(3, {st_mode=S_IFREG|0644, st_size=26244, ...}) = 0
[pid 32085] mmap(NULL, 26244, PROT_READ, MAP_SHARED, 3, 0) = 0x7f3def30b000
[pid 32085] close(3)                    = 0
[pid 32085] writev(2, [{"*** Error in `", 14}, {"./conftest", 10}, {"': ", 3}, {"malloc(): memory corruption", 27}, {": 0x", 4}, {"00000000009f0fc0", 16}, {" ***\n", 5}], 7) = 79
[pid 32085] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3def30a000
[pid 32085] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] fstat(3, {st_mode=S_IFREG|0644, st_size=229275, ...}) = 0
[pid 32085] mmap(NULL, 229275, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3def29f000
[pid 32085] close(3)                    = 0
[pid 32085] open("/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
[pid 32085] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240/\0\0\0\0\0\0"..., 832) = 832
[pid 32085] futex(0x7f3deeed4640, FUTEX_WAIT, 2, NULL
Comment 14 josef.95 2013-10-16 13:16:05 UTC
Presumably it could be due to =nvidia-drivers-331.13
Please test it with <nvidia-drivers-331.13 on linux-3.10 Kernel
or xf86-video-nouveau driver
Comment 15 Randy Andy 2013-10-16 15:45:03 UTC
Great Josef,

after downgrading nvidia-drivers every ebuild that fails before (findutils, tar, e.g) compiles fine now, started in a X-terminal like konsole, which fails before.

Well done, many thanks!
Comment 16 SpanKY gentoo-dev 2013-10-16 20:35:41 UTC
well this is going to be a fun one to track down :).  thanks guys for the triage help.
Comment 17 Lee Trager 2013-10-17 07:03:10 UTC
Just got bitten by this bug when trying to build grub-2.00_p5107-r2
Comment 18 Gottfried Munda 2013-10-17 11:24:29 UTC
I can confirm this issue, hangs during configure of grub and findutils. Downgrading to nvidia-drivers-325.15 and everything works fine.
Comment 19 PM 2013-10-17 12:17:38 UTC
To all who solved this issue by downgrading nvidia-drivers: can you double-check that that's what really helped? On my system this bug just magically disappeared without any downgrading.
Comment 20 reagentoo 2013-10-17 13:30:02 UTC
(In reply to Piotr Mitas from comment #19)
> To all who solved this issue by downgrading nvidia-drivers: can you
> double-check that that's what really helped? On my system this bug just
> magically disappeared without any downgrading.

I can confirm that this bug magically appears and disappears on nvidia-drivers-331.13 without downgrading.
Comment 21 Zentoo 2013-10-18 08:03:28 UTC
Same problem here since two days.

It's really annoying since I discover it while updating a full system with a new toolchain in a chroot. In this chroot some packages hang at configure time forever. This packages were:
corutils, cpio, tar, findutils, grub, texinfo, m4

I realized lately that it was my host system that get the problem and not my chroot.

So I think it was relative to the kernel since only kernel, /dev and /sys was shared to both system. I thought it since a boot on an older kernel solve it.

So I downgrade nvidia-drivers from 331.13 right now on my last kernel to check if that solve this issue.
Comment 22 Zentoo 2013-10-18 08:09:11 UTC
(In reply to Zentoo from comment #21)
> Same problem here since two days.
> 
> It's really annoying since I discover it while updating a full system with a
> new toolchain in a chroot. In this chroot some packages hang at configure
> time forever. This packages were:
> corutils, cpio, tar, findutils, grub, texinfo, m4
> 
> I realized lately that it was my host system that get the problem and not my
> chroot.
> 
> So I think it was relative to the kernel since only kernel, /dev and /sys
> was shared to both system. I thought it since a boot on an older kernel
> solve it.
> 
> So I downgrade nvidia-drivers from 331.13 right now on my last kernel to
> check if that solve this issue.

I confirm right now, I only downgrade nvidia-drivers, stop X, reload nvidia-driver and start x back and I could emerge back corutils, cpio, tar, findutils, grub, texinfo, m4.

So it's a nvidia-driver-331.13 issue !
Comment 23 Nathaniel 2013-10-18 17:38:06 UTC
I'm running into a freeze on "checking for working re_compile_pattern..." on grub-2.00_p5107.  I saw that the last comment suggests that this is a problem with nvidia-drivers-331.13, however it has not gone away even though I downgraded to the latest long-term stable release 319.60.
Comment 24 Nathaniel 2013-10-18 17:40:45 UTC
Also, I'm having some weirdness once I try to cancel the grub emerge.  If I hit control c, I get "exiting on signal 2, src_configure aborted; exiting.  sandbox:stop caught signal 2 in pid 21295" but the terminal freezes and I can never get back to the command line.

I'm using konsole in kde
Comment 25 Lee Trager 2013-10-19 05:54:51 UTC
I fixed this by killing X unloading the NVIDIA kernel module and building. Just tried with the same NVIDIA kernel module loaded under X and both build just fine. WTF?
Comment 26 reagentoo 2013-10-19 08:52:05 UTC
(In reply to Lee Trager from comment #25)
> I fixed this by killing X unloading the NVIDIA kernel module and building.
> Just tried with the same NVIDIA kernel module loaded under X and both build
> just fine. WTF?

Bug appears not always...
Comment 27 Zentoo 2013-10-20 11:22:49 UTC
For me, since i downgrade my nvidia module from 331.13 to 325.15 on my unstable gentoo fully recompiled with gcc-4.8.1-r1: everythings work fine.

I have use a emerge -e world to check it and problematic ebuilds (corutils, cpio, tar, findutils, grub, texinfo, m4) have just compiled fine.

If I upgrade back nvidia-drivers to 331.15, I can't compile theses ebuilds. That blocks each time on a FUTEX at configure time (Checking for working sleep... or checking re_compile_pattern...).
Comment 28 Victor Mataré 2013-10-23 18:40:53 UTC
I'm also hitting the re_compile_pattern futex WITHOUT the nvidia module loaded. I'm running an Optimus system, so the nvidia kernel module was loaded at bootup, but then un-loaded and the nvidia card disabled with bbswitch.

I run the appropriate conftest binary in an konsole, tmux session that got started *after* unloading the nvidia module and starting X with the intel driver. The binary uses no nvidia symbols whatsoever:

/var/tmp/portage/sys-boot/grub-2.00_p5107-r2/work/grub-2.00-pc # ldd conftest
        linux-vdso.so.1 (0x00007fffc8dff000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fd8e7a0e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd8e7db9000)

# ltrace ./conftest 
__libc_start_main(0x4007a0, 1, 0x7fff717edcd8, 0x400be0 <unfinished ...>
signal(SIGALRM, 0)                                                                 = 0
alarm(2)                                                                           = 0
setlocale(LC_ALL, "en_US.UTF-8")                                                   = "en_US.UTF-8"
re_set_syntax(0x400b06, 0, 0x7facb0a00344, 0xe5fe40)                               = 0
memset(0x6020a0, '\0', 64)                                                         = 0x6020a0
re_compile_pattern(0x400cc4, 11, 0x6020a0, 130)                                    = 0
re_search(0x6020a0, 0x400cd0, 15, 0)                                               = 0xffffffff
re_set_syntax(0, 0, 0x7facb10f4628, 0xe60e40)                                      = 0x400b06
memset(0x6020a0, '\0', 64)                                                         = 0x6020a0
re_compile_pattern(0x400ce0, 5, 0x6020a0, 130)                                     = 0
re_search(0x6020a0, 0x400cf0, 25, 0*** Error in `./conftest': malloc(): memory corruption: 0x0000000000e61fc0 ***
^C <no return ...>
--- SIGINT (Interrupt) ---
+++ killed by SIGINT +++

I'm also attaching an strace.
The only way I can make sense of this is that the nvidia module does some seriously weird, system runtime-permanent damage to the memory layout. Will try rebooting with the module blacklisted...
Comment 29 Victor Mataré 2013-10-23 18:45:27 UTC
Created attachment 361734 [details]
re_compile_pattern conftest strace
Comment 30 Victor Mataré 2013-10-23 18:48:45 UTC
Created attachment 361736 [details]
re_compile_pattern conftest valgrind output
Comment 31 Victor Mataré 2013-10-23 19:14:13 UTC
now I rebooted with modprobe.blacklist=nvidia nvidia.disable=1 in kernel cmdline, so the nvidia kernel module was definitely never loaded. Still had the X config using the nvidia driver though, so X tried to load it once, but failed of course.

Interestingly, the conftest binary still blocks at the same futex, but receives a SIGALRM after a few seconds:

writev(3, [{"*** Error in `", 14}, {"./conftest", 10}, {"': ", 3}, {"malloc(): memory corruption", 27}, {": 0x", 4}, {"0000000000c71fc0", 16}, {" ***\n", 5}], 7*** Error in `./conftest': malloc(): memory corruption: 0x0000000000c71fc0 ***
) = 79
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa6504e6000
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_dev=makedev(8, 2), st_ino=1179691, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=640, st_size=326313, st_atime=2013/10/23-21:01:38, st_mtime=2013/10/23-21:01:38, st_ctime=2013/10/23-21:01:38}) = 0
mmap(NULL, 326313, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7fa65044b000
close(4)                                = 0
open("/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240/\0\0\0\0\0\0"..., 832) = 832
futex(0x7fa6502c8620, FUTEX_WAIT, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
+++ killed by SIGALRM +++
Alarm clock

Rebuilding the conftest binary changes nothing. Now I'll try to reboot so that in fact NOTHING touches the nvidia driver AT ALL.
Comment 32 Victor Mataré 2013-10-23 19:44:13 UTC
ok, now I can say for sure that it doesn't matter at all if the nvidia kernel module OR the nvidia X driver are loaded. The conftest binaries that gcc produces are identical in all three cases. Now what completely eludes me is how the nvidia driver actually does influence the conftest binary. Obviously it breaks it by merely just existing in the file system. gcc doesn't touch any file from the nvidia package when compiling, and neither does the conftest binary itself when running. Hats off to anyone who can explain this.
Comment 33 Victor Mataré 2013-10-23 21:21:11 UTC
So now after uninstalling the nvidia driver entirely, the memory corruption still happens, but the SIGALRM allows configure to continue. Now I wonder if the memory corruption is actually something to be expected, together with the SIGALRM. Sorry for the unnecessary noise if that's the case.
Comment 34 Ron 2013-10-24 13:38:56 UTC
I can confirm this as well simply rolling back the driver too 325.15 solves the issue.

Packages I noticed affected thus far.

app-arch/tar
app-arch/cpio
sys-boot/grub

I'm sure there is more..
I have a feeling it has something to do with the new Unified Memory kernel module then again I could be 100% wrong.
Comment 35 Jeroen Roovers gentoo-dev 2013-10-24 15:45:49 UTC
All the contrary reports make clear that nvidia-drivers has either everything or nothing to do with it.
Comment 36 Jeroen Roovers gentoo-dev 2013-10-26 16:23:02 UTC

*** This bug has been marked as a duplicate of bug 487558 ***
Comment 37 Jeroen Roovers gentoo-dev 2013-11-17 17:50:39 UTC
*** Bug 491438 has been marked as a duplicate of this bug. ***