Skip to content

debuginfo: LTO triggers assertion in llvm::LexicalScopes::getOrCreateRegularScope()  #17677

Closed
@michaelwoerister

Description

@michaelwoerister

Steps to reproduce:

  1. Build rustc with RUSTFLAGS_STAGE2=-g make rustc-stage2
  2. Try to compile a simple hello-world program with rustc ./ltocrash.rs -g -C lto
fn main() {
    println!("Hello World!");
}
  1. Observe that rustc crashes with the following error:
rustc: /home/mw/rust/src/llvm/lib/CodeGen/LexicalScopes.cpp:179: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*): Assertion `DISubprogram(Scope).describes(MF->getFunction())' failed.

A very similar issue (#17201) occurred in non-LTO cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions