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

Updating from version 1.0.76 breaks backtraces #345

Closed
dfaust opened this issue Jan 12, 2024 · 2 comments
Closed

Updating from version 1.0.76 breaks backtraces #345

dfaust opened this issue Jan 12, 2024 · 2 comments

Comments

@dfaust
Copy link

dfaust commented Jan 12, 2024

After running cargo update I noticed that backtraces have become useless. Pinning anyhow to version 1.0.76 fixes the issue.
With newer versions, the backtrace contains just <unknown> frames.

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>

Edit: To be clear, version 1.0.76 is the last one that it working. Version 1.0.77 doesn't work anymore.

@dtolnay
Copy link
Owner

dtolnay commented Jan 13, 2024

Could you share the output of rustc -Vv?

Maybe you are on a platform that is not supported by std::backtrace, or the standard library has been compiled with flags that interfere with something in std::backtrace.

@dfaust
Copy link
Author

dfaust commented Jan 13, 2024

I did some more research and it turns out, that updating the Rust toolchain fixes the problem.
I was using version 1.73.0, which produces the issue. Using version 1.74.0 works fine.

Here is a minimal example to reproduce:

rust-toolchain.toml

[toolchain]
channel = "1.73.0"

Cargo.toml

[package]
name = "anyhow-test"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = { version = "=1.0.77", features = ["backtrace"] }

src/main.rs

fn main() -> anyhow::Result<()> {
    anyhow::bail!("oops");
    Ok(())
}

Toolchain: 1.73.0-x86_64-unknown-linux-gnu

@dtolnay dtolnay closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants