Page MenuHomeFreeBSD

netbsd-tests: Fix regcomp_too_big flakiness
ClosedPublic

Authored by markj on Sun, Jan 25, 11:46 PM.
Tags
None
Referenced Files
F143925574: D54880.diff
Mon, Feb 2, 2:00 AM
Unknown Object (File)
Wed, Jan 28, 2:38 PM
Unknown Object (File)
Wed, Jan 28, 8:31 AM
Unknown Object (File)
Mon, Jan 26, 11:22 AM
Unknown Object (File)
Mon, Jan 26, 10:53 AM
Unknown Object (File)
Mon, Jan 26, 9:40 AM
Unknown Object (File)
Mon, Jan 26, 5:41 AM
Unknown Object (File)
Mon, Jan 26, 5:22 AM
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