-
Notifications
You must be signed in to change notification settings - Fork 107
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 with Specific Optimization Levels When Running Test Cases #702
Comments
I wonder if this is a duplicate of #653 (which I closed due to lack of reproduction case) I'm also able to reproduce this with $ CARGO_PROFILE_DEV_OPT_LEVEL=0 cargo test The odd thing is that the |
If I drop the recursion limit from 128 to 64, it passes. |
I think the reproduction case is the test case RUSTFLAGS="-C opt-level=0" cargo test --package toml_edit --test testsuite --features parse --features display -- stackoverflow::array_recursion_limit --exact --nocapture But this case will pass if opt-level is set as 1/2/3/s/z. Is it possible that this is a bug related with rustc optimization? |
Likely the problem is that the optimizer is reducing the stack size, making the recursion cheaper and allowing deeper recursion. The biggest red flag is about the |
In your |
Wow, hadn't realize that was in there as it isn't part of my standard template. |
Hi, I've noticed that when running test cases for this crate, I get a stack overflow when using certain specific optimization level (
-C opt-level=0
), not sure if it's a problem with the crate or with rustc.I am using cargo version: cargo
1.77.0-nightly (7bb7b5395 2024-01-20)
, and below is an example of triggering the issue.By using the following command:
The tests will run successfully like this:
However, if I change the optimization level to 0, for example, with the command:
It will produce the following stackoverflow:
The text was updated successfully, but these errors were encountered: