rust-lang / rust-lang/rust

Rust stdlib debug symbols for MinGW cannot be loaded under GDB

Open
#151,750 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-debuginfo C-bug O-windows-gnu T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Hi all,

I'm trying to ship debuginfo files for our (GStreamer) Rust plugins. The current approach is to split debuginfo as follows:

objcopy --compress-debug-sections --only-keep-debug foo.dll foo.dll.dwp
objcopy --strip-debug foo.dll foo.tmp.dll
objcopy --add-gnu-debuglink=foo.dll.dwp foo.tmp.dll
mv foo.tmp.dll foo.dll

When I load these plugins within a session of GDB, I expect the load to succeed and the debugging information to be applied.

Instead, GDB complains about missing DWO files:

During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.145.rcgu.dwo(0x8ca55eda910fa743) referenced by CU at offset 0x1026739 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.129.rcgu.dwo(0xea3da663118c1276) referenced by CU at offset 0x10266d1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.122.rcgu.dwo(0x349f56d78650b00) referenced by CU at offset 0x10266a1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]   
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\std-412f35739dfa5150.std.6f8468120d65d542-cgu.0.rcgu.dwo(0x55beba323fbfa0ac) referenced by CU at offset 0x10263d1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\std_detect-abe8e40555b44c01.std_detect.6cb3a970bc5fd515-cgu.0.rcgu.dwo(0x79a30a7c87196a0f) referenced by CU at offset 0x102646d [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\panic_unwind-26fcdf10aacc9906.panic_unwind.514cb9de47363daa-cgu.0.rcgu.dwo(0x7b64aab4e9898cce) referenced by CU at offset 0x1026405 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.084.rcgu.dwo(0xec818263c5d9f4c0) referenced by CU at offset 0x10265d1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\memchr-821e20e153e0717f.memchr.62b70d7c59d9367c-cgu.0.rcgu.dwo(0x4d7bf38785907ae9) referenced by CU at offset 0x1026439 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.050.rcgu.dwo(0x40575d169289b04b) referenced by CU at offset 0x102653d [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\hashbrown-b8fc3f598d243379.hashbrown.e19ba077d51ac3ec-cgu.0.rcgu.dwo(0xf45d1c084de87b38) referenced by CU at offset 0x10264a1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.139.rcgu.dwo(0x5b5401ab0c15b165) referenced by CU at offset 0x1026705 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\alloc-3b2e2b2642f765b5.alloc.4dd6f9318cfc53f-cgu.0.rcgu.dwo(0x9598af9f5e20a86a) referenced by CU at offset 0x10264d5 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\core-6018603b0a83ce5b.core.887804bbdca81d04-cgu.0.rcgu.dwo(0xdb85d1ff859b6f06) referenced by CU at offset 0x1026509 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.107.rcgu.dwo(0x4acdf48bebdf7b34) referenced by CU at offset 0x102666d [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.055.rcgu.dwo(0x1e8e150611e908c0) referenced by CU at offset 0x102656d [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.089.rcgu.dwo(0xfde76a7e680ac770) referenced by CU at offset 0x1026605 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.067.rcgu.dwo(0x66d9316b404a45e2) referenced by CU at offset 0x10265a1 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  
During symbol reading: Could not find DWO CU /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\build\x86_64-pc-windows-gnu\stage1-std\x86_64-pc-windows-gnu\release\deps\compiler_builtins-87953880d1763386.compiler_builtins.ace4d55401a4cf31-cgu.101.rcgu.dwo(0x634bc451ae0ecc25) referenced by CU at offset 0x1026639 [in module E:\cerbero-sources\dist\mingw_x86_64\lib\gstreamer-1.0\gstaws.dll]  

I checked and these files do are present in the corresponding .rlibs for the x86_64-pc-windows-gnu target, but for some reason GDB expects them in the fixed locations mentioned above, instead of loading them from the corresponding DLL's .dwp.

Meta

rustc --version --verbose:

rustc 1.92.0 (ded5c06cf 2025-12-08)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-pc-windows-msvc
release: 1.92.0
LLVM version: 21.1.3

I attach the complete debugsession in lieu of a backtrace, as a separate file because it exceeds Github's issue body limit: mingw_log.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the GDB session for the x86_64-pc-windows-gnu target using the objcopy commands and the attached mingw_log.txt. Compare the DWO files present in the corresponding .rlibs with the debug information referenced by gstaws.dll; done means GDB loads the DLL's debug information without reporting missing DWO files.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.