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

LLVM debuginfo assertion "overlapping or duplicate fragments" fails with ridiculous MIR inlining #129206

Open
saethlin opened this issue Aug 17, 2024 · 0 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@saethlin
Copy link
Member

I compile a toolchain locally and cargo install utilities with it, using some ridiculous flags intended to get more mileage out of assertions in the toolchain.

The compiler for this is built with:

./configure --set profile=compiler --set llvm.assertions=true --set llvm.download-ci-llvm=true --set rust.debug=true --set rust.incremental=false
RUSTFLAGS_NOT_BOOTSTRAP="-Zmir-opt-level=4 -Zmir-enable-passes=-DataflowConstProp -Zcross-crate-inline-threshold=yes" x build library

Then installing some crates with this will fail, the one I've been minimizing (yes really, this is somewhat minimized) the set of flags is tokei:

RUSTFLAGS="-Copt-level=1 -Zinline-mir -Zmir-opt-level=1 -Cdebuginfo=2 -Zcross-crate-inline-threshold=yes -Zinline-mir-hint-threshold=1000 -Zinline-mir-threshold=1000" cargo +master-stage1 install tokei --force --target=x86_64-unknown-linux-gnu

Compilation will eventually fail with this error:

rustc: /checkout/src/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:722: void llvm::DwarfExpression::addFragmentOffset(const DIExpression *): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.

This is NOT caused by #128861. The assertion can be hit on the commit directly before that one.

@saethlin saethlin added the C-bug Category: This is a bug. label Aug 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 17, 2024
@saethlin saethlin added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants