Skip to content

LLVM debuginfo assertion "overlapping or duplicate fragments" #129206

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

Closed
saethlin opened this issue Aug 17, 2024 · 1 comment
Closed

LLVM debuginfo assertion "overlapping or duplicate fragments" #129206

saethlin opened this issue Aug 17, 2024 · 1 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.

Comments

@saethlin
Copy link
Member

saethlin commented Aug 17, 2024

Original issue is below. As expected, this assertion can be hit without silly flags:

RUSTFLAGS="-Cpanic=abort -Cdebuginfo=2 -Cdebug-assertions=yes" cargo +master-stage1 install fd-find --force

Will eventually fail with

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 still requires a custom build and cannot be easily bisected because this requires a toolchain with LLVM assertions.

This assertion can also be reproduced with varying flags on the following crates:

fd-find ripgrep cargo-outdated cargo-audit cargo-deny bacon wthrr tokio-console josh cargo-lambda samply

I just tried using git bisect and the first few commits I tried to find a start point of my bisect don't build for various dumb reasons including missing books. I'm not going to fight with months-old bootstrap bugs.


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
@saethlin saethlin changed the title LLVM debuginfo assertion "overlapping or duplicate fragments" fails with ridiculous MIR inlining LLVM debuginfo assertion "overlapping or duplicate fragments" Oct 13, 2024
@saethlin
Copy link
Member Author

I think this was fixed by #132613. In any case, it doesn't reproduce anymore.

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