Page MenuHomeFreeBSD

netbsd-tests: Fix regcomp_too_big flakiness
ClosedPublic

Authored by markj on Jan 25 2026, 11:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 14, 7:03 PM
Unknown Object (File)
Sat, Feb 14, 6:11 AM
Unknown Object (File)
Fri, Feb 13, 10:37 PM
Unknown Object (File)
Fri, Feb 13, 5:17 PM
Unknown Object (File)
Thu, Feb 12, 2:45 AM
Unknown Object (File)
Mon, Feb 9, 4:11 PM
Unknown Object (File)
Mon, Feb 9, 11:16 AM
Unknown Object (File)
Fri, Feb 6, 12:26 PM
Subscribers

Details

Summary

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, instead of 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

Test Plan

I see the test crash once in a while in my test runner; with this patch I can
run it for a long time in a loop without any crashes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable