Skip to content

rustc segfault (on ridiculous unlikely code) #102248

Closed
@Architector4

Description

@Architector4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions