mold: Mold causes Rust to lose backtraces in certain cases.
Minimal repro: https://github.com/itsfarseen/repro-sqlx-rocket-anyhow-no-backtrace
A notable thing is, if I comment out use sqlx; import, it works fine. If I don’t import sqlx, I think Rust compiler is smart enough to skip compiling it.
I don’t have to use anything inside sqlx, just importing it causes backtraces to be lost.
Cargo.toml
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
# rustflags = ["-Clink-arg=-fuse-ld=lld"]
rustflags = ["-Clink-arg=-fuse-ld=/usr/local/bin/mold"]
Rust version: rustc 1.53.0-nightly (ca075d268 2021-04-28)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (6 by maintainers)
It looks like there’s a bug in the code to handle compressed debug info. I’m preparing a patch.
I can confirm that this fixes the backtrace issue in Rust 👍
@itsfarseen I’ve enabled the discussion forum feature now.