rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
524 stars 240 forks source link

Fix panic in backtrace symbolication on win7 #578

Closed roblabla closed 9 months ago

roblabla commented 9 months ago

Since https://github.com/rust-lang/backtrace-rs/pull/569 was merged, symbolication of backtraces would panic on Windows 7, due to using symbols that do not exist in the version of dbghelp.dll that ships there (Windows 7 ships with dbghelp.dll version 6.1, but the symbols were only added in version 6.2).

This commit checks for the presence of the newer symbols, and if they are not found, falls back to the old resolution method.

Fixes #577

github-actions[bot] commented 9 months ago

Code size changes for a hello-world Rust program linked with libstd with backtrace:

On platform windows-latest:

github-actions[bot] commented 9 months ago

Code size changes for a hello-world Rust program linked with libstd with backtrace:

On platform windows-latest:

ChrisDenton commented 9 months ago

Hm, I think it would be better to have two separate functions here so that once we have a win7 target we can just put #[cfg] on them to compile for the right version.

github-actions[bot] commented 9 months ago

Code size changes for a hello-world Rust program linked with libstd with backtrace:

On platform windows-latest:

ChrisDenton commented 9 months ago

Would you be willing to do a PR to rust-lang/rust updating the backtrace module to the latest commit?

roblabla commented 9 months ago

Yup, on it.