Summary: | emulators/qemu-user-static: low RLIMIT_VMEM hangs qemu due to GSlice allocation failure | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> |
Component: | Individual Port(s) | Assignee: | Jan Beich <jbeich> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | emulation, franco, freebsd, kevans, marklmi26-fbsd, mikael, nekoprog, vishwin |
Priority: | Normal | Keywords: | needs-patch, regression |
Version: | Latest | Flags: | bugzilla:
maintainer-feedback?
(emulation) |
Hardware: | arm | ||
OS: | Any | ||
URL: | https://lists.freebsd.org/pipermail/freebsd-ports/2017-December/112090.html | ||
Bug Depends on: | |||
Bug Blocks: | 231346 |
Description
Jan Beich
![]() ![]() qemu-user-static-2.9.94.g20171023 is not affected. Can someone help bisecting ports r456518? - mips64 isn't affected. I guess, only armv6/armv7 and aarch64 are. - static binaries aren't affected A commit references this bug: Author: jbeich Date: Sun Dec 31 02:18:15 UTC 2017 New revision: 457665 URL: https://svnweb.freebsd.org/changeset/ports/457665 Log: devel/libunistring: temporarily skip ENOMEM check for printf configure:25883: checking whether printf survives out-of-memory conditions configure:26055: /nxb-bin/usr/bin/cc -o conftest -O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing -DLIBICONV_PLUG -D_THREAD_SAFE conftest.c >&5 configure:26058: $? = 0 ***MEMORY-ERROR***: [67280]: GSlice: failed to allocate 496 bytes (alignment: 512): Cannot allocate memory PR: 224740 Reported by: Mark Millard (via ports@ list, for armv7) Approved by: portmgr blanket Changes: head/devel/libunistring/Makefile (In reply to commit-hook from comment #3) The freebsd-arm list also has my follow-ups, including for aarch64. See in: https://lists.freebsd.org/pipermail/freebsd-arm/2017-December/thread.html [ freebsd-ports is rejecting submittals from an intermediate server now and likely for a half a day or so. One send did not make it through to freebsd-ports but did show up on freebsd-arm .] I don't have the problem on my machine, is it limited to poudriere? root@12armv6: ~ env G_SLICE=always-malloc ./a.out root@12armv6: ~ echo $? 0 (In reply to mikael.urankar from comment #5) > I don't have the problem on my machine, is it limited to poudriere? Probably. I haven't tried outside of poudriere jail as setting up an environment to load dynamically linked programs via qemu-user-static is tricky. (In reply to mikael.urankar from comment #6) > root@12armv6: ~ env G_SLICE=always-malloc ./a.out G_SLICE=always-malloc disables Glib slice allocator. Try without i.e., simply run ./a.out with default environment variables. (In reply to Jan Beich from comment #7) It's the same: root@12armv6: ~ env G_SLICE=always-malloc ./a.out root@12armv6: ~ echo $? 0 root@12armv6: ~ ./a.out root@12armv6: ~ echo $? 0 I have the problem on aarch64 though. (In reply to mikael.urankar from comment #8) Your prompt shows armv6 instead of armv7. Is that real? (My 32-bit context really was armv7: cortex-a7 handled as such.) (In reply to Mark Millard from comment #9) Also: What are your versions? Mine are: # qemu-arm-static --version qemu-arm version 2.11.50 Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers usage: qemu-arm [options] program [arguments...] BSD CPU emulator (compiled for arm emulation) . . . # qemu-aarch64-static --version qemu-aarch64 version 2.11.50 Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers usage: qemu-aarch64 [options] program [arguments...] BSD CPU emulator (compiled for aarch64 emulation) . . . (In reply to Mark Millard from comment #9) Yes it's an armv6 jail, I don't have an armv7 jail ready right now. I'm using qemu-user-static-2.11.50.g20171215_1, same version as yours. A commit references this bug: Author: antoine Date: Sun Jan 14 21:10:59 UTC 2018 New revision: 459001 URL: https://svnweb.freebsd.org/changeset/ports/459001 Log: Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout MFH: 2018Q1 With hat: portmgr Changes: head/devel/m4/Makefile A commit references this bug: Author: antoine Date: Sun Jan 14 22:06:20 UTC 2018 New revision: 459006 URL: https://svnweb.freebsd.org/changeset/ports/459006 Log: MFH: r459001 Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout With hat: portmgr Changes: _U branches/2018Q1/ branches/2018Q1/devel/m4/Makefile A commit references this bug: Author: antoine Date: Mon Jan 15 07:35:04 UTC 2018 New revision: 459020 URL: https://svnweb.freebsd.org/changeset/ports/459020 Log: Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout MFH: 2018Q1 With hat: portmgr Changes: head/devel/bison/Makefile A commit references this bug: Author: antoine Date: Mon Jan 15 08:18:50 UTC 2018 New revision: 459022 URL: https://svnweb.freebsd.org/changeset/ports/459022 Log: MFH: r459020 Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout With hat: portmgr Changes: _U branches/2018Q1/ branches/2018Q1/devel/bison/Makefile Which commit contains the fix? I can still reproduce and so does pkg-fallout@: http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/coreutils-8.28.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/gnuls-8.22_1.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/gzip-1.8.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/idutils-4.6_2.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/lftp-4.8.3.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/metalog-3_1,1.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/nano-2.9.2.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/pspp-1.0.1_1.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/rcs-5.9.4.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/recutils-1.7_2.log http://beefy8.nyi.freebsd.org/data/head-armv6-default/p460549_s328647/logs/errors/zile-2.4.14_1.log (In reply to Jan Beich from comment #16) Huh, I thought this was fixed. I'm building an aarch64 jail and I'll take a look tonight. A commit references this bug: Author: antoine Date: Sat Mar 17 09:14:10 UTC 2018 New revision: 464772 URL: https://svnweb.freebsd.org/changeset/ports/464772 Log: Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout MFH: 2018Q1 Changes: head/databases/recutils/Makefile head/misc/gnuls/Makefile A commit references this bug: Author: antoine Date: Sat Mar 17 09:15:46 UTC 2018 New revision: 464773 URL: https://svnweb.freebsd.org/changeset/ports/464773 Log: MFH: r464772 Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout Changes: _U branches/2018Q1/ branches/2018Q1/databases/recutils/Makefile branches/2018Q1/misc/gnuls/Makefile A commit references this bug: Author: antoine Date: Sat Mar 17 09:25:04 UTC 2018 New revision: 464774 URL: https://svnweb.freebsd.org/changeset/ports/464774 Log: Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallou MFH: 2018Q1 Changes: head/sysutils/coreutils/Makefile A commit references this bug: Author: antoine Date: Sat Mar 17 09:26:20 UTC 2018 New revision: 464776 URL: https://svnweb.freebsd.org/changeset/ports/464776 Log: MFH: r464774 Skip ENOMEM check for printf when building with qemu, this makes configure hang PR: 224740 Reported by: pkg-fallout Changes: _U branches/2018Q1/ branches/2018Q1/sysutils/coreutils/Makefile (In reply to commit-hook from comment #21) Has the evidence accumulated to the point of this bugzilla progressing past "In Progress" status? If you don't care about the correctness of the emulation of *rlimit* you can use this patch. --- bsd-user/syscall_defs.h.orig 2018-05-28 19:38:34.012737000 +0200 +++ bsd-user/syscall_defs.h 2018-05-28 19:43:01.994915000 +0200 @@ -295,7 +295,8 @@ struct target_freebsd_kevent { /* * sys/resource.h */ -#if defined(__FreeBSD__) +/* qemu crashes with TARGET_RLIM_INFINITY == RLIM_INFINITY */ +#if false && defined(__FreeBSD__) #define TARGET_RLIM_INFINITY RLIM_INFINITY #else #define TARGET_RLIM_INFINITY ((abi_ulong)-1) TARGET_RLIM_INFINITY == RLIM_INFINITY was introduced with this commit: https://github.com/seanbruno/qemu-bsd-user/commit/2c91d727cd1879c382e03b447ca9947aec3bf951 as to why it crashes now and not before: ENOCLUE (In reply to mikael.urankar from comment #23) this hack doesn't work A commit references this bug: Author: koobs Date: Tue Dec 18 11:19:55 UTC 2018 New revision: 487744 URL: https://svnweb.freebsd.org/changeset/ports/487744 Log: editors/nano: Fix build (configure) on ARM The arm package builder when building this port, fails with the following error during configure: checking whether printf survives out-of-memory conditions... =>> Killing runaway build after 21600 seconds with no output The root cause is described in bug 224740, which has not been resolved yet: low RLIMIT_VMEM hangs qemu due to GSlice allocation failure In the meantime, this change applies a known workaround which has already been applied in several ports, which disables the specific (hanging) configure check, if the build is run with qemu emulation. PR: 231346, 224740 Reported by: many Approved by: portmgr (blanket: build fix, jfi) MFH: 2018Q4 Changes: head/editors/nano/Makefile A commit references this bug: Author: jbeich Date: Tue Jan 29 02:02:19 UTC 2019 New revision: 491535 URL: https://svnweb.freebsd.org/changeset/ports/491535 Log: textproc/groff: unhang on qemu-aarch64-static after r488509 checking whether printf survives out-of-memory conditions... PR: 224740 Changes: head/textproc/groff/Makefile A commit references this bug: Author: jbeich Date: Tue Jan 29 02:02:49 UTC 2019 New revision: 491536 URL: https://svnweb.freebsd.org/changeset/ports/491536 Log: MFH: r491535 textproc/groff: unhang on qemu-aarch64-static after r488509 checking whether printf survives out-of-memory conditions... PR: 224740 Approved by: ports-secteam blanket Changes: _U branches/2019Q1/ branches/2019Q1/textproc/groff/Makefile This bug still exist in FreeBSD 12.1: ports/devel/m4 ports/devel/bison ports/devel/libunistring ports/editors/nano Need to manually kill /usr/local/bin/qemu-arm-static ./conftest so that build continues. (In reply to Neko Prog from comment #28) Taking this; I'm doing Q/A on an update to qemu-sbruno that should fix this and another couple of signal handling issues. This was the result of trying to terminate the thread while we were still executing guest code, resulting in an immediate deadlock. Latest commits refactor signal handling to push it all out of the signal handler and into process_pending_signals() at the end of individual CPU loops. I hope to push the update today. A commit references this bug: Author: kevans Date: Tue Nov 12 21:11:40 UTC 2019 New revision: 517350 URL: https://svnweb.freebsd.org/changeset/ports/517350 Log: emulators/qemu-user-static: update to head as of 2019/11/12 With this update, sendmsg/recvmsg (thus, casper'ized) applications now work again on mips. Various signal handling issues have also been addressed, most notably qemu-user-static should no longer deadlock when evaluating whether printf survives out-of-memory conditions or not. PR: 224740 Approved by: ler (ports), sbruno (maintainer, implicit) MFH: 2019Q4 Changes: head/emulators/qemu-sbruno/Makefile head/emulators/qemu-sbruno/distinfo A commit references this bug: Author: jbeich Date: Wed Nov 13 14:32:09 UTC 2019 New revision: 517376 URL: https://svnweb.freebsd.org/changeset/ports/517376 Log: Drop workaround for qemu-user-static hang after r517350 GSlice as used by qemu-user still aborts due to low RLIMIT_VMEM in an emulated application but no longer hangs. While the behavior differs from real hardware it matches the one from before r456518 that was hardcoded as gl_cv_func_printf_enomem=no workaround. PR: 224740 Changes: head/databases/recutils/Makefile head/devel/bison/Makefile head/devel/libunistring/Makefile head/devel/m4/Makefile head/editors/nano/Makefile head/misc/gnuls/Makefile head/sysutils/coreutils/Makefile head/textproc/groff/Makefile @jbeich any objection to closing this now that the bug in qemu-user-static is fixed? Go ahead. Both this port and -devel version work fine for me with FreeBSD < 13 jails. |