Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267053 - sys-apps/sandbox-1.9 breaks configure test for fork (seen with app-editors/emacs and media-gfx/asymptote)
Summary: sys-apps/sandbox-1.9 breaks configure test for fork (seen with app-editors/em...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
: 282712 283924 284907 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-22 06:10 UTC by Matt Jorde
Modified: 2010-08-15 05:58 UTC (History)
8 users (show)

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


Attachments
build.log ending where configure stalls (build.log,15.47 KB, text/plain)
2009-04-22 06:12 UTC, Matt Jorde
Details
Test program from configure (conftest.c,255 bytes, text/plain)
2009-04-23 07:43 UTC, Ulrich Müller
Details
Modified conftest (conftest.c,308 bytes, text/plain)
2009-04-26 00:18 UTC, Matt Jorde
Details
build.log of 'emerge asymptote' (build.log,6.08 KB, text/plain)
2009-05-05 01:02 UTC, Christian Bartl
Details
abstract of 'strace -f emerge asymptote' (emerge_asymptote3.trc,664.97 KB, text/plain)
2009-05-05 01:19 UTC, Christian Bartl
Details
sandbox build.log (build.log,43.80 KB, text/plain)
2009-06-05 04:01 UTC, Matt Jorde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Jorde 2009-04-22 06:10:20 UTC
When I try to emerge app-editors/emacs-22.3-r2, it stalls during configuration at "checking for working fork... "

It is possible that this is a more generic bug that I just happened to notice with emacs. However, all other emerges over the last few days have been completing successfully.

Reproducible: Always

Steps to Reproduce:
1. emerge app-editors/emacs
Actual Results:  
configure stalls

Expected Results:  
configure completes, followed by the rest of the emerge process

Here are the results of emerge app-editors/emacs -pv:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] app-editors/emacs-22.3-r2 [22.1-r3] USE="X alsa gif gtk jpeg kerberos%* png spell tiff xpm -Xaw3d -gzip-el -hesiod -motif -sound -source -toolkit-scroll-bars" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB



Here is my emerge --info:

Portage 2.1.6.11 (default/linux/x86/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.25-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.25-gentoo-r1-i686-Intel-R-_Core-TM-2_CPU_6600_@_2.40GHz-with-gentoo-2.0.0
Timestamp of tree: Wed, 22 Apr 2009 01:30:01 +0000
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 2.1.7
dev-lang/python:     2.5.4-r2, 2.6.2
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake:      2.6.3-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
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/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/desktop-effects /usr/local/portage/layman/gnome /usr/local/portage/layman/science /usr/local/portage/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache apache2 artworkextra automount avahi bash-completion beagle berkdb bluetooth branding bzip2 cairo cddb cdr cli cracklib crypt cups daap dbus deskbar devhelp dri dts dvd dvdr dvdread dvi eds emboss emerald encode esd evo exif fam ffmpeg firefox flac fortran gcj gd gdbm gif gimp glade glitz gnome gnome-keyring gnome-print gphoto2 gpm gstreamer gtk guile hal howl iconv ieee1394 imagemagick inherit-graph ipod ipv6 isdnlog java jpeg kerberos latex ldap libnotify mad mdb midi mikmod mmx mono mp3 mpeg msn mudflap mysql mysqli nautilus ncurses network networkmanager nfs nls nptl nptlonly odbc offensive ogg opengl openmp oss pam pcre pdf perl php plotutils png policykit posix ppds pppd pulseaudio python qt3 qt3support qt4 quicktime raw readline reflection samba scanner sdl session sftp smp soap sockets sourceview spell spl sqlite3 sse sse2 ssl subversion svg sysfs syslog tcpd tetex theora threads tiff tokenizer tracker truetype unicode usb valgrind vorbis win32codecs wmf x86 xcomposite xforms xine xinetd xml xorg xpm xprint xscreensaver xsl xulrunner xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="i810 nv nvidia vesa vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matt Jorde 2009-04-22 06:12:39 UTC
Created attachment 189131 [details]
build.log ending where configure stalls

Here is the build.log showing the entire emerge process up until it stalls during configure.
Comment 2 Ulrich Müller gentoo-dev 2009-04-23 06:05:51 UTC
Are there any messages from the kernel (in /var/log/messages)?
Comment 3 Matt Jorde 2009-04-23 07:06:35 UTC
(In reply to comment #2)
> Are there any messages from the kernel (in /var/log/messages)?
> 

Here are the kernel messages from before I ran emerge up until it stalled:

Apr 23 00:02:14 bremen sudo:  majorde : TTY=pts/1 ; PWD=/home/majorde ; USER=root ; COMMAND=/usr/bin/emerge app-editors/emacs
Apr 23 00:02:14 bremen sudo: pam_unix(sudo:session): session opened for user root by majorde(uid=0)
Apr 23 00:02:14 bremen sudo: pam_unix(sudo:session): session closed for user root
Comment 4 Ulrich Müller gentoo-dev 2009-04-23 07:43:48 UTC
Created attachment 189213 [details]
Test program from configure

Hm, I've no idea what could be the reason for this. Does it consume CPU time when it hangs (should be a "conftest" process)?

What happens if you compile and run attached program?
Comment 5 Matt Jorde 2009-04-23 15:57:05 UTC
(In reply to comment #4)
> Created an attachment (id=189213) [edit]
> Test program from configure
> 
> Hm, I've no idea what could be the reason for this. Does it consume CPU time
> when it hangs (should be a "conftest" process)?
> 
> What happens if you compile and run attached program?
> 
The conftest process is running, but it does not consume CPU time.

Running the attached program produces no output, and when I run

./a.out && echo "hi"

it still produces no output so it seems the program must be failing.

Do you know of a certain package I need to get a working fork?
Comment 6 Ulrich Müller gentoo-dev 2009-04-25 21:14:16 UTC
I'd say that this is not a problem of Emacs. Could you modify the test program to output the error message, e.g. by changing the "if" statement to the following:

    if (fork() < 0) {
      perror("");
      exit (1);
    }
Comment 7 Matt Jorde 2009-04-26 00:18:04 UTC
Created attachment 189437 [details]
Modified conftest

Adding perror still produced no output. It seems HAVE_UNISTD_H was false so it never included unistd.h.

The attached file is a modified version where fork seems to work. Running it prints "success" twice.
Comment 8 Christian Bartl 2009-05-05 00:52:41 UTC
Hi,

same problem here with asymptote. strace output and build.log will follow as attachment. 

homunculus tmp # emerge -pv asymptote

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] media-gfx/asymptote-1.70 [1.66] USE="X boehm-gc doc* examples imagemagick python vim-syntax -emacs -fftw -gsl -latex -sigsegv" 0 kB

--------------------------------------------------------------------
homunculus tmp # emerge --info

Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.9_p20081201-r2, 2.6.28-gentoo-r3 i686)
=================================================================
System uname: Linux-2.6.28-gentoo-r3-i686-AMD_Athlon-tm-_64_Processor_2800+-with-gentoo-2.0.0
Timestamp of tree: Mon, 04 May 2009 18:15:02 +0000
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.4.4-r15, 2.5.4-r2, 2.6.2
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake:      2.6.3-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /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 /etc/udev/rules.d"
CXXFLAGS="-march=i686 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://130.59.10.34/mirror/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US en_GB de de_DE de_AT"
MAKEOPTS="-j2"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa audiofile bash-completion berkdb boost bzip2 cairo cddb cdparanoia cdr cli cracklib crypt cscope cups dbus dga directfb divx doc dri dvd dvdr dvdread embedded encode examples exif fbcon ffmpeg firefox flac foomaticdb fortran ftp gdbm gif gphoto2 gpm graphviz gstreamer hal htmlhandbook iconv id3tag imagemagick imlib ipv6 isdnlog jack java javascript jpeg jpeg2k kde kipi ladcca ladspa laptop lash libg++ libsamplerate libwww lm_sensors lv2 mad mbox midi mime mmap mmx mmxext mng mozilla mp3 mpeg mplayer mtp mudflap musicbrainz ncurses nls nptl nptlonly nsplugin nvidia ogg openal opengl openmp pam pcre pdf perl png pppd python qt3 qt4 readline realmedia recode redland reflection rtc sdl session spl sqlite sse sse2 ssl svg svga sysfs tcpd tetex theora threads tiff truetype unicode usb vcd vim-syntax vorbis win32codecs x86 xine xorg xosd xpm xv xvid xvmc zlib" ALSA_CARDS="emu10k1 ice1712" 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 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" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US en_GB de de_DE de_AT" NETBEANS_MODULES="ide nb harness" USERLAND="GNU" VIDEO_CARDS="vga nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 9 Christian Bartl 2009-05-05 01:02:51 UTC
Created attachment 190378 [details]
build.log of 'emerge asymptote'
Comment 10 Christian Bartl 2009-05-05 01:19:52 UTC
Created attachment 190380 [details]
abstract of 'strace -f emerge asymptote'

The whole file is too big. I can send a larger abstract compressed on demand.
This line before I pressed CTRL+C was

18769 futex(0xb7ec92b0, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted)
Comment 11 Ulrich Müller gentoo-dev 2009-05-05 05:49:29 UTC
(In reply to comment #8)
> same problem here with asymptote.

Unlikely that this is a problem of Emacs or of asymptote, so reassigning.
@toolchain: Any idea why fork would hang?
Comment 12 Li Yanrui 2009-05-08 16:05:11 UTC
Same problem here with emacs-cvs 23
Comment 13 Christian Bartl 2009-05-08 19:55:27 UTC
Can anybody see in the trace what futex might be waiting for? 
Is there anything I can do to help analysis? Maybe some hints where to start searching or what to test.
This issue prevents me from updating my system.
Comment 14 Ulrich Müller gentoo-dev 2009-05-08 20:16:03 UTC
(In reply to comment #13)
> Can anybody see in the trace what futex might be waiting for? 
> Is there anything I can do to help analysis? Maybe some hints where to start
> searching or what to test.

I wonder if this could be a sandbox issue? Can you try to disable the sandbox (remove it from FEATURES) or to downgrade to some earlier version?
Comment 15 Christian Bartl 2009-05-08 21:55:59 UTC
FEATURES"-sandbox" emerge asymptote
finishes successfully. So I'm happy for now, but have no clue what this means for this bug#.

Thanks a lot Ulrich

(In reply to comment #14)
Comment 16 Li Yanrui 2009-05-09 00:16:55 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Can anybody see in the trace what futex might be waiting for? 
> > Is there anything I can do to help analysis? Maybe some hints where to start
> > searching or what to test.
> 
> I wonder if this could be a sandbox issue? Can you try to disable the sandbox
> (remove it from FEATURES) or to downgrade to some earlier version?
> 

You are right. Downgrading sandbox to version 1.7 can solve this problem.
Comment 17 Matt Jorde 2009-05-09 04:52:28 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Can anybody see in the trace what futex might be waiting for? 
> > Is there anything I can do to help analysis? Maybe some hints where to start
> > searching or what to test.
> 
> I wonder if this could be a sandbox issue? Can you try to disable the sandbox
> (remove it from FEATURES) or to downgrade to some earlier version?
> 
Downgrading also solved my issue with emacs
Comment 18 SpanKY gentoo-dev 2009-06-04 04:32:29 UTC
newer sandbox grabs locks before forking.  if the locking methods are broken (your kernel sucks or something), then i imagine things will hang.

does the example fork() test work when just doing:
sandbox ./a.out

you should also post the full build output of `emerge sandbox`
Comment 19 Matt Jorde 2009-06-05 04:01:41 UTC
Created attachment 193596 [details]
sandbox build.log

Here is the build log for sandbox-2.0 with which I'm having the same problem.

Running the configure fork test as 'sandbox ./a.out' runs successfully.
Comment 20 Alin Năstac (RETIRED) gentoo-dev 2009-08-31 18:57:13 UTC
*** Bug 282712 has been marked as a duplicate of this bug. ***
Comment 21 Alin Năstac (RETIRED) gentoo-dev 2009-08-31 19:00:00 UTC
Reopening the bug, reported did his part.
Another similar issue has been reported for net-analyzer/ntop (see bug 282712).
Comment 22 Jon Bramley 2009-09-01 09:22:39 UTC
I just downgraded to sandbox 1.7 and it has also fixed my issue with ntop.
Comment 23 Nicolás Echániz 2009-09-06 18:52:27 UTC
sandbox-2.1 does not solve this problem either.
Comment 24 Ulrich Müller gentoo-dev 2009-09-08 05:44:52 UTC
*** Bug 283924 has been marked as a duplicate of this bug. ***
Comment 25 SpanKY gentoo-dev 2009-09-14 13:55:27 UTC
*** Bug 284907 has been marked as a duplicate of this bug. ***
Comment 26 SpanKY gentoo-dev 2009-10-26 07:24:38 UTC
i know what is hanging, but i dont know why -- sandbox has internal locking now as it easily had race conditions in multithreaded applications.  that lock is obtained at the fork() function call as you could easily hit problems with threaded apps forking, but a hang there means the lock has been obtained elsewhere too and never released (which is bad), or the futex is getting screwed up by someone (which is worse).

going by the # of reports, very few people are experiencing this.  not sure it can be solved remotely.
Comment 27 Fabio Coatti 2009-10-26 07:32:11 UTC
Not sure about the fat that only few are hit by this bug. Check mplayer reported issues, IMHO they are related.

What do you mean about solving it remotely? If this can help I can try to debug this issue as I can reproduce it easily. Let me know.
Comment 28 SpanKY gentoo-dev 2009-10-26 08:07:35 UTC
i dont know what bug reports you vaguely refer to.  this issue only applies to hangs when fork() is invoked.

i either need info on how to reproduce the issue or access to a failing system.  saying "emerge foo" isnt going to work as many of the reported packages ive emerged on a bunch of different systems w/out problems.
Comment 29 Thomas Raschbacher gentoo-dev 2009-11-19 15:34:10 UTC
same thing happened to me with sandbox 2.0 ...

sandbox 2.2 fixes it for me!
yay .. thanks@toolchain ;)
Comment 30 SpanKY gentoo-dev 2010-08-15 05:58:06 UTC
unless someone can say sandbox-2.2 is broken for them, i'll assume we're ok now