*** uWSGI compiling embedded plugins *** [thread 8][x86_64-pc-linux-gnu-gcc -pthread] plugins/ping/ping_plugin.o /var/tmp/portage/www-servers/uwsgi-2.0.18/temp/environment: line 6614: 27 Segmentation fault python uwsgiconfig.py --build gentoo * ERROR: www-servers/uwsgi-2.0.18::gentoo failed (compile phase): * building uwsgi failed * ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1-systemd_abi32+64_20190306-071626 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-7.3.1 [2] x86_64-pc-linux-gnu-8.3.0 * Available Python interpreters, in order of preference: [1] python3.6 [2] python2.7 (fallback) Available Ruby profiles: [1] ruby24 (with Rubygems) * [2] ruby25 (with Rubygems) [3] ruby26 (with Rubygems) Available Rust versions: [1] rust-1.32.0 * [2] rust-bin-1.32.0 emerge -qpvO www-servers/uwsgi [ebuild N ] www-servers/uwsgi-2.0.18 USE="caps embedded pcre perl routing ssl xml -apache2 -cgi -debug -expat -go -jemalloc -json -libressl -lua -mono -php -pypy -python -python_asyncio -python_gevent -ruby (-selinux) -yajl -yaml -zeromq" PHP_TARGETS="php5-6 php7-1 -php7-2 -php7-3" PYTHON_TARGETS="python2_7 python3_6 -pypy -python3_4 -python3_5 -python3_7" RUBY_TARGETS="ruby24 ruby25 -ruby23" UWSGI_PLUGINS="cache carbon cheaper_busyness corerouter fastrouter http logfile logsocket mongodblog nagios ping rawrouter redislog router_basicauth router_cache router_expires router_hash router_http router_memcached router_metrics router_redirect router_redis router_rewrite router_static router_uwsgi rpc rrdtool rsyslog signal spooler sslrouter symcall syslog transformation_chunked transformation_gzip transformation_offload transformation_tofile ugreen zergpool -alarm_curl -alarm_xmpp -clock_monotonic -clock_realtime -curl_cron -dumbloop -echo -emperor_amqp -emperor_pg -emperor_zeromq -forkptyrouter -geoip -graylog2 -ldap -legion_cache_fetch -logcrypto -logpipe -notfound -pam -rados -router_access -router_radius -router_spnego -router_xmldir -sqlite -ssi -stats_pusher_statsd -systemd_logger -transformation_toupper -tuntap -webdav -xattr -xslt -zabbix"
Created attachment 568588 [details] emerge-info.txt
Created attachment 568590 [details] emerge-history.txt
Created attachment 568592 [details] environment
Created attachment 568594 [details] etc.portage.tbz2
Created attachment 568596 [details] logs.tbz2
Created attachment 568598 [details] temp.tbz2
Created attachment 568600 [details] www-servers:uwsgi-2.0.18:20190311-025329.log
Works with sys-apps/sandbox 2.14 but not 2.15. Looks like this is the only commit between them: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=f3e51a930312422cc78b693a247b7c5704ac90a2
Reproduced locally. I'll have a look and get a backtrace.
Trigger: uwsgi does something very unusual: it runs execve() syscall from a separate thread similar to vfork() but done manually(?) via clone() without CLONE_VM|CLONE_THREAD. A few examples from strace are: 8810 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fba46f66a10) = 8827 8827 execve("/bin/sh", ["/bin/sh", "-c", "pcre-config --libs"], 0x7ffdb82b33b0 /* 36 vars */ <unfinished ...> 8827 <... execve resumed>) = 0 8827 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f93dd430850) = 8828 8828 execve("/usr/bin/uname", ["uname", "-s"], 0x560a14ae7bc0 /* 36 vars */) = 0 Breakage mechanics: Lack of CLONE_VM will introduce loads/stores of 'environ' global variable in sandbox's execvp() (I think) wrapper. Lack of CLONE_THREAD allows you to run execv*() syscalls in standalone threads sharing address space. I don't know if uwsgi explicitly imposes a limitation on mutation of global state. The setup looks very fragile. But not unreasonable. Possible plan for a fix: On linux we can work it around in sandbox by emulating execvp(ARGS) via execvpe(ARGS, <sandbox_srafter_env>). execvpe() is non-standard (available on _GNU_SOURCE) Workarounds: Build single-threaded (equivalent of MAKEOPTS=-j1) or disable sandbox in uwsgi ebuild.
*** Bug 690450 has been marked as a duplicate of this bug. ***
can't reproduce with sys-apps/sandbox-2.18 so maybe sandbox fixed things too... and no user reported any error, closing unless it comes back nevertheless I want to both apologize and salute the impressive debug slyfox if this one comes back, I'll know what to do thanks to you!