From nobody Tue Jan 27 21:13:43 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f0ynN0CHLz6QRSw for ; Tue, 27 Jan 2026 21:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0ynM4wmtz3kWv for ; Tue, 27 Jan 2026 21:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769548423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gytLY56ko3rl1/TAWgUjUCTBBp2ZWHl8i+Icc8k1hTo=; b=sT+ZuJevUHjfjr7l3fpjL1tw/lCeLB3XW6OGC2jZeBTGc+xbvZsOECpjk8yzEM/pXMWxkF /5DY1ZOSkEbYczANGGipTMuJoyirhBzEbhO7JMEg8HGb8MRWrWiW7Qh2qbldof9p5Bh2Xr Of/Pbne52u+OUH6pojxDj6WDBQLOU+HQg9i2blsCZifH5IZOFZC9RFVjumwhu6LqiYiI90 E5GBucSkPKMbL0cd5rdDzyaK9QPXTZ5CAFU0MQa7q6EAD94V+gpqyayoIdEVEHtabdM/0/ cvOTy24pS04GZws/6unLsWpaN4jY6hSEr/TbPCY2WBzM2zWKaUTIo//k2ol+5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769548423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gytLY56ko3rl1/TAWgUjUCTBBp2ZWHl8i+Icc8k1hTo=; b=JiSz12VelwQmCPQ7gfHVipNYBe+Z4+ubiuENxMiTV3cdEi4vRdgePaoJo6TrEh2XB8m2JP H/p842k7iX6F+m73nK5tJDDmpkGw3xm2tZ1i0JLwWRnBNZFt8v8pnsWpbaLMDxZ51MStad tbGM5Qby9kjCfxmHknTyHCruBYuiuSxlj96303g5E9DmE6fxGa3X3rurepkWEgpx2Xd2fA eIeyd/+D6Dk9lJDTrW9XucqHsQZJZCH6AuR7M6RqyL/gFGWH/Cg5X+NYCDfyugD+hfpvvu pHZjsZUKwXtRho/Uw2O7HJx1Zh9XOFdqUHEkLKfOS61h3ct2WOuKlXc720XmOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769548423; a=rsa-sha256; cv=none; b=yhgLNJUlsYQJq375b6aiGe10CmF5zvIN7QX7lVWe1vgooe9GlSIl3q5w/+YFV4BjCzkkP4 7nisfwlDJJn2To7Fpa0CvcGv1jkX7p+6942bR1J6CJkeDU2lDdBX0vxDPUpkRrQpylZhWx MERJG3cZk8X2F4owmG7eaftxURD4wcZ1FVDd4O7UnkTlpRCfWG5sTSZep6t+fwqlehfLAC gjtcBAjz13jmMMeEVPNs6rsRTOEUqB06r80Dn710QNVf/yolMPNX0KUhXpiEpsvesqUjSG vZJ0Diqh3Z9T0l5TtRclq5LUQ+Us00KDNJofw88fAda914VGwkMhl2moQXm0Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0ynM3tFgz71V for ; Tue, 27 Jan 2026 21:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36521 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 21:13:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 938915a22c84 - main - netbsd-tests: Fix regcomp_too_big flakiness List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 938915a22c84af88afa587694e8d63ce9dd202f4 Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 21:13:43 +0000 Message-Id: <69792a87.36521.160e4181@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=938915a22c84af88afa587694e8d63ce9dd202f4 commit 938915a22c84af88afa587694e8d63ce9dd202f4 Author: Mark Johnston AuthorDate: 2026-01-27 21:08:35 +0000 Commit: Mark Johnston CommitDate: 2026-01-27 21:08:35 +0000 netbsd-tests: Fix regcomp_too_big flakiness The test sometimes crashes with ASLR enabled. This seems to happen when regcomp() grows the process stack and happens to run into the virtual memory limit set at the beginning of the test. ASLR triggers the problem since it introduces a bit of fragmentation and thus introduces cases where stack allocation can be the trigger of virtual memory exhaustion, rather than dynamic memory allocation in regcomp(). Make the test stable by priming the stack before doing anything else. This effectively reserves 16MB of virtual memory for the stack, which in practice is enough to make the test stable on amd64. PR: 259971 Reviewed by: ngie, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54880 --- contrib/netbsd-tests/lib/libc/regex/t_exhaust.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c index 2f3d1025536b..9741f3311ae0 100644 --- a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c +++ b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c @@ -168,6 +168,14 @@ static const struct { { p6, REG_BASIC }, }; +static void __noinline +prime_stack(void) +{ + char buf[16 * 1024 * 1024]; + + explicit_bzero(buf, sizeof(buf)); +} + ATF_TC(regcomp_too_big); ATF_TC_HEAD(regcomp_too_big, tc) @@ -186,12 +194,15 @@ ATF_TC_BODY(regcomp_too_big, tc) int e; struct rlimit limit; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/259971"); - limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); + /* + * Pre-fault the stack to avoid crashes caused by growing the stack + * beyond the limit. + */ + prime_stack(); + for (size_t i = 0; i < __arraycount(tests); i++) { char *d = (*tests[i].pattern)(REGEX_MAXSIZE); e = regcomp(&re, d, tests[i].type);