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

ICE: stack overflow #117831

Open
matthiaskrgr opened this issue Nov 12, 2023 · 13 comments
Open

ICE: stack overflow #117831

matthiaskrgr opened this issue Nov 12, 2023 · 13 comments
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

code:

fn main() {
    {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
                        match () {
                            _ => (|_| ())(())
                        }
    }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}

Version information

rustc 1.76.0-nightly (a04d56b36 2023-11-12)
binary: rustc
commit-hash: a04d56b36d8f634abd7bdd64dd859a30655f1818
commit-date: 2023-11-12
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.4

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: rustc interrupted by SIGSEGV, printing backtrace

/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x2d09ac6)[0x7f567df09ac6]
/usr/lib/libc.so.6(+0x3e710)[0x7f567b052710]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x4fddc)[0x5637f54f0ddc]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x4e2d3)[0x5637f54ef2d3]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x4e0e3)[0x5637f54ef0e3]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x59985)[0x5637f54fa985]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x588f7)[0x5637f54f98f7]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x25b62)[0x5637f54c6b62]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x55ac5)[0x5637f54f6ac5]
/home/matthias/.rustup/toolchains/master/bin/rustc(+0x1a87d)[0x5637f54bb87d]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x43ed12a)[0x7f567f5ed12a]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1738)[0x7f567f8f0106]

### cycle encountered after 12 frames with period 14
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7f567f8ed860]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7f567f8ea2a3]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7f567f8e8fbe]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7f567f3c092c]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7f567f3bb466]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7f567f3b7afe]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1844)[0x7f567f8f0212]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7f567f8ed860]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7f567f8ea2a3]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7f567f8e8fbe]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7f567f3c092c]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7f567f3bb466]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7f567f3b7afe]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1844)[0x7f567f8f0212]
### recursed 17 times

/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7f567f8ed860]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7f567f8ea2a3]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7f567f8e8fbe]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7f567f3c092c]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7f567f3bb466]
/home/matthias/.rustup/toolchains/master/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7f567f3b7afe]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
note: backtrace dumped due to SIGSEGV! resuming signal
[1]    549493 segmentation fault  ~/.rustup/toolchains/master/bin/rustc snippet_192.rs

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Nov 12, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 12, 2023
@matthiaskrgr
Copy link
Member Author

I tried to bisect
no crash: 2c1b65e / #115694
crash: a04d56b / #117817

which seems quite odd 😕

@matthiaskrgr matthiaskrgr added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Nov 12, 2023
@fmease
Copy link
Member

fmease commented Nov 12, 2023

What if you pass -Zparse-only during bisection?

@matthiaskrgr
Copy link
Member Author

Still overflows unfortunately

 ~/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc snippet_192.rs -Zparse-only
error: rustc interrupted by SIGSEGV, printing backtrace

/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x2d09ac6)[0x7fdfe3509ac6]
/usr/lib/libc.so.6(+0x3e710)[0x7fdfe065c710]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x4fddc)[0x55d8a28a5ddc]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x4e2d3)[0x55d8a28a42d3]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x4e0e3)[0x55d8a28a40e3]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x59985)[0x55d8a28af985]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x588f7)[0x55d8a28ae8f7]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x25b62)[0x55d8a287bb62]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x55ac5)[0x55d8a28abac5]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/rustc(+0x1a87d)[0x55d8a287087d]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x43ed12a)[0x7fdfe4bed12a]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1738)[0x7fdfe4ef0106]

### cycle encountered after 12 frames with period 14
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7fdfe4eed860]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7fdfe4eea2a3]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7fdfe4ee8fbe]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7fdfe49c092c]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7fdfe49bb466]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7fdfe49b7afe]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1844)[0x7fdfe4ef0212]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7fdfe4eed860]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7fdfe4eea2a3]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7fdfe4ee8fbe]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7fdfe49c092c]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7fdfe49bb466]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7fdfe49b7afe]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0x1844)[0x7fdfe4ef0212]
### recursed 17 times

/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMNtNtCsiucHKcZsReC_11rustc_parse6parser4stmtNtB4_6Parser15parse_full_stmt+0x42)[0x7fdfe4eed860]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46ea2a3)[0x7fdfe4eea2a3]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x46e8fbe)[0x7fdfe4ee8fbe]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41c092c)[0x7fdfe49c092c]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(+0x41bb466)[0x7fdfe49bb466]
/home/matthias/.rustup/toolchains/bisector-ci-a04d56b36d8f634abd7bdd64dd859a30655f1818-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a2929300a34289e9.so(_RNvMs0_NtNtCsiucHKcZsReC_11rustc_parse6parser4exprNtB7_6Parser21parse_expr_assoc_with+0x7e)[0x7fdfe49b7afe]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
note: backtrace dumped due to SIGSEGV! resuming signal
[1]    1537650 segmentation fault   snippet_192.rs -Zparse-only

@fmease
Copy link
Member

fmease commented Nov 12, 2023

Yea, cuz it overflows in the parser but maybe it leads to a different commit? If it's “flaky”?

@matthiaskrgr
Copy link
Member Author

I have tried stable, beta, nightly and none of them stack overflow.
With 2c1b65e , I did not manage to get a SO with or without -Zparse-only

With a04d56b I get a SO 100% of the time regardless of -Zparse-only

I also tried a debug-assertion build which is 1-2 days old and saw no stack overflow there, I can update it and try to see if I can see anything interesting with gdb there

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Nov 12, 2023

a04d56b built with debug assertions does not stack overflow for me ¯_(ツ)_/¯

@jruderman
Copy link
Contributor

Does varying the number of curlies affect the bisection results?

@jruderman
Copy link
Contributor

fwiw, on x86_64-apple-darwin, with 4000 curly-pairs instead of 1000, it crashes with a stack overflow at least as far back as 2019-01-01

@matthiaskrgr
Copy link
Member Author

I can take away a couple of {}s and it stops SOing on a04d56b but adding more than 50 pairs or so on nightly does not suddenly trigger the SO from what I see

@fmease
Copy link
Member

fmease commented Nov 12, 2023

While the stack trace says otherwise, I assume this has to do with the fact that rustc_ast_passes and possibly other AST validation compiler stages aren't properly guarded against stack overflows.

My PR added & removed some function calls & closures and apparently in total this resulted in a faster growing stack. That's my explanation. I'm pretty sure that I've seen at least on super similar issue on this issue tracker (one which hasn't been fixed yet).

@fmease
Copy link
Member

fmease commented Nov 12, 2023

#107219 kinda

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 13, 2023
@fmease
Copy link
Member

fmease commented Feb 2, 2024

Update: The code from the issue description which contains 1000 pairs of curly braces no longer overflows but updating it to e.g. 1077 pairs does still lead to one. Of course, this issue should be kept open. I will experiment with sprinkling calls to ensure_sufficient_stack inside AstValidator which I've confirmed to be the culprit (eh, it's more complicated than that).

@fmease
Copy link
Member

fmease commented Feb 10, 2024

Hmm, #93730 (comment)

@fmease fmease removed their assignment Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants