Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: tweak the "no stack overflow" test #968

Merged
merged 1 commit into from Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion regex-syntax/src/ast/mod.rs
Expand Up @@ -1492,8 +1492,19 @@ mod tests {

// We run our test on a thread with a small stack size so we can
// force the issue more easily.
//
// NOTE(2023-03-21): It turns out that some platforms (like FreeBSD)
// will just barf with very small stack sizes. So we bump this up a bit
// to give more room to breath. When I did this, I confirmed that if
// I remove the custom `Drop` impl for `Ast`, then this test does
// indeed still fail with a stack overflow. (At the time of writing, I
// had to bump it all the way up to 32K before the test would pass even
// without the custom `Drop` impl. So 16K seems like a safe number
// here.)
//
// See: https://github.com/rust-lang/regex/issues/967
thread::Builder::new()
.stack_size(1 << 10)
.stack_size(16 << 10)
.spawn(run)
.unwrap()
.join()
Expand Down
5 changes: 4 additions & 1 deletion regex-syntax/src/hir/mod.rs
Expand Up @@ -2286,8 +2286,11 @@ mod tests {

// We run our test on a thread with a small stack size so we can
// force the issue more easily.
//
// NOTE(2023-03-21): See the corresponding test in 'crate::ast::tests'
// for context on the specific stack size chosen here.
thread::Builder::new()
.stack_size(1 << 10)
.stack_size(16 << 10)
.spawn(run)
.unwrap()
.join()
Expand Down