Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 421665

Summary: sys-apps/busybox-1.20.1 fails with sandboxing enabled
Product: Portage Development Reporter: Walther <>
Component: SandboxAssignee: Sandbox Maintainers <sandbox>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Walther 2012-06-17 21:11:49 UTC
When I have FEATURES="userfetch userpriv usersandbox parallel-fetch", emerging busybox fails during configuration with the following error:

>>> Emerging (1 of 1) sys-apps/busybox-1.20.1
 * busybox-1.20.1.tar.bz2 RMD160 SHA1 SHA256 size
>>> Unpacking source...
>>> Unpacking busybox-1.20.1.tar.bz2 to /var/tmp/portage/sys-apps/busybox-1.20.1/work
>>> Source unpacked in /var/tmp/portage/sys-apps/busybox-1.20.1/work
>>> Preparing source in /var/tmp/portage/sys-apps/busybox-1.20.1/work/busybox-1.20.1 ...
 * Applying busybox-1.19.0-bb.patch
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-apps/busybox-1.20.1/work/busybox-1.20.1 ...
 * Could not locate user configfile, so we will save a default one
make -j3 -s -j1 allyesconfig 
ISE:trace_main trace code assumes multiple threads are not forking

/usr/lib/portage/bin/ebuild-helpers/emake: line 25: 27635 Segmentation fault      ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"

If I change my features to FEATURES="userfetch userpriv -usersandbox", busybox compiles, but it fails at the install stage:

>>> Source compiled.
>>> Test phase [not enabled]: sys-apps/busybox-1.20.1

>>> Install busybox-1.20.1 into /var/tmp/portage/sys-apps/busybox-1.20.1/image/ category sys-apps
 * Your configuration for sys-apps/busybox-1.20.1 has been saved in 
 * /etc/portage/savedconfig/sys-apps/busybox-1.20.1 for your editing pleasure.
 * You can edit these files by hand and remerge this package with
 * USE=savedconfig to customise the configuration.
 * You can rename this file/directory to one of the following for
 * its configuration to apply to multiple versions:
 * ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/
 * [${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}]
make -j3 -s DESTDIR=/var/tmp/portage/sys-apps/busybox-1.20.1/image/ install 
ISE:trace_main trace code assumes multiple threads are not forking

/usr/lib/portage/bin/ebuild-helpers/emake: line 25: 15147 Segmentation fault      ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"

Finally, I can get busybox emerged if my features is set to: FEATURES="userfetch userpriv -sandbox -usersandbox parallel-fetch"

Looking up that particular error message, I came across this:;a=commitdiff_plain;h=6333d6e81e9f298c9bf7030b1bda9e906656d8f6

But, if I read that correctly, it means that make cannot be sandboxed if it decides to fork before exec()'ing a static library? It sounds like I shouldn't be the only one bumping into this problem (though I have no idea why it doesn't trigger in any other package that I merge). I have the default lib-sandbox configuration and changing to using MAKEOPTS="-j1" does not avoids the problem either.

Reproducible: Always

Steps to Reproduce:
1. Emerge busybox (FEATURES="userpriv usersandbox")

Actual Results:  
Compilation fails with a "ISE:trace_main trace code assumes multiple threads are not forking" error.

Expected Results:  
Package should emerge.

[ebuild   R    ] sys-apps/busybox-1.20.1  USE="ipv6 pam -livecd -make-symlinks -math -mdev -savedconfig (-selinux) -sep-usr -static"
[ebuild   R    ] sys-apps/sandbox-2.5  USE="(-multilib)" 0 kB

emerge --info:
Portage (default/linux/x86/10.0/desktop, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo-64 x86_64)
System uname: Linux-3.2.12-gentoo-64-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T9550_@_2.66GHz-with-gentoo-2.1
Timestamp of tree: Sat, 16 Jun 2012 06:15:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r1, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo Local
CFLAGS="-march=native -Os -fomit-frame-pointer -pipe -fno-var-tracking"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-march=native -Os -fomit-frame-pointer -pipe -fno-var-tracking"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr_FR fr en_GB en es_MX es"
MAKEOPTS="-j3 -s"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="3dnow X a52 aac acpi alsa avi berkdb boundschecking bzip2 cairo canna cdda cdr cjk cli cracklib crypt cscope cups curl cxx dbus dedicated dga divx divx4linux dlloader dri dts dvd dvdr dvdread emboss encode exif fam fbcon fbsplash ffmpeg fftw flac foomaticdb fortran freewnn gd gdbm gif gimp ginac gmedia gpm gstreamer gtk gtk2 gtkhtml hal hddtemp howl iconv idn imap imlib innodb inotify introspection ipv6 ithreads jabber java java6 jikes joystick jpeg lame lcms libnotify libsamplerate libwww lm_sensors lzma mad madwifi matroska mbox mmx mng modplug modules mp3 mp4 mpeg mplayer mudflap musepack ncurses nls nptl nsplugin ogg opengl openmp pam pango pcre pdf pdflib perl png ppds pppd python quicktime readline realmedia scanner schroedinger sdl session speex spell sse ssl svg svga tcpd tetex theora threads tiff timidity truetype udev udisks unicode upower usb v4l v4l2 vaapi vdpau vidix vim-syntax vorbis webkit win32codecs wma wmf wmp wxwidgets x264 x86 xcb xcomposite xface xft xine xml xml2 xorg xscreensaver xv xvid zlib" ALSA_CARDS="hda-intel" 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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" INPUT_DEVICES="evdev keyboard mouse synaptics wacom joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr_FR fr en_GB en es_MX es" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="plustek pixma" USERLAND="GNU" VIDEO_CARDS="nouveau vesa" 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"
Comment 1 SpanKY gentoo-dev 2012-11-23 06:29:38 UTC
is your make built with USE=static ?
Comment 2 Walther 2012-11-26 11:06:02 UTC
No, I don't use "static" unless needed. However, after re-emerging make with USE="static", busybox manages to compile just fine.

What does that mean, though? Should "make" be compiled with "static" in order to use sandboxing? Or is it a bug (or limitation) of the the sandbox lib?

Comment 3 SpanKY gentoo-dev 2012-11-26 17:24:29 UTC
(In reply to comment #2)

the opposite -- make should be built with USE=-static

i don't know why this is failing ... no one else has reported this before ...
Comment 4 SpanKY gentoo-dev 2015-11-13 05:38:16 UTC
is this still an issue with the latest busybox & sandbox versions ?
Comment 5 Walther 2015-11-13 14:40:57 UTC
(In reply to SpanKY from comment #4)
> is this still an issue with the latest busybox & sandbox versions ?

Nope, it compiles/installs fine now. No idea when/how/why it got fixed.

FEATURES="userfetch userpriv usersandbox parallel-fetch"
sys-apps/busybox-1.23.1-r1 ipv6 pam -debug -livecd -make-symlinks -math -mdev -savedconfig (-selinux) -sep-usr -static -syslog -systemd
sys-devel/make-4.1 nls -guile -static