Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 439574 - sys-apps/coreutils: tests set low VM limit (ulimit) which crashes due to higher memory usage w/sandbox active
Summary: sys-apps/coreutils: tests set low VM limit (ulimit) which crashes due to high...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2012-10-24 21:24 UTC by Toralf Förster
Modified: 2017-11-06 16:21 UTC (History)
4 users (show)

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


Attachments
sys-apps:coreutils-8.20:20121024-200729.log.gz (sys-apps:coreutils-8.20:20121024-200729.log.gz,94.96 KB, application/x-gzip)
2012-10-24 21:24 UTC, Toralf Förster
Details
chroot into an uml image (chr_uml.sh,1.86 KB, text/plain)
2012-12-03 19:12 UTC, Toralf Förster
Details
build log (sys-apps:coreutils-8.20:20121204-174520.log.gz,96.46 KB, application/x-gzip)
2012-12-04 18:08 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2012-10-24 21:24:35 UTC
Created attachment 327346 [details]
sys-apps:coreutils-8.20:20121024-200729.log.gz

I've an unstable Gentoo image w/ glibc-2.16 and gcc-4.7.2 to play with user mode linux. Usually I do chroot into it to update it. Today I got during upgrade of coreutils a lot of lines like :

...
>>> Jobs: 0 of 5 complete, 1 running                Load avg: 5.67, 6.63, 5.99 (null)*(null) ../../sandbox-2.6/libsandbox/libsandbox.c:resolve_path():184: failure (Cannot allocate memory):
 (null)*(null) malloc(8192)
 (null)*(null) ../../sandbox-2.6/libsbutil/sb_write_fd.c:sb_copy_file_to_fd():22: failure (Cannot allocate memory):
 (null)*(null) malloc(4096)
 (null)*(null) ../../sandbox-2.6/libsbutil/sb_write_fd.c:sb_copy_file_to_fd():22: failure (Cannot allocate memory):
 (null)*(null) malloc(4096)
...
(null)*(null) malloc(4096)
 (null)*(null) ../../sandbox-2.6/libsbutil/sb_write_fd.c:sb_copy_file_to_fd():22: failure (Cannot allocate memory):
 (null)*(null) malloc(4096)
>>> Installing (1 of 5) sys-apps/coreutils-8.20
>>> Emerging (2 of 5) app-admin/eselect-1.3.3
...


but the emerge continued. Within /var/log/messages of my host system I got :

...
2012-10-24T22:16:43.010+02:00 n22 kernel: sh[19019]: segfault at bfbc7f94 ip b759705d sp bfbc7f90 error 6 in libc-2.16.so[b7553000+1a2000]
2012-10-24T22:17:17.468+02:00 n22 kernel: sh[26502]: segfault at bfed9fa4 ip b750d05d sp bfed9fa0 error 6 in libc-2.16.so[b74c9000+1a2000]
2012-10-24T22:18:06.676+02:00 n22 kernel: sh[683]: segfault at bfcf3fe4 ip b74ef05d sp bfcf3fe0 error 6 in libc-2.16.so[b74ab000+1a2000]
2012-10-24T22:18:17.233+02:00 n22 kernel: sh[2690]: segfault at bfdabf84 ip b75a605d sp bfdabf80 error 6 in libc-2.16.so[b7562000+1a2000]
2012-10-24T22:20:43.806+02:00 n22 kernel: EXT2-fs (loop1): (no)user_xattr optionsnot supported
2012-10-24T22:20:43.989+02:00 n22 kernel: EXT2-fs (loop2): (no)user_xattr optionsnot supported
Comment 1 Jeroen Roovers gentoo-dev 2012-10-25 15:45:27 UTC
Please post your `emerge --info' output in a comment.
Comment 2 Toralf Förster gentoo-dev 2012-10-25 16:28:06 UTC
(In reply to comment #1)
> Please post your `emerge --info' output in a comment.

tfoerste@n22 ~ $ sudo ~/workspace/bin/chr_uml.sh /home/tfoerste/virtual/uml/gentoo_unstable n22 ~ # emerge --info coreutils
Portage 2.1.11.30 (default/linux/x86/10.0, gcc-4.7.2, glibc-2.16.0, 3.6.3 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.6.3-i686-Intel-R-_Core-TM-_i5-2540M_CPU_@_2.60GHz-with-gentoo-2.2
Timestamp of tree: Wed, 24 Oct 2012 19:45:01 +0000
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.9-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.2
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.69
sys-devel/automake:       1.12.4
sys-devel/binutils:       2.23
sys-devel/gcc:            4.7.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo toralf
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going=y --nospinner --tree --deep --quiet-build"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl apache2 berkdb bzip2 cli cracklib crypt cups cxx dri fam fastbuild gdbm gmp gpm iconv ipv6 logrotate mmx modules mudflap mysql mysqli ncurses nls nptl openmp pam pcre pppd readline session sse sse2 sse3 ssl ssse3 tcpd threads unicode userlocales webmail x86 xml 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="access actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi compat 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 socache_shmcb speling status unique_id unixd 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" PHP_TARGETS="php5-4" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/coreutils-8.20 was built with the following:
USE="acl gmp nls test -caps (-selinux) -static -vanilla -xattr"
Comment 3 Greg Turner 2012-11-04 18:46:33 UTC
Encountered similar messages during an emerge of openoffice.  My portage has $FEATURES =~ fail-clean and $EMERGE_DEFAULT_OPTS =~ --jobs so not a ton of postmortem I can do.  Note that don't have any gcc4.7 installed:

$ qlist -ICv sys-devel/gcc
sys-devel/gcc-4.5.4
sys-devel/gcc-4.6.3
sys-devel/gcc-config-1.7.3

I have a reasonable amount of virtual RAM available:

$ free -h
             total       used       free     shared    buffers     cached
Mem:          7.8G       7.2G       633M         0B       257M       2.3G
-/+ buffers/cache:       4.6G       3.2G
Swap:          13G       784M        13G

my emerge --info --verbose are too long to post, but here are some exerpted highlights:

Portage 2.2.0_alpha142 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.3, glibc-2.16.0, 3.6.2-gentoo-gmt-02 x86_64)
=================================================================
System uname: Linux-3.6.2-gentoo-gmt-02-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.2
Timestamp of tree: Sat, 03 Nov 2012 07:45:01 +0000
ld GNU ld (GNU Binutils) 2.23
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.8 [enabled]
app-shells/bash:          4.2_p39
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/ccache:          3.1.8
dev-util/cmake:           2.8.9-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.2
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.4
sys-devel/binutils:       2.23
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.16.0app-shells/bash:          4.2_p39
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/ccache:          3.1.8
dev-util/cmake:           2.8.9-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.2
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.4
sys-devel/binutils:       2.23
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.16.0
ABI="amd64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode multilib"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -g -mtune=native -march=native"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CXXFLAGS="-O2 -pipe -g -mtune=native -march=native"
DEFAULT_ABI="amd64"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--verbose --with-bdeps=y --autounmask --ask-enter-invalid --load-average=10 --jobs=4 --fail-clean=y --keep-going=y"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg candy ccache config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles installsources merge-sync news parallel-fetch parallel-install prelink-checksums preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-filter unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GCC_SPECS=""
KERNEL="linux"
LANG="en_US.UTF-8"
LANGUAGE=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x86="-m elf_i386"
LIBDIR_amd64="lib64"
LIBDIR_x86="lib32"
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
LINGUAS="en en_US"
MAKEOPTS="-j5 -l10"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev)"
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/opt/vmware/bin"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_IONICE_COMMAND="ionice -c 3 -p ${PID}"
PORTAGE_NICENESS="10"
PORTAGE_OVERRIDE_EPREFIX=""
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PRELINK_PATH_MASK="/opt:/usr/lib64/vmware:/usr/lib64/klibc:/usr/lib64/libfreebl3.so:/usr/lib64/libnssdbm3.so:/usr/lib64/libsoftokn3.so:/opt/bin/skype"
PYTHON_TARGETS="python3_2 python2_7"
QMAKESPEC="linux-g++"
ROOT="/"
SHELL="/bin/bash"
SUDO_COMMAND="/usr/bin/emerge --info --verbose"
SUDO_GID="1000"
SUDO_UID="1000"
SUDO_USER="greg"
SYMLINK_LIB="yes"
USE="X a52 aac aalib acl acpi alsa amd64 amr bash-completion bazaar berkdb bluetooth branding bs2b bzip2 cairo caps cdda cddb cdr chm cleartype cli consolekit corefonts cracklib crypt cscope css cups custom-optimization cvs cxx darcs dbus declarative desktopglobe development directfb djvu doc dri drm dts dv dvd dvdr dvi ebook emboss encode epydoc exif fam fat fbcon fbcondecor festival ffmpeg firefox flac fontconfig fortran g711 g722 g7221 gallium gconf gcrypt gdbm ggi gif git glibc-omitfp gnome gnome-keyring gnutls gphoto2 gpm gsm gstreamer gtk h224 h281 h323 handbook hashstyle hires-icons hpijs hscolour iax iconv id3 idn ieee1394 ilbc ipv6 jabber jemalloc jpeg jpeg2k kde kerberos kipi latex lcdfilter lcms libcaca libnotify libsamplerate lv2 lzma lzo mad man mercurial mms mmx mng modplug modules mono mp3 mp4 mpeg mudflap multilib musepack ncurses nls nptl ntfs offensive ogg okteta openexr opengl openmp optimized-qmake osmesa pam pam_krb5 pam_ssh pango pch pcre pdf phonon plasma png policykit ppds pppd private-headers pulseaudio python3 qalculate qt-faststart qt3 qt3support qt4 qwt readline remote-access rtmp samba scanner sdl semantic-desktop sensord session sipim sndfile soundex speex spell srtp sse sse2 ssl ssse3 startup-notification static-ppds subversion svg synaptics syslog system-sqlite t1lib taglib tcpd theora threads tiff tordns truetype type1 udev udev-acl udisks unicode unlock-notify upower usb vaapi vdpau vhosts vim-syntax vorbis vpx vxml wav wavpack webkit2 windeco wma-fixed wmf wxwidgets x264 xattr xcap xcb xchatdccserver xcomposite xfs xinerama xml xmp xorg xrandr xscreensaver xv xvid xvmc zlib" \
[snip!] \
ELIBC="glibc" \
[snip!] \
KERNEL="linux" \
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" \
LINGUAS="en en_US" \
[snip!] \
PYTHON_TARGETS="python3_2 python2_7" \
USERLAND="GNU" \
[snip!]
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"

Also note my /etc/portage/env/app-office/libreoffice:

pre_pkg_setup() {
        elog 
        elog "bashrc (via /etc/portage/env/app-office/libreoffice)"
        elog "set CFLAGS/CXXFLAGS to exclude any of:"
        elog
        elog "    -g -g[0-9] --ggdb -ggdb[0-9] -O[0-9]"
        elog
        elog "and to include:"
        elog
        elog "    -Os"
        elog
        elog "and set FEATURES to exclude:"
        elog
        elog "    splitdebug"
        elog
        CFLAGS="$( echo ${CFLAGS} | sed -e 's/\(^\|[[:space:]]\)\(-ggdb[[:digit:]]\?\|-g[[:digit:]]\?\|-O[[:digit:]]\)\($\|[[:space:]]\)/ /g' ) -Os"
        CXXFLAGS="${CFLAGS}"
        FEATURES="$(echo ${FEATURES} | sed -e 's/\(^\|[[:space:]]\)splitdebug\($\|[[:space:]]\)/ /' )"
        elog "new FEATURES is \"${FEATURES}\""
        elog "new CFLAGS is \"${CFLAGS}\""
        elog
}

which I do to keep the build from consuming outrageous amounts of resources.
Comment 4 Greg Turner 2012-11-04 19:05:48 UTC
just noticed this after seeing thermal throttling messages in dmesg:

$ sudo sensors

radeon-pci-0100
Adapter: PCI adapter
temp1:        +64.0�C  

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +98.0�C  (high = +82.0�C, crit = +100.0�C)
Core 1:       +95.0�C  (high = +82.0�C, crit = +100.0�C)
Core 2:       +85.0�C  (high = +82.0�C, crit = +100.0�C)
Core 3:       +81.0�C  (high = +82.0�C, crit = +100.0�C)

--

Holy smokes!

So the above-mentioned results should be taken with a grain of salt until I figure out what has gone wrong with my thermal dissipation (in the meantime, I'm piling frozen veggies into my rack while I wait for some builds to finish :) )
Comment 5 SpanKY gentoo-dev 2012-12-03 18:45:22 UTC
(In reply to comment #0)

how much memory have you given to your user mode linux ?  gnulib (which coreutils includes) has a particular test that likes to see what the limits of getcwd() are and that can involve doing an extremely deep `while mkdir x && cd x; do :; done` test ...
Comment 6 Toralf Förster gentoo-dev 2012-12-03 19:12:46 UTC
Created attachment 331340 [details]
chroot into an uml image

(In reply to comment #5)
> (In reply to comment #0)
> 
> how much memory have you given to your user mode linux ?  gnulib (which
> coreutils includes) has a particular test that likes to see what the limits
> of getcwd() are and that can involve doing an extremely deep `while mkdir x
> && cd x; do :; done` test ...

I did not started that image, I just chrooted into it to using the attached script (b/c due to the performance impact I emerge all package in a chrooted way rather than starting the image and then running emerge).
Therefore I typical call is :

$> sudo ~/workspace/bin/chr_uml.sh -r /home/tfoerste/virtual/uml/n22stab4
n22 ~ # eix-update -q && emerge --update @world --deep --newuse --changed-use --with-bdeps=y --verbose
n22 ~ exit
$>


My system (stable Gentoo) has 8 GB RAM FWIW.
Comment 7 SpanKY gentoo-dev 2012-12-04 00:30:49 UTC
(In reply to comment #6)

ok, a simple chroot shouldn't be a problem

does the error show up when using sandbox-2.5 ?  2.6 has a bug where it always writes the output to /dev/tty so it's hard to trace back where the error is coming from.
Comment 8 Toralf Förster gentoo-dev 2012-12-04 16:41:09 UTC
(In reply to comment #7)
> does the error show up when using sandbox-2.5 ?  2.6 has a bug where it
well -it is fully unstable, so theres sanbox-2.6 :

n22 ~ # eix -I sandbox
[I] sys-apps/sandbox
     Available versions:  1.6-r2 2.3-r1 2.4 2.5 (~)2.6 {multilib}
     Installed versions:  2.6(06:22:12 PM 08/04/2012)(-multilib)
     Homepage:            http://www.gentoo.org/
     Description:         sandbox'd LD_PRELOAD hack
Comment 9 Toralf Förster gentoo-dev 2012-12-04 18:08:15 UTC
Created attachment 331418 [details]
build log

just FWIW, at a user mode linux image (again: chrooted - nearly identical world file, just stable Gentoo + gcc-4.6.2) I get this :

FAIL: tests/df/total-unprocessed.sh 
FAIL: tests/du/long-from-unreadable.sh
FAIL: tests/ls/statfree-color.sh
FAIL: tests/du/bind-mountdir-cycle.sh
FAIL: tests/df/total-unprocessed.sh (exit: 1)
FAIL: tests/du/long-from-unreadable.sh (exit: 99)
FAIL: tests/ls/stat-free-color.sh (exit: 1)
FAIL: tests/du/bind-mount-dir-cycle.sh (exit: 1)
FAIL: test-fdutimensat    
FAIL: test-utimensat     
FAIL: test-fdutimensat (exit: 134)
FAIL: test-utimensat (exit: 134)
Comment 10 Toralf Förster gentoo-dev 2012-12-20 19:48:16 UTC
HHm, an "ebuild ... test" doesn't gave those message, so the issue is probably related to sandbox itself. Therefore I tried to emerge that package w/o sandbox but this doesn't work (any longer ?) : 

$ cat /etc/portage/env/nosandbox 
FEATURES="-nosandbox"

$ grep sandbox /etc/portage/package.env/misc
sys-apps/coreutils                                      nosandbox
Comment 11 Toralf Förster gentoo-dev 2012-12-20 20:12:21 UTC
(In reply to comment #10)
> $ cat /etc/portage/env/nosandbox 
> FEATURES="-nosandbox"
ick - double-negate pitfall

ok with 
FEATURES="-sandbox" I do not see those message (of course the test case fails too).
Comment 12 SpanKY gentoo-dev 2012-12-21 05:17:19 UTC
dare i ask ... is this because of your ulimit setting (bug 445636) ?
Comment 13 Toralf Förster gentoo-dev 2012-12-21 10:25:27 UTC
(In reply to comment #12)
> dare i ask ... is this because of your ulimit setting (bug 445636) ?

ofc - issue still exists with "ulimit -s 65535"
Comment 14 SpanKY gentoo-dev 2012-12-21 17:26:33 UTC
(In reply to comment #13)

i think you underestimate what gnulib in coreutils does to sandbox.  set your stack to unlimited and try again.
Comment 15 Toralf Förster gentoo-dev 2012-12-21 23:38:54 UTC
(In reply to comment #14)
> set your stack to unlimited and try again.

ok :

# ulimit -s unlimited

# ulimit -s
unlimited


issue still happens
Comment 16 Ryan Hill (RETIRED) gentoo-dev 2014-01-11 04:08:36 UTC
I'm seeing the same thing here with a standard setup.

 * ../../sandbox-2.6/libsandbox/libsandbox.c:resolve_path():184: failure (Cannot allocate memory):
 * malloc(8192)
 * ../../sandbox-2.6/libsbutil/sb_write_fd.c:sb_copy_file_to_fd():22: failure (Cannot allocate memory):
 * malloc(4096)
[...]
 * ../../sandbox-2.6/libsbutil/sb_write_fd.c:sb_copy_file_to_fd():22: failure (Cannot allocate memory):
 * malloc(4096)
many-dir-entries-vs-OOM.sh: skipped test: this shell lacks ulimit support

also
tests/misc/cut-huge-range.sh
tests/misc/csplit-heap.sh
tests/misc/head-c.sh
tests/misc/printf-surprise.sh
tests/split/line-bytes.sh
tests/dd/no-allocate.sh

The traces all look like this:

+ require_ulimit_v_
+ local ulimit_works=yes
+ local vm
+ case $(printenv LD_PRELOAD) in
++ printenv LD_PRELOAD
+ vm=10000
+ ulimit_works=no
+ test no = no
+ skip_ 'this shell lacks ulimit support'


Portage 2.2.8 (default/linux/amd64/13.0/developer, gcc-4.8.2, glibc-2.18, 3.12.7-gentoo x86_64)
=================================================================
System uname: Linux-3.12.7-gentoo-x86_64-Intel-R-_Core-TM-_i7-3920XM_CPU_@_2.90GHz-with-gentoo-2.2
KiB Mem:    32596384 total,  19425552 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of tree: Sat, 11 Jan 2014 00:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.9, 2.7.6, 3.2.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.1-r3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.14.1
sys-devel/binutils:       2.24-r1
sys-devel/gcc:            4.1.2, 4.2.4-r1, 4.5.4, 4.6.4, 4.7.3-r1, 4.7.4_pre9999::toolchain, 4.8.2_pre9999::toolchain, 4.8.2-r1, 4.9.0_pre9999::toolchain
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.12 (virtual/os-headers)
sys-libs/glibc:           2.18
Repositories: gentoo kde crossdev local gcc-porting toolchain dirtyepic
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -g -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="-O2 -march=native -g -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
FCFLAGS="-O2 -march=native -g -pipe"
FEATURES="assume-digests binpkg-logs ccache cgroup clean-logs compressdebug distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=native -g -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12 V=1"
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/kde /home/dirtyepic/crossdev /home/dirtyepic/overlay /home/dirtyepic/svn/gcc-porting /home/dirtyepic/svn/toolchain /home/dirtyepic/svn/dirtyepic"
Comment 17 NP-Hardass gentoo-dev 2015-08-06 02:04:28 UTC
I'm also seeing this on a standard setup.
Comment 18 SpanKY gentoo-dev 2015-09-20 08:24:23 UTC
it's pretty easy to reproduce:
$ sandbox
$ ulimit -v 20
$ ls
<lots of failures>

can people who see these failures post `ulimit -a` ?  i'm assuming this is just the ulimit settings in coreutils itself causing troubles rather than people setting low limits in their normal environment.
Comment 19 Toralf Förster gentoo-dev 2015-09-20 09:27:27 UTC
(In reply to SpanKY from comment #18)
> it's pretty easy to reproduce:
> $ sandbox
> $ ulimit -v 20
> $ ls
> <lots of failures>
> 
> can people who see these failures post `ulimit -a` ?  i'm assuming this is
> just the ulimit settings in coreutils itself causing troubles rather than
> people setting low limits in their normal environment.

Sandboxed process killed by signal: Segmentation fault
Cleaning up sandbox process
============================= Gentoo path sandbox ==============================
The protected environment has been shut down.
--------------------------------------------------------------------------------
tfoerste@t44 ~/.mplayer $ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 46732
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 46732
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Comment 20 Ryan Hill (RETIRED) gentoo-dev 2015-09-20 09:31:27 UTC
caribou ~ $ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127068
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 127068
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Comment 21 Toralf Förster gentoo-dev 2015-09-20 09:56:14 UTC
(In reply to Toralf Förster from comment #19)
> Sandboxed process killed by signal: Segmentation fault

FWIW this correlates to :

Sep 20 11:55:36 t44 kernel: bash[12562]: segfault at 3b12c755e80 ip 000002e97d6aa5a4 sp 000003b12c755e80 error 6 in libc-2.20.so[2e97d661000+1a1000]
Comment 22 Toralf Förster gentoo-dev 2016-01-31 18:27:03 UTC
4 years old ...
Comment 23 SpanKY gentoo-dev 2016-02-21 09:11:44 UTC
i don't think there's much to expect/do here w/sandbox.  we can just patch the coreutils tests to use a higher ulimit when they run.
Comment 24 Mart Raudsepp gentoo-dev 2017-03-09 22:54:28 UTC
So can we get something in? This still fails with coreutils-8.27 unless ulimit -s is increased manually first. Test failures in core software is rather worrysome
Comment 25 SpanKY gentoo-dev 2017-03-10 06:57:05 UTC
(In reply to Mart Raudsepp from comment #24)

if you're setting the stack low and it happens to crash coreutils tests doesn't make it a coreutils problem.  it just happens to hit there.  i don't think this is something coreutils should be dealing with, or even sandbox for that matter.

looking closer at the tests, the sandbox malloc warnings don't break things.  they come from the dynamic ulimit testing in the coreutils code where it tries to find a safe lower -v bound (init.cfg:get_min_ulimit_v_).  sandbox spews OOM errors there.  once coreutils finds a bound that is safe, it runs the actual test, and sandbox doesn't complain anymore.

at this point, we probably want to change sandbox to be less chatty.  failures in accessing memory/paths are pretty unlikely anymore to be due to bad sandbox code.
Comment 26 Larry the Git Cow gentoo-dev 2017-11-06 16:21:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0edff67f453a7509c08fce538d3da9c947daa433

commit 0edff67f453a7509c08fce538d3da9c947daa433
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2017-11-06 16:20:43 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2017-11-06 16:20:57 +0000

    sys-apps/coreutils: Rev bump to address multiple test failures
    
    - Running test suite with FEATURES=usersandbox is no longer supported
      due to various sandbox issues. (bug #413621, #439574, #629660)
    
    - Due to sandbox failures previously disabled tests
      re-enabled. (bug #415487)
    
    - tests/ls/readdir-mountpoint-inode test failure fixed. (bug #353164)
    
    - "caps" USE flag description more specified. (bug #617702
    
    - Tools/programs/libraries used in test suite now listed in
      DEPEND="test? (...)" which requires re-keywording for some
      architectures.
    
    Bug: https://bugs.gentoo.org/413621
    Bug: https://bugs.gentoo.org/439574
    Bug: https://bugs.gentoo.org/629660
    Bug: https://bugs.gentoo.org/415487
    Closes: https://bugs.gentoo.org/353164
    Closes: https://bugs.gentoo.org/617702
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 sys-apps/coreutils/Manifest                 |   1 +
 sys-apps/coreutils/coreutils-8.28-r1.ebuild | 210 ++++++++++++++++++++++++++++
 sys-apps/coreutils/metadata.xml             |   1 +
 3 files changed, 212 insertions(+)}