From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: ARM compilation via qemu binfmt - Assertion failure Date: Thu, 8 Feb 2018 17:42:38 +0100 Message-ID: <20180208174238.2abc85dc@scratchpost.org> References: <87bmh4qrf5.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me> <87bmh3kbd9.fsf@gnu.org> <87k1vqv23v.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <87k1vqv23v.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: ng0@n0.is, guix-devel@gnu.org, bug-guix@gnu.org List-Id: bug-guix.gnu.org Hi ng0, On Tue, 06 Feb 2018 10:33:56 +0000 ng0@n0.is wrote: > recently I've read about slow but native compiling of ARM on qemu. Unfortunately, there's a (pretty reproducible) problem with it. guix-master/guix $ ./pre-inst-env guix system disk-image --system=armhf-linux -e "(@ (gnu system install) installation-os)" [... building grub-2.02 ...] phase `configure' succeeded after 821.8 seconds starting phase `patch-generated-file-shebangs' patch-makefile-SHELL: ./po/Makefile: changing `SHELL' from `/bin/sh' to `/gnu/st[...] phase `patch-generated-file-shebangs' succeeded after 14.6 seconds starting phase `build' bison -d -p grub_script_yy -b grub_script ./grub-core/script/parser.y flex -o grub_script.yy.c --header-file=grub_script.yy.h ./grub-core/script/yylex[...] bison: ../sysdeps/unix/sysv/linux/spawni.c:360: __spawnix: Assertion `ec >= 0' failed This is only fixed in glibc 2.27 (not in core-updates). The fix is: https://sourceware.org/bugzilla/show_bug.cgi?id=22273 diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index dea1650..f02ac19 100644 --- a/sysdeps/unix/sysv/linux/spawni.c +++ b/sysdeps/unix/sysv/linux/spawni.c @@ -365,9 +365,15 @@ __spawnix (pid_t * pid, const char *file, if (new_pid > 0) { ec = args.err; - assert (ec >= 0); if (ec != 0) - __waitpid (new_pid, NULL, 0); + { + /* It handles the unlikely case where the auxiliary vfork process + is killed before calling _exit or execve. */ + int status; + __waitpid (new_pid, &status, 0); + if (WIFSIGNALED (status)) + ec = 0; + } } else ec = -new_pid;