rust-lang / rust-lang/rust

ICE: stack overflow

Open
#117,831 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-crash T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

code:

fn main() {
    {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{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}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the provided snippet with the reported rustc version and inspect the parser entry points named in the backtrace, including parse_stmt_without_recovery, parse_full_stmt, and parse_expr_assoc_with. Done means this input no longer causes rustc to overflow its stack and crash, with regression coverage for the reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.