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

rustc attempts to load non-existent PDB during delay_span_bug() #116403

Closed
wesleywiser opened this issue Oct 3, 2023 · 1 comment · Fixed by #117089
Closed

rustc attempts to load non-existent PDB during delay_span_bug() #116403

wesleywiser opened this issue Oct 3, 2023 · 1 comment · Fixed by #117089
Assignees
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-enhancement Category: An issue proposing an enhancement or a PR with one. O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@wesleywiser
Copy link
Member

wesleywiser commented Oct 3, 2023

At various points, rustc may use std::backtrace::Backtrace::capture() to get a backtrace of the current thread such as if delay_span_bug() or similar functions are called. On Windows, this results in dbghelp.dll attempting to load the hardcoded path of rustc's PDB which, on normal user machines, never exists.

Normally, this is fine and we just simply don't have debug symbols, but in some environments like build systems such as BuildXL, filesystem accesses are monitored to enable fine-grained caching. If we try to load rustc's PDB in this environment, it will trigger build system errors:

[0:16] error DX0500: [Pip1D7E89323E41B40C, {Building Rust for: packages (x64_debug|C:\example\makefile.inc:50)}] - Disallowed file accesses were detected (R = read, W = write):
Disallowed file accesses performed by: C:\Users\wesleywiser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe
 W  C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_driver-55b43b400744bb3d.pdb
 W  C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\std-8d6706cb06448743.pdb

Since these paths won't generally resolve (unless you build rustc from source with debuginfo yourself), it would be nice to provide a way to turn this behavior off.

@wesleywiser wesleywiser added O-windows Operating system: Windows A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 3, 2023
@wesleywiser wesleywiser self-assigned this Oct 3, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 3, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 8, 2023
@wesleywiser wesleywiser changed the title rustc attempts to load non-existent PDB during ICEs/delay_span_bug() rustc attempts to load non-existent PDB during delay_span_bug() Oct 11, 2023
@wesleywiser
Copy link
Member Author

Modifying this to focus specifically on the behavior of delay_span_bug() as trying to load PDBs during an ICE isn't actually problematic for the stated use case.

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 29, 2023
…-Simulacrum

Update backtrace submodule

This pulls in a few notable changes (see the [complete list](rust-lang/backtrace-rs@99faef8...e9da96e) for details):

- rust-lang/backtrace-rs#508
- rust-lang/backtrace-rs#566
- rust-lang/backtrace-rs#569
  - Fixes rust-lang#116403 by no longer using `dbghelp.dll` during backtrace capture.
@bors bors closed this as completed in 608e968 Oct 29, 2023
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.) C-enhancement Category: An issue proposing an enhancement or a PR with one. O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants