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

Re-enable stack depth checks under ASan #161

Merged
merged 1 commit into from Nov 30, 2023

Conversation

bnoordhuis
Copy link
Contributor

Add a fudge factor to the stack size calculation because stack frames are bigger when running under AddressSanitizer.

@bnoordhuis
Copy link
Contributor Author

Some of the failing test262 tests look like regular expressions with lots of backtracking. Probably needs tweaks to libregexp.c. I'll look at that later today.

test262/test/built-ins/RegExp/S15.10.2.8_A3_T15.js:28: unexpected error: SyntaxError: stack overflow
test262/test/built-ins/RegExp/S15.10.2.8_A3_T15.js:28: strict mode: unexpected error: SyntaxError: stack overflow
test262/test/built-ins/RegExp/S15.10.2.8_A3_T16.js:28: unexpected error: SyntaxError: stack overflow
test262/test/built-ins/RegExp/S15.10.2.8_A3_T16.js:28: strict mode: unexpected error: SyntaxError: stack overflow
test262/test/language/identifiers/start-unicode-10.0.0-class-escaped.js:18: unexpected error: InternalError: stack overflow
test262/test/language/identifiers/start-unicode-10.0.0-class-escaped.js:18: strict mode: unexpected error: InternalError: stack overflow
test262/test/language/identifiers/start-unicode-10.0.0-class.js:15: unexpected error: InternalError: stack overflow
test262/test/language/identifiers/start-unicode-10.0.0-class.js:15: strict mode: unexpected error: InternalError: stack overflow
test262/test/language/statements/function/S13.2.1_A1_T1.js:30: unexpected error: SyntaxError: stack overflow
test262/test/language/statements/function/S13.2.1_A1_T1.js:30: strict mode: unexpected error: SyntaxError: stack overflow

@bnoordhuis
Copy link
Contributor Author

ASAN weirdness: new RegExp("(".repeat(152) + "x" + ")".repeat(152)) in a release build triggers the stack overflow error; debug builds don't... they can go all the way up to the max of 255 capture groups.

The default 256 kb stack is too small to run some of the test262 tests
when ASAN is enabled.

Double it to 512 kb and ensure threads created by quickjs have big
enough stacks.
@bnoordhuis bnoordhuis merged commit a5b9e54 into quickjs-ng:master Nov 30, 2023
27 checks passed
@bnoordhuis bnoordhuis deleted the asan-stack-check branch November 30, 2023 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants