-
Notifications
You must be signed in to change notification settings - Fork 15
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
Stack Overflow causes valgrind to exit with error #13
Comments
The current output looks like this:
|
jfrimmel
added a commit
that referenced
this issue
Sep 17, 2024
jfrimmel
added a commit
that referenced
this issue
Sep 17, 2024
This commit checks for a specific valgrind output string occurring when a potential stack overflow is detected. The output is "parsed" a bit, in order to produces a nicer user experience. The output looks like this: $ cargo valgrind run --manifest-path tests/corpus/Cargo.toml --bin issue-13 Error: looks like the program overflowed its stack Info: valgrind says: ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== If you believe this happened as a result of a stack ==1937526== overflow in your program's main thread (unlikely but ==1937526== possible), you can try to increase the size of the ==1937526== main thread stack using the --main-stacksize= flag. ==1937526== The main thread stack size used in this run was 8388608. This clearly states the most likely cause of the error and thus helps a user to search the error. The actual valgrind output is written there as well, since it contains the help how to diagnose this more/mitigate a potential false positive by creating a bigger stack. Fixes #13.
jfrimmel
added a commit
that referenced
this issue
Sep 17, 2024
jfrimmel
added a commit
that referenced
this issue
Sep 17, 2024
This commit checks for a specific valgrind output string occurring when a potential stack overflow is detected. The output is "parsed" a bit, in order to produces a nicer user experience. The output looks like this: $ cargo valgrind run --manifest-path tests/corpus/Cargo.toml --bin issue-13 Error: looks like the program overflowed its stack Info: valgrind says: ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== Stack overflow in thread #1: can't grow stack to 0x1ffe801000 ==1937526== If you believe this happened as a result of a stack ==1937526== overflow in your program's main thread (unlikely but ==1937526== possible), you can try to increase the size of the ==1937526== main thread stack using the --main-stacksize= flag. ==1937526== The main thread stack size used in this run was 8388608. This clearly states the most likely cause of the error and thus helps a user to search the error. The actual valgrind output is written there as well, since it contains the help how to diagnose this more/mitigate a potential false positive by creating a bigger stack. Fixes #13.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the program under test produces a stack overflow, the following output is printed:
Note, that the normal valgrind output is interleaved with the
cargo-valgrind
output. This should not happen. Even ifvalgrind
fails, its error messages should be parsed and dispalyed in the custom style.Investigating of how to suppress the valgrind stack overflow error is required.
The text was updated successfully, but these errors were encountered: