Skip to content

stack overflow during debuginfo generation #121538

Closed
@matthiaskrgr

Description

@matthiaskrgr

I tried this code:

use std::marker::PhantomData;

struct Digit<T> {
    elem: T
}

struct Node<T:'static> { m: PhantomData<&'static T> }

enum FingerTree<T:'static> {
    Single(T),

    Deep(
        Digit<T>,
        Node<FingerTree<Node<T>>>,
        )
}

enum Wrapper<T:'static> {
    Simple,
    Other(FingerTree<T>),
}

fn main() {
    let w =
        Some(Wrapper::Simple::<u32>);

}

This builds until you go for -Cdebuginfo=2

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (8f359beca 2024-02-23)
binary: rustc
commit-hash: 8f359beca4e58bc3ae795a666301a8f47023044c
commit-date: 2024-02-23
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
Backtrace

/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x2e9fcb3)[0x7f2de429fcb3]
/usr/lib/libc.so.6(+0x40770)[0x7f2de1131770]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(_RNvNtNtCsiCYefPgEVI8_17rustc_codegen_ssa9debuginfo10type_names14push_item_name+0x1b)[0x7f2de5629ddb]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(_RNvNtNtCsiCYefPgEVI8_17rustc_codegen_ssa9debuginfo10type_names14push_item_name+0x1b4)[0x7f2de5629f74]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a70)[0x7f2de5907a70]

### cycle encountered after 5 frames with period 6
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a8b)[0x7f2de5907a8b]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a8b)[0x7f2de5907a8b]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a8b)[0x7f2de5907a8b]
### recursed 41 times

/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a8b)[0x7f2de5907a8b]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x4507a8b)[0x7f2de5907a8b]
/home/matthias/.rustup/toolchains/master/lib/librustc_driver-3110cac9722aa818.so(+0x450674f)[0x7f2de590674f]

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]    3369027 segmentation fault  rustc crash.rs -Cdebuginfo=2

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions