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

Bug 265072

Summary: FEATURES="test" sys-libs/glibc ends in infinite loop with sys-apps/sandbox-1.8
Product: Portage Development Reporter: Nick Fortino <nfortino>
Component: SandboxAssignee: Sandbox Maintainers <sandbox>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
process tree
Proposed patch

Description Nick Fortino 2009-04-06 08:13:41 UTC
glibc tests manage to get sandbox 1.8 into an infinite loop with the output:
ISE:trace_child_signal child signal 17, code 4, status 11

As the attached build log shows, there are a couple lines of
ISE:trace_child_signal child signal 17, code 4, status 6
prior to the infinite loop. The error occurs in the x86 ABI tests for glibc.

A CTRL-c killed the process cleanly, with no related output.

Reproducible: Didn't try

Steps to Reproduce:
This was part of a:
FEATURES="test" MAKEOPTS="-j4" emerge -e world
on a system already brought up to date with the below emerge --info

one presumes
FEATURES="test" emerge -1 =sys-libs/glibc-2.9_p20081201-r2
would do the same, but I won't explicitly verify that until I have the time to kill the loop in rather soon after it begins.



Portage 2.1.6.11 (default/linux/amd64/2008.0, gcc-4.3.3-asneeded, glibc-2.9_p20081201-r2, 2.6.27-gentoo-r8 x86_64)
=================================================================
System uname: Linux-2.6.27-gentoo-r8-x86_64-Intel-R-_Core-TM-2_Extreme_CPU_X9650_@_3.00GHz-with-gentoo-2.0.0
Timestamp of tree: Sun, 05 Apr 2009 17:30:01 +0000
app-shells/bash:     4.0_p10-r1
dev-lang/python:     2.6.1-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.8
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.19.51.0.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
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="en_US.utf8"
LDFLAGS="-Wl,-O1"
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/portage/local/layman/sunrise /usr/local/portage /usr/shared_local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm iconv ipv6 isdnlog midi mmx mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl sse sse2 ssl sysfs tcpd test unicode xorg 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 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Nick Fortino 2009-04-06 08:15:12 UTC
Created attachment 187444 [details]
build.log

The build log, to be exact:
head -n -78413860 build.log | tail -f 600
leaving 6 lines of the repeated ISE.
Comment 2 SpanKY gentoo-dev 2009-04-06 08:31:57 UTC
ugh, i forgot to decode the signal info in the last message too

signal 17 is obviously SIGCHLD

code 4 is CLD_TRAPPED afaik

i'm pretty sure in this case, si_status represents a signal which means 6 is SIGABRT and 11 is SIGSEGV ... the glibc test cases do trigger such signals in the normal run of things (at least, i know SIGABRT is normal).
Comment 3 SpanKY gentoo-dev 2009-04-06 08:45:35 UTC
although none of those should cause an infinite hang.  the unhandled signal is warned about and life goes on.  can you do a `ps` (tree would be best) to see what's hung ?  and perhaps gdb it to get a backtrace (although if it's a ptraced child, you wont be able to gdb it) ?
Comment 4 Nick Fortino 2009-04-06 18:25:05 UTC
Created attachment 187470 [details]
process tree

A portion of ps -eHf, taken during the infinite hang.
Comment 5 SpanKY gentoo-dev 2009-04-08 10:38:53 UTC
looks like the assert test in question segfaults for some reason and sandbox keeps on tracing it forever

TRACE (pid=32705):trace_child_signal: got sig SIGCHLD(17): code:CLDTRAPPED(4) status:SIGTRAP(5)
TRACE (pid=32705):trace_loop: IDK:rt_sigaction(...)
TRACE (pid=32705):trace_child_signal: got sig SIGCHLD(17): code:CLDTRAPPED(4) status:SIGTRAP(5)
 = -1 (errno: 38: Function not implemented)

TRACE (pid=32705):trace_loop: IDK:tgkill(...)
TRACE (pid=32705):trace_child_signal: got sig SIGCHLD(17): code:CLDTRAPPED(4) status:SIGABRT(6)
 = 0
TRACE (pid=32705):trace_child_signal: got sig SIGCHLD(17): code:CLDTRAPPED(4) status:SIGSEGV(11)

TRACE (pid=32705):trace_loop: IDK:-1(...)
TRACE (pid=32705):trace_child_signal: got sig SIGCHLD(17): code:CLDTRAPPED(4) status:SIGSEGV(11)
 = 6
... same thing forever ...
Comment 6 Nick Fortino 2009-04-08 23:51:44 UTC
Created attachment 187744 [details, diff]
Proposed patch

This looks to be caused by the sandbox not forcefully aborting processes which send fatal signals since commit 7fab636fb34f95cb0e40fbaa13fcdf10cb297abe

Unless I missed something, the only way to get out of trace_loop is with a CLD_KILLED or a CLD_EXITED code, which will never happen if the child calls abort or segfaults. The attached patch calls sb_abort() for the signals I could quickly think of which need a forceful abort (the list is likely not exhaustive).
Comment 7 SpanKY gentoo-dev 2009-04-09 10:38:13 UTC
that would keep sandbox from hitting an infinite loop, but it wouldnt fix the underlying problem

issue is that when we're tracing, we get an event for every signal the child receives.  unless we tell the child to continue on, the kernel will block delivery of that signal to the child.

http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commitdiff;h=0c9500ea1a6dafdb5167c2d11ad47c8fcfff3141