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

rustc segfault (on ridiculous unlikely code) #102248

Closed
Architector4 opened this issue Sep 24, 2022 · 0 comments · Fixed by #113565
Closed

rustc segfault (on ridiculous unlikely code) #102248

Architector4 opened this issue Sep 24, 2022 · 0 comments · Fixed by #113565
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. 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.

Comments

@Architector4
Copy link

rustc seems to segfault on my machine with this code. It's admittedly very ridiculous, so maybe this is a complete non-issue, but I'd expect it to pop up anything fancier than a raw unclear spam of what looks like a stack trace and then segfaulting.

The code and the compiler outputs are too large for GitHub's issue body 65536 character limit, so here it is as a gist: https://gist.github.com/Architector4/a862e017ac291649e9911652c28336f9#file-unitblock-rs

The code has unnecessary println! statements, but they don't seem to affect the error.

Effectively, this code can be reproduced by taking this line: {X}() and recursively putting it into itself at X a few thousand times, at some point replacing it with nothing instead.

Version

Checked with both stable and nightly versions.

rustc stable version (from rustup on Arch Linux):

$ rustc --version --verbose
rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-unknown-linux-gnu
release: 1.64.0
LLVM version: 14.0.6

rustc nightly version (from rustup on Arch Linux):

$ rustc --version --verbose
rustc 1.66.0-nightly (4a1467723 2022-09-23)
binary: rustc
commit-hash: 4a14677239bbd9a3892d165ee24513c1a05820e4
commit-date: 2022-09-23
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.0

Output

Stable compiler output: https://gist.github.com/Architector4/a862e017ac291649e9911652c28336f9#file-rustc-stable-crash-log

Nightly compiler output: https://gist.github.com/Architector4/a862e017ac291649e9911652c28336f9#file-rustc-nightly-crash-log

There does not appear to be any change in the output from setting RUST_BACKTRACE=1 in environment.

@Architector4 Architector4 added C-bug Category: This is a bug. 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. labels Sep 24, 2022
@inquisitivecrystal inquisitivecrystal added the I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. label Sep 25, 2022
@workingjubilee workingjubilee linked a pull request Jul 11, 2023 that will close this issue
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. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants