rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.23k stars 12.7k forks source link

Missing debug symbols for x86_64-unknown-uefi binaries #87157

Open x1tan opened 3 years ago

x1tan commented 3 years ago

Since nightly-2020-11-15 building a binary for the x86_64-unknown-uefi target (dev/debug build) does not include debug symbols anymore.

I expected to see this happen:

$ objdump -h target-bisector-nightly-2020-11-14-x86_64-unknown-linux-gnu/x86_64-unknown-uefi/debug/rust-efi-runtime-driver.efi

target-bisector-nightly-2020-11-14-x86_64-unknown-linux-gnu/x86_64-unknown-uefi/debug/rust-efi-runtime-driver.efi:     file format pei-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000f25c  0000000140001000  0000000140001000  00000400  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rdata        00001f99  0000000140011000  0000000140011000  0000f800  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         00000090  0000000140013000  0000000140013000  00011800  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  3 .eh_fram      00000040  0000000140014000  0000000140014000  00011a00  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .reloc        000009d0  0000000140015000  0000000140015000  00011c00  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .debug_abbrev 000053f4  0000000140016000  0000000140016000  00012600  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_aranges 0000d7a0  000000014001c000  000000014001c000  00017a00  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_info   000715cc  000000014002a000  000000014002a000  00025200  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_line   000442ec  000000014009c000  000000014009c000  00096800  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_loc    0000167c  00000001400e1000  00000001400e1000  000dac00  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_pubnames 00017456  00000001400e3000  00000001400e3000  000dc400  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_pubtypes 00023e5e  00000001400fb000  00000001400fb000  000f3a00  2**0
                  CONTENTS, READONLY, DEBUGGING
 12 .debug_ranges 00027c30  000000014011f000  000000014011f000  00117a00  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_str    0007c284  0000000140147000  0000000140147000  0013f800  2**0
                  CONTENTS, READONLY, DEBUGGING

Instead, this happened:

$ objdump -h target-bisector-nightly-2020-11-15-x86_64-unknown-linux-gnu/x86_64-unknown-uefi/debug/rust-efi-runtime-driver.efi 

target-bisector-nightly-2020-11-15-x86_64-unknown-linux-gnu/x86_64-unknown-uefi/debug/rust-efi-runtime-driver.efi:     file format pei-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000f25c  0000000140001000  0000000140001000  00000400  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rdata        00001f89  0000000140011000  0000000140011000  0000f800  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         0000008c  0000000140013000  0000000140013000  00011800  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  3 .eh_fram      00000040  0000000140014000  0000000140014000  00011a00  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .reloc        000009c8  0000000140015000  0000000140015000  00011c00  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

Version it worked on

nightly-2020-11-14

Version with regression

nightly-2020-11-15

Possible commits

cargo-bisect-rustc identified the following commits:


********************************************************************************
Regression in nightly-2020-11-15
********************************************************************************
looking for regression commit between 2020-11-14 and 2020-11-15
cloning rust repository
fetching (via local git) commits from 74f7e32f43b5fb0f83896d124566d8242eb786b1 to 98d66340d6e63eda115afc8b0da1d87965881936
opening existing repository at "rust.git"
refreshing repository
looking up first commit
looking up second commit
checking that commits are by bors and thus have ci artifacts...
finding bors merge commits
found 7 bors merge commits in the specified range
  commit[0] 2020-11-13UTC: Auto merge of #78888 - richkadel:llvm-coverage-tests, r=tmandry
  commit[1] 2020-11-13UTC: Auto merge of #78683 - Nemo157:issue-78673, r=lcnr
  commit[2] 2020-11-14UTC: Auto merge of #78736 - petrochenkov:lazyenum, r=Aaron1011
  commit[3] 2020-11-14UTC: Auto merge of #78951 - petrochenkov:unknown, r=ehuss
  commit[4] 2020-11-14UTC: Auto merge of #78959 - petrochenkov:likeuefi, r=nagisa
  commit[5] 2020-11-14UTC: Auto merge of #75272 - the8472:spec-copy, r=KodrAus
  commit[6] 2020-11-14UTC: Auto merge of #78809 - vn-ki:fix-issue-76064, r=oli-obk

PR #78959 appears to be (at least) related to UEFI.

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

petrochenkov commented 3 years ago

Debuginfo is likely lying around in .pdb files now.

x1tan commented 3 years ago

My current workaround: using a custom target with "is-like-msvc": false builds PEs with the debug sections in place.

no92 commented 3 years ago

Debuginfo is likely lying around in .pdb files now.

No, the .pdb files don't contain any symbols now. However, the workaround seems reasonable.

petrochenkov commented 3 years ago

No, the .pdb files don't contain any symbols now.

If that's true, then it's a bug. Are you sure that you are enabling debuginfo in general, and use the right tooling to read symbols from PDBs?

apiraino commented 1 year ago

I assume this has not been taken care of, right?

@rustbot label +P-medium +regression-from-stable-to-stable

Jules-Bertholet commented 1 year ago

@rustbot label -regression-untriaged