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

Toolchain paths are being compiled into binaires #116948

Open
abrisco opened this issue Oct 19, 2023 · 25 comments
Open

Toolchain paths are being compiled into binaires #116948

abrisco opened this issue Oct 19, 2023 · 25 comments
Labels
A-reproducibility Area: Reproducible / Deterministic builds C-bug Category: This is a bug. O-macos Operating system: macOS

Comments

@abrisco
Copy link

abrisco commented Oct 19, 2023

I noticed binaries produced by different users on the same machine resulting in binaries that were not byte-for-byte identical even though it was expected. Upon investigation, I found that absolute paths of components in the toolchain were being written into the binaries.

I created a new project hostpaths with cargo init hostpaths and added the following .cargo/config.toml file

[build]
rustflags = [
    "--remap-path-prefix=/Users/andrebrisco/Code/hostpaths=.",  # source code path
    "--remap-path-prefix=/Users/andrebrisco/.rustup=."  # toolchain path
]

I tried this code on a macOS machine:

fn main() {
    println!("Hello, world!");
}

Then I ran xxd on the compiled binary (xxd target/debug/hostpaths) and in the output see sections with the paths I was trying to strip

00070450: 2f55 7365 7273 2f72 756e 6e65 722f 2e63  /Users/runner/.c
00070460: 6172 676f 2f72 6567 6973 7472 792f 7372  argo/registry/sr
00070470: 632f 696e 6465 782e 6372 6174 6573 2e69  c/index.crates.i
00070480: 6f2d 3666 3137 6432 3262 6261 3135 3030  o-6f17d22bba1500
00070490: 3166 2f6d 656d 6368 722d 322e 352e 302f  1f/memchr-2.5.0/
000704a0: 7372 632f 6c69 622e 7273 2f40 2f00 6d65  src/lib.rs/@/.me
000704b0: 6d63 6872 2e31 3861 6563 3564 6635 3863  mchr.18aec5df58c
000704c0: 3636 6666 392d 6367 752e 3000 2f55 7365  66ff9-cgu.0./Use
000704d0: 7273 2f61 6e64 7265 6272 6973 636f 2f2e  rs/andrebrisco/.    <- unexpected
000704e0: 7275 7374 7570 2f74 6f6f 6c63 6861 696e  rustup/toolchain
000704f0: 732f 7374 6162 6c65 2d61 6172 6368 3634  s/stable-aarch64
00070500: 2d61 7070 6c65 2d64 6172 7769 6e2f 6c69  -apple-darwin/li
00070510: 622f 7275 7374 6c69 622f 6161 7263 6836  b/rustlib/aarch6
00070520: 342d 6170 706c 652d 6461 7277 696e 2f6c  4-apple-darwin/l
00070530: 6962 2f6c 6962 6d65 6d63 6872 2d64 6261  ib/libmemchr-dba
00070540: 3538 3861 3139 6337 3363 3761 662e 726c  588a19c73c7af.rl
00070550: 6962 286d 656d 6368 722d 6462 6135 3838  ib(memchr-dba588
00070560: 6131 3963 3733 6337 6166 2e6d 656d 6368  a19c73c7af.memch
00070570: 722e 3138 6165 6335 6466 3538 6336 3666  r.18aec5df58c66f
00070580: 6639 2d63 6775 2e30 2e72 6367 752e 6f29  f9-cgu.0.rcgu.o)
00070590: 002f 5573 6572 732f 7275 6e6e 6572 2f2e  ./Users/runner/.
000705a0: 6361 7267 6f2f 7265 6769 7374 7279 2f73  cargo/registry/s
000705b0: 7263 2f69 6e64 6578 2e63 7261 7465 732e  rc/index.crates.
000705c0: 696f 2d36 6631 3764 3232 6262 6131 3530  io-6f17d22bba150
000705d0: 3031 662f 7275 7374 632d 6465 6d61 6e67  01f/rustc-demang
000705e0: 6c65 2d30 2e31 2e32 332f 7372 632f 6c69  le-0.1.23/src/li
000705f0: 622e 7273 2f40 2f00 7275 7374 635f 6465  b.rs/@/.rustc_de
00070600: 6d61 6e67 6c65 2e37 6234 3934 3230 3239  mangle.7b4942029
00070610: 6635 3165 3235 372d 6367 752e 3000 2f55  f51e257-cgu.0./U
00070620: 7365 7273 2f61 6e64 7265 6272 6973 636f  sers/andrebrisco    <- unexpected
00070630: 2f2e 7275 7374 7570 2f74 6f6f 6c63 6861  /.rustup/toolcha
00070640: 696e 732f 7374 6162 6c65 2d61 6172 6368  ins/stable-aarch
00070650: 3634 2d61 7070 6c65 2d64 6172 7769 6e2f  64-apple-darwin/
00070660: 6c69 622f 7275 7374 6c69 622f 6161 7263  lib/rustlib/aarc
00070670: 6836 342d 6170 706c 652d 6461 7277 696e  h64-apple-darwin
00070680: 2f6c 6962 2f6c 6962 7275 7374 635f 6465  /lib/librustc_de
00070690: 6d61 6e67 6c65 2d36 3066 3164 3461 3430  mangle-60f1d4a40
000706a0: 3262 6165 3438 382e 726c 6962 2872 7573  2bae488.rlib(rus
000706b0: 7463 5f64 656d 616e 676c 652d 3630 6631  tc_demangle-60f1
000706c0: 6434 6134 3032 6261 6534 3838 2e72 7573  d4a402bae488.rus
000706d0: 7463 5f64 656d 616e 676c 652e 3762 3439  tc_demangle.7b49
000706e0: 3432 3032 3966 3531 6532 3537 2d63 6775  42029f51e257-cgu
000706f0: 2e30 2e72 6367 752e 6f29 002f 5573 6572  .0.rcgu.o)./User
00070700: 732f 7275 6e6e 6572 2f2e 6361 7267 6f2f  s/runner/.cargo/
00070710: 7265 6769 7374 7279 2f73 7263 2f69 6e64  registry/src/ind
00070720: 6578 2e63 7261 7465 732e 696f 2d36 6631  ex.crates.io-6f1

The expectation based on the use of --remap-path-prefix is that I would not see any references to andrebrisco in the binary at all.

Meta

rustc --version --verbose:

rustc 1.72.0 (5680fa18f 2023-08-23)
binary: rustc
commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be
commit-date: 2023-08-23
host: aarch64-apple-darwin
release: 1.72.0
LLVM version: 16.0.5

rustc +nightly --version --verbose

rustc 1.74.0-nightly (249595b75 2023-08-23)
binary: rustc
commit-hash: 249595b7523fc07a99c1adee90b1947739ca0e5b
commit-date: 2023-08-23
host: aarch64-apple-darwin
release: 1.74.0-nightly
LLVM version: 17.0.0

@abrisco abrisco added the C-bug Category: This is a bug. label Oct 19, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 19, 2023
@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

Could you do cargo clean and then cargo build -v to verify that --remap-path-prefix is passed to rustc?

@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

Also can you check which section actually contains these paths? Is it a single section or are there multiple?

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

Could you do cargo clean and then cargo build -v to verify that --remap-path-prefix is passed to rustc?

The flags are indeed being set

Compiling hostpaths v0.1.0 (/Users/andrebrisco/Code/hostpaths)
    Running `/Users/andrebrisco/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name hostpaths --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=80 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C metadata=4ca048c45f92ab74 -C extra-filename=-4ca048c45f92ab74 --out-dir /Users/andrebrisco/Code/hostpaths/target/debug/deps -C incremental=/Users/andrebrisco/Code/hostpaths/target/debug/incremental -L dependency=/Users/andrebrisco/Code/hostpaths/target/debug/deps --remap-path-prefix=/Users/andrebrisco/Code/hostpaths=. --remap-path-prefix=/Users/andrebrisco/.rustup=.`
   Finished dev [unoptimized + debuginfo] target(s) in 4.04s

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

Also can you check which section actually contains these paths? Is it a single section or are there multiple?

Sorry but can you advise on how I would determine this?

@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

I don't have a mac, but otool -l target/debug/hostpaths may print the offsets of all sections. This should allow cross-referencing with your hexdump.

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

I don't have a mac, but otool -l target/debug/hostpaths may print the offsets of all sections. This should allow cross-referencing with your hexdump.

I'm not entirely sure what I'm looking for, below is the result of otool -l

target/debug/hostpaths:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 552
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x0000000000048000
  fileoff 0
 filesize 294912
  maxprot 0x00000005
 initprot 0x00000005
   nsects 6
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000100003894
      size 0x0000000000035d14
    offset 14484
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x00000001000395a8
      size 0x0000000000000318
    offset 234920
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 12 (size of stubs)
Section
  sectname __const
   segname __TEXT
      addr 0x00000001000398c0
      size 0x00000000000056d4
    offset 235712
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __gcc_except_tab
   segname __TEXT
      addr 0x000000010003ef94
      size 0x00000000000011a8
    offset 257940
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x000000010004013c
      size 0x00000000000013a8
    offset 262460
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x00000001000414e8
      size 0x0000000000006b18
    offset 267496
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x6800000b
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 232
  segname __DATA_CONST
   vmaddr 0x0000000100048000
   vmsize 0x0000000000004000
  fileoff 294912
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 2
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x0000000100048000
      size 0x0000000000000218
    offset 294912
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 66 (index into indirect symbol table)
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x0000000100048218
      size 0x0000000000002528
    offset 295448
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 552
  segname __DATA
   vmaddr 0x000000010004c000
   vmsize 0x0000000000004000
  fileoff 311296
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 6
    flags 0x0
Section
  sectname __data
   segname __DATA
      addr 0x000000010004c000
      size 0x0000000000000008
    offset 311296
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __thread_vars
   segname __DATA
      addr 0x000000010004c008
      size 0x00000000000000c0
    offset 311304
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000013
 reserved1 0
 reserved2 0
Section
  sectname __thread_data
   segname __DATA
      addr 0x000000010004c0c8
      size 0x0000000000000040
    offset 311496
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000011
 reserved1 0
 reserved2 0
Section
  sectname __thread_bss
   segname __DATA
      addr 0x000000010004c108
      size 0x0000000000000030
    offset 311560
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000012
 reserved1 0
 reserved2 0
Section
  sectname __common
   segname __DATA
      addr 0x000000010004c138
      size 0x0000000000000030
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x000000010004c168
      size 0x00000000000000d8
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 4
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000100050000
   vmsize 0x0000000000024000
  fileoff 327680
 filesize 141288
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 5
      cmd LC_DYLD_CHAINED_FIXUPS
  cmdsize 16
  dataoff 327680
 datasize 1456
Load command 6
      cmd LC_DYLD_EXPORTS_TRIE
  cmdsize 16
  dataoff 329136
 datasize 13560
Load command 7
     cmd LC_SYMTAB
 cmdsize 24
  symoff 343648
   nsyms 3362
  stroff 397976
 strsize 67208
Load command 8
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 3079
     iextdefsym 3079
     nextdefsym 216
      iundefsym 3295
      nundefsym 67
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 397440
  nindirectsyms 133
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 9
          cmd LC_LOAD_DYLINKER
      cmdsize 32
         name /usr/lib/dyld (offset 12)
Load command 10
     cmd LC_UUID
 cmdsize 24
    uuid 50CCCAC9-995D-3994-A41F-2864E708AD4B
Load command 11
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 14.0
      sdk 14.0
   ntools 1
     tool 3
  version 1015.7
Load command 12
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 13
       cmd LC_MAIN
   cmdsize 24
  entryoff 14544
 stacksize 0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Wed Dec 31 16:00:02 1969
      current version 1336.0.0
compatibility version 1.0.0
Load command 15
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 342696
 datasize 952
Load command 16
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 343648
 datasize 0
Load command 17
      cmd LC_CODE_SIGNATURE
  cmdsize 16
  dataoff 465184
 datasize 3784

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

For what it's worth I see host paths in linux binaries as well. I did the same thing mentioned in the original post in a ubuntu docker container but pwd was /root/Code/hostpaths. I see that in the xxd output for the binary

0024d470: 6363 3636 6164 3436 3820 3230 3233 2d31  cc66ad468 2023-1
0024d480: 302d 3033 2929 0073 7263 2f6d 6169 6e2e  0-03)).src/main.
0024d490: 7273 2f40 2f31 7837 756e 7062 7266 3033  rs/@/1x7unpbrf03
0024d4a0: 6138 7076 3000 2f72 6f6f 742f 436f 6465  a8pv0./root/Code    <- here
0024d4b0: 2f68 6f73 7470 6174 6873 0063 6f72 6500  /hostpaths.core.
0024d4c0: 5f5a 4e34 636f 7265 3468 696e 7439 626c  _ZN4core4hint9bl

@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

I think otool -l doesn't report file offsets. I use Linux myself, so continuing the investigation on the Ubuntu docker container is probably easier. Can you do readelf -SW target/debug/hostpaths? I know readelf does print file offsets.

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

readelf -SW target/debug/hostpaths

There are 42 section headers, starting at offset 0x4a71f8:

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
  [ 1] .interp           PROGBITS        0000000000000270 000270 00001b 00   A  0   0  1
  [ 2] .note.gnu.build-id NOTE            000000000000028c 00028c 000024 00   A  0   0  4
  [ 3] .note.ABI-tag     NOTE            00000000000002b0 0002b0 000020 00   A  0   0  4
  [ 4] .gnu.hash         GNU_HASH        00000000000002d0 0002d0 00001c 00   A  5   0  8
  [ 5] .dynsym           DYNSYM          00000000000002f0 0002f0 000660 18   A  6   3  8
  [ 6] .dynstr           STRTAB          0000000000000950 000950 0003b8 00   A  0   0  1
  [ 7] .gnu.version      VERSYM          0000000000000d08 000d08 000088 02   A  5   0  2
  [ 8] .gnu.version_r    VERNEED         0000000000000d90 000d90 0000b0 00   A  6   2  8
  [ 9] .rela.dyn         RELA            0000000000000e40 000e40 0032b8 18   A  5   0  8
  [10] .rela.plt         RELA            00000000000040f8 0040f8 0005e8 18  AI  5  26  8
  [11] .init             PROGBITS        00000000000046e0 0046e0 000018 00  AX  0   0  4
  [12] .plt              PROGBITS        0000000000004700 004700 000410 00  AX  0   0 16
  [13] .text             PROGBITS        0000000000004b40 004b40 03b414 00  AX  0   0 64
  [14] .fini             PROGBITS        000000000003ff54 03ff54 000014 00  AX  0   0  4
  [15] .rodata           PROGBITS        000000000003ff70 03ff70 005988 00   A  0   0 16
  [16] .debug_gdb_scripts PROGBITS        00000000000458f8 0458f8 000022 01 AMS  0   0  1
  [17] .eh_frame_hdr     PROGBITS        000000000004591c 04591c 001344 00   A  0   0  4
  [18] .eh_frame         PROGBITS        0000000000046c60 046c60 006880 00   A  0   0  8
  [19] .gcc_except_table PROGBITS        000000000004d4e0 04d4e0 001238 00   A  0   0  4
  [20] .tdata            PROGBITS        000000000005f5f0 04f5f0 000028 00 WAT  0   0  8
  [21] .tbss             NOBITS          000000000005f618 04f618 000028 00 WAT  0   0  8
  [22] .init_array       INIT_ARRAY      000000000005f618 04f618 000020 08  WA  0   0  8
  [23] .fini_array       FINI_ARRAY      000000000005f638 04f638 000008 08  WA  0   0  8
  [24] .data.rel.ro      PROGBITS        000000000005f640 04f640 0024e8 00  WA  0   0  8
  [25] .dynamic          DYNAMIC         0000000000061b28 051b28 000200 10  WA  6   0  8
  [26] .got              PROGBITS        0000000000061d28 051d28 0002d8 08  WA  0   0  8
  [27] .data             PROGBITS        0000000000062000 052000 000030 00  WA  0   0  8
  [28] .bss              NOBITS          0000000000062030 052030 000120 00  WA  0   0  8
  [29] .comment          PROGBITS        0000000000000000 052030 000079 01  MS  0   0  1
  [30] .debug_aranges    PROGBITS        0000000000000000 0520b0 00b8a0 00      0   0 16
  [31] .debug_pubnames   PROGBITS        0000000000000000 05d950 098164 00      0   0  1
  [32] .debug_info       PROGBITS        0000000000000000 0f5ab4 0dd357 00      0   0  1
  [33] .debug_abbrev     PROGBITS        0000000000000000 1d2e0b 001640 00      0   0  1
  [34] .debug_line       PROGBITS        0000000000000000 1d444b 079003 00      0   0  1
  [35] .debug_str        PROGBITS        0000000000000000 24d44e 152917 01  MS  0   0  1
  [36] .debug_loc        PROGBITS        0000000000000000 39fd65 0003b2 00      0   0  1
  [37] .debug_pubtypes   PROGBITS        0000000000000000 3a0117 00054a 00      0   0  1
  [38] .debug_ranges     PROGBITS        0000000000000000 3a0661 0e5660 00      0   0  1
  [39] .symtab           SYMTAB          0000000000000000 485cc8 00fa68 18     40 2379  8
  [40] .strtab           STRTAB          0000000000000000 495730 01190f 00      0   0  1
  [41] .shstrtab         STRTAB          0000000000000000 4a703f 0001b2 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), p (processor specific)

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

Seems to be .debug_str. When I rebuild with --release the string goes away but for macOS if I build a release binary the data is still there.

@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

Could you try dwarfdump on the executable and paste say 50 lines on either side of a mention of a path that should have been remapped? Be aware that dwarfdump prints a lot, so you may want to use grep with -C50 as extra argument for the 50 lines context on either side.

@abrisco
Copy link
Author

abrisco commented Oct 20, 2023

I'm assuming you mean for linux? dwarfdump is empty on macOS

``` root@2355bc16a6a7:~/Code/hostpaths# dwarfdump ./target/debug/hostpaths | grep root/Code -C50

.debug_info

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/1x7unpbrf03a8pv0
DW_AT_stmt_list 0x00000000
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00006fd4
DW_AT_high_pc 32 <highpc: 0x00006ff4>

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_namespace
DW_AT_name core
< 2><0x0000002f> DW_TAG_namespace
DW_AT_name hint
< 3><0x00000034> DW_TAG_subprogram
DW_AT_linkage_name _ZN4core4hint9black_box17h0489e5e106d4c941E
DW_AT_name black_box<()>
DW_AT_decl_file 0x00000002 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/hint.rs
DW_AT_decl_line 0x00000124
DW_AT_inline DW_INL_inlined
< 4><0x00000041> DW_TAG_template_type_parameter
DW_AT_type <0x00000059>
DW_AT_name T
< 4><0x0000004a> DW_TAG_variable
DW_AT_name dummy
DW_AT_decl_file 0x00000002 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/hint.rs
DW_AT_decl_line 0x00000124
DW_AT_type <0x00000059>
< 1><0x00000059> DW_TAG_base_type
DW_AT_name ()
DW_AT_encoding DW_ATE_unsigned
DW_AT_byte_size 0x00000000
< 1><0x00000060> DW_TAG_namespace
DW_AT_name std
< 2><0x00000065> DW_TAG_namespace
DW_AT_name sys_common
< 3><0x0000006a> DW_TAG_namespace
DW_AT_name backtrace
< 4><0x0000006f> DW_TAG_subprogram
DW_AT_low_pc 0x00006fd4
DW_AT_high_pc 32 <highpc: 0x00006ff4>
DW_AT_frame_base len 0x0001: 0x6f:
DW_OP_reg31
DW_AT_linkage_name _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h020da3e7b890d5afE
DW_AT_name __rust_begin_short_backtrace<fn(), ()>
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs
DW_AT_decl_line 0x00000096
< 5><0x00000088> DW_TAG_formal_parameter
DW_AT_location len 0x0002: 0x9110:
DW_OP_fbreg 16
DW_AT_name f
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs
DW_AT_decl_line 0x00000096
DW_AT_type <0x000000d5>
< 5><0x00000096> DW_TAG_lexical_block

                            DW_AT_name                  result
                            DW_AT_decl_file             0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs
                            DW_AT_decl_line             0x0000009a
                            DW_AT_type                  <0x00000059>

< 6><0x000000a9> DW_TAG_inlined_subroutine
DW_AT_abstract_origin <0x00000034>
DW_AT_ranges 0x00000030
ranges: 3 at .debug_ranges offset 48 (0x00000030) (48 bytes)
[ 0] range entry 0x00000008 0x00000010
[ 1] range entry 0x00000014 0x00000014
[ 2] range end 0x00000000 0x00000000
DW_AT_call_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs
DW_AT_call_line 0x0000009d
DW_AT_call_column 0x00000005
< 7><0x000000b5> DW_TAG_variable
DW_AT_location len 0x0002: 0x910f:
DW_OP_fbreg 15
DW_AT_abstract_origin <0x0000004a>
< 5><0x000000bf> DW_TAG_template_type_parameter
DW_AT_type <0x000000d5>
DW_AT_name F
< 5><0x000000c8> DW_TAG_template_type_parameter
DW_AT_type <0x00000059>
DW_AT_name T
< 1><0x000000d5> DW_TAG_pointer_type
DW_AT_type <0x000000e2>
DW_AT_name fn()
DW_AT_address_class 0x00000000
< 1><0x000000e2> DW_TAG_subroutine_type

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x0000000b):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00006fd4 [ 150, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs"
0x00006fdc [ 292,27] NS PE uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/hint.rs"
0x00006fe4 [ 154,18] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs"
0x00006fe8 [ 293, 5] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/hint.rs"
0x00006fe8 [ 160, 2] NS EB uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs"
0x00006ff4 [ 160, 2] NS ET

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/28rm0kdzpfe7ey5o
DW_AT_stmt_list 0x000000fb
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00000060
ranges: 3 at .debug_ranges offset 96 (0x00000060) (48 bytes)
[ 0] range entry 0x00006ff4 0x0000705c
[ 1] range entry 0x0000705c 0x0000708c
[ 2] range end 0x00000000 0x00000000

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_variable
DW_AT_name <std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable}
DW_AT_type <0x0000003d>
DW_AT_location len 0x0009: 0x0340f6050000000000:
DW_OP_addr 0x0005f640
< 1><0x0000003d> DW_TAG_structure_type
DW_AT_containing_type <0x000000b5>
DW_AT_name <std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable_type}
DW_AT_byte_size 0x00000030
DW_AT_alignment 0x00000008
< 2><0x00000048> DW_TAG_member
DW_AT_name drop_in_place
DW_AT_type <0x0000008b>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 0
< 2><0x00000053> DW_TAG_member
DW_AT_name size
DW_AT_type <0x0000009f>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 8
< 2><0x0000005e> DW_TAG_member
DW_AT_name align
DW_AT_type <0x0000009f>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 16
< 2><0x00000069> DW_TAG_member
DW_AT_name __method3
DW_AT_type <0x0000008b>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 24
< 2><0x00000074> DW_TAG_member
DW_AT_name __method4
DW_AT_type <0x0000008b>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 32
< 2><0x0000007f> DW_TAG_member
DW_AT_name __method5
DW_AT_type <0x0000008b>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 40
< 1><0x0000008b> DW_TAG_pointer_type

                    DW_AT_decl_file             0x00000002 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/process/process_common.rs
                    DW_AT_decl_line             0x00000251
                    DW_AT_type                  <0x00000220>

< 1><0x00000240> DW_TAG_subprogram
DW_AT_specification <0x000001eb>
DW_AT_inline DW_INL_inlined
< 2><0x00000246> DW_TAG_formal_parameter
DW_AT_name self
DW_AT_decl_file 0x00000003 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/process.rs
DW_AT_decl_line 0x0000076b
DW_AT_type <0x000001d9>
< 1><0x00000253> DW_TAG_base_type
DW_AT_name isize
DW_AT_encoding DW_ATE_signed
DW_AT_byte_size 0x00000008
< 1><0x0000025a> DW_TAG_pointer_type
DW_AT_type <0x00000267>
DW_AT_name *const *const u8
DW_AT_address_class 0x00000000
< 1><0x00000267> DW_TAG_pointer_type
DW_AT_type <0x00000212>
DW_AT_name *const u8
DW_AT_address_class 0x00000000

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x000000ef):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00006ff4 [ 159, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/rt.rs"
0x00007034 [ 166,10] NS PE
0x00007038 [ 165,17] NS
0x00007048 [ 165,12]
0x00007050 [ 172, 2] NS ET EB
0x0000705c [ 172, 2] NS ET
0x0000705c [ 166, 0] NS
0x0000706c [ 166,77] NS PE
0x00007070 [ 166,18]
0x0000707c [ 594, 9] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/process/process_common.rs"
0x00007080 [ 166,100] NS ET EB uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/rt.rs"
0x0000708c [ 166,100] NS ET

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/2myp2rgsftcdybvl
DW_AT_stmt_list 0x0000022a
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00000090
ranges: 5 at .debug_ranges offset 144 (0x00000090) (80 bytes)
[ 0] range entry 0x0000708c 0x000070b0
[ 1] range entry 0x000070b0 0x000070cc
[ 2] range entry 0x000070cc 0x00007118
[ 3] range entry 0x00007118 0x00007128
[ 4] range end 0x00000000 0x00000000

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_namespace
DW_AT_name core
< 2><0x0000002f> DW_TAG_namespace
DW_AT_name ops
< 3><0x00000034> DW_TAG_namespace
DW_AT_name function
< 4><0x00000039> DW_TAG_namespace
DW_AT_name FnOnce
< 5><0x0000003e> DW_TAG_subprogram
DW_AT_low_pc 0x0000708c
DW_AT_high_pc 36 <highpc: 0x000070b0>
DW_AT_frame_base len 0x0001: 0x6f:
DW_OP_reg31
DW_AT_linkage_name _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h6ec275a85f4af5e3E
DW_AT_name call_once<std::rt::lang_start::{closure_env#0}<()>, ()>
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs
DW_AT_decl_line 0x000000fa
DW_AT_type <0x00000179>
< 6><0x0000005b> DW_TAG_formal_parameter
DW_AT_location len 0x0002: 0x9108:
DW_OP_fbreg 8
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs
DW_AT_decl_line 0x000000fa
DW_AT_type <0x00000180>
< 6><0x00000065> DW_TAG_formal_parameter
DW_AT_location len 0x0002: 0x9107:
DW_OP_fbreg 7
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs
DW_AT_decl_line 0x000000fa
DW_AT_type <0x00000172>
< 6><0x0000006f> DW_TAG_template_type_parameter
DW_AT_type <0x0000014e>
DW_AT_name Self
< 6><0x00000078> DW_TAG_template_type_parameter
DW_AT_type <0x00000172>
DW_AT_name Args
< 5><0x00000082> DW_TAG_subprogram
DW_AT_low_pc 0x000070b0
DW_AT_high_pc 28 <highpc: 0x000070cc>

                          DW_AT_alignment             0x00000008
                          DW_AT_data_member_location  0

< 1><0x00000164> DW_TAG_pointer_type
DW_AT_type <0x00000171>
DW_AT_name fn()
DW_AT_address_class 0x00000000
< 1><0x00000171> DW_TAG_subroutine_type
< 1><0x00000172> DW_TAG_base_type
DW_AT_name ()
DW_AT_encoding DW_ATE_unsigned
DW_AT_byte_size 0x00000000
< 1><0x00000179> DW_TAG_base_type
DW_AT_name i32
DW_AT_encoding DW_ATE_signed
DW_AT_byte_size 0x00000004
< 1><0x00000180> DW_TAG_pointer_type
DW_AT_type <0x0000014e>
DW_AT_name *mut std::rt::lang_start::{closure_env#0}<()>
DW_AT_address_class 0x00000000

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x00000364):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x0000708c [ 250, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs"
0x0000709c [ 250, 5] NS PE
0x000070a4 [ 250, 5] ET EB
0x000070b0 [ 250, 5] ET
0x000070b0 [ 250, 0] NS
0x000070bc [ 250, 5] NS PE
0x000070c0 [ 250, 5] ET EB
0x000070cc [ 250, 5] ET
0x000070cc [ 250, 0] NS
0x000070e0 [ 250, 5] NS PE
0x000070f8 [ 0, 5]
0x0000710c [ 250, 5] ET EB
0x00007118 [ 250, 5] ET
0x00007118 [ 497, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ptr/mod.rs"
0x00007120 [ 497, 1] NS ET PE EB
0x00007128 [ 497, 1] NS ET

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/3859zwxehh9zy90t
DW_AT_stmt_list 0x00000361
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00007128
DW_AT_high_pc 160 <highpc: 0x000071c8>

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_namespace
DW_AT_name core
< 2><0x0000002f> DW_TAG_namespace
DW_AT_name fmt
< 3><0x00000034> DW_TAG_namespace
DW_AT_name rt
< 4><0x00000039> DW_TAG_enumeration_type
DW_AT_type <0x00000313>
DW_AT_enum_class yes(1)
DW_AT_name Alignment
DW_AT_byte_size 0x00000001
DW_AT_alignment 0x00000001
< 5><0x00000044> DW_TAG_enumerator
DW_AT_name Left
DW_AT_const_value 0
< 5><0x0000004a> DW_TAG_enumerator
DW_AT_name Right
DW_AT_const_value 1
< 5><0x00000050> DW_TAG_enumerator
DW_AT_name Center
DW_AT_const_value 2
< 5><0x00000056> DW_TAG_enumerator
DW_AT_name Unknown
DW_AT_const_value 3
< 4><0x0000005d> DW_TAG_structure_type
DW_AT_name Placeholder
DW_AT_byte_size 0x00000038
DW_AT_alignment 0x00000008
< 5><0x00000064> DW_TAG_member
DW_AT_name position
DW_AT_type <0x00000368>
DW_AT_alignment 0x00000008
DW_AT_data_member_location 32
< 5><0x0000006f> DW_TAG_member
DW_AT_name fill
DW_AT_type <0x0000039d>
DW_AT_alignment 0x00000004
DW_AT_data_member_location 40
< 5><0x0000007a> DW_TAG_member
DW_AT_name align
DW_AT_type <0x00000039>
DW_AT_alignment 0x00000001
DW_AT_data_member_location 48
< 5><0x00000085> DW_TAG_member
DW_AT_name flags

                  DW_AT_type                  <0x0000044b>
                  DW_AT_name                  &[usize; 3]
                  DW_AT_address_class         0x00000000

< 1><0x0000044b> DW_TAG_array_type
DW_AT_type <0x00000368>
< 2><0x00000450> DW_TAG_subrange_type
DW_AT_type <0x00000458>
DW_AT_lower_bound 0x00000000
DW_AT_count 0x00000003
< 1><0x00000458> DW_TAG_base_type
DW_AT_name ARRAY_SIZE_TYPE
DW_AT_byte_size 0x00000008
DW_AT_encoding DW_ATE_unsigned
< 1><0x0000045f> DW_TAG_subprogram
DW_AT_low_pc 0x00007128
DW_AT_high_pc 160 <highpc: 0x000071c8>
DW_AT_frame_base len 0x0001: 0x6f:
DW_OP_reg31
DW_AT_specification <0x00000167>
< 2><0x00000472> DW_TAG_formal_parameter
DW_AT_location len 0x0003: 0x91e000:
DW_OP_fbreg 96
DW_AT_name pieces
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/mod.rs
DW_AT_decl_line 0x00000129
DW_AT_type <0x0000031a>

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x000004f2):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00007128 [ 297, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/mod.rs"
0x00007144 [ 298,12] NS PE
0x00007154 [ 0,12]
0x00007160 [ 301,34] NS
0x00007164 [ 301, 9]
0x0000718c [ 302, 6] NS ET EB
0x00007198 [ 0, 6]
0x000071a0 [ 299,13] NS
0x000071c8 [ 299,13] NS ET

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/3j9vqpyocbf7jtty
DW_AT_stmt_list 0x0000040a
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x000071c8
DW_AT_high_pc 16 <highpc: 0x000071d8>

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_namespace
DW_AT_name std
< 2><0x0000002f> DW_TAG_namespace
DW_AT_name process
< 3><0x00000034> DW_TAG_namespace
DW_AT_name {impl#54}
< 4><0x00000039> DW_TAG_subprogram
DW_AT_low_pc 0x000071c8
DW_AT_high_pc 16 <highpc: 0x000071d8>
DW_AT_frame_base len 0x0001: 0x6f:
DW_OP_reg31
DW_AT_linkage_name ZN54$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17hae0029893215e4d9E
DW_AT_name report
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/process.rs
DW_AT_decl_line 0x000008d7
DW_AT_type <0x00000073>
< 5><0x00000057> DW_TAG_formal_parameter
DW_AT_location len 0x0002: 0x910f:
DW_OP_fbreg 15
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/process.rs
DW_AT_decl_line 0x000008d7
DW_AT_type <0x000000ba>
< 5><0x00000062> DW_TAG_variable
DW_AT_location len 0x0002: 0x910e:
DW_OP_fbreg 14
DW_AT_name self
DW_AT_decl_file 0x00000001 /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/process.rs
DW_AT_decl_line 0x000008d7
DW_AT_type <0x000000ba>
< 3><0x00000073> DW_TAG_structure_type
DW_AT_name ExitCode
DW_AT_byte_size 0x00000001
DW_AT_alignment 0x00000001
< 4><0x0000007a> DW_TAG_member
DW_AT_name __0
DW_AT_type <0x0000009b>
DW_AT_alignment 0x00000001
DW_AT_data_member_location 0
< 2><0x00000087> DW_TAG_namespace
DW_AT_name sys
< 3><0x0000008c> DW_TAG_namespace
DW_AT_name unix
< 4><0x00000091> DW_TAG_namespace
DW_AT_name process
< 5><0x00000096> DW_TAG_namespace
DW_AT_name process_common
< 6><0x0000009b> DW_TAG_structure_type
DW_AT_name ExitCode
DW_AT_byte_size 0x00000001
DW_AT_alignment 0x00000001
< 7><0x000000a2> DW_TAG_member
DW_AT_name __0
DW_AT_type <0x000000b3>
DW_AT_alignment 0x00000001
DW_AT_data_member_location 0
< 1><0x000000b3> DW_TAG_base_type
DW_AT_name u8
DW_AT_encoding DW_ATE_unsigned
DW_AT_byte_size 0x00000001
< 1><0x000000ba> DW_TAG_base_type
DW_AT_name ()
DW_AT_encoding DW_ATE_unsigned
DW_AT_byte_size 0x00000000

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x00000976):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x000071c8 [2263, 0] NS uri: "/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/process.rs"
0x000071d0 [2265, 6] NS ET PE EB
0x000071d8 [2265, 6] NS ET

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/59t0y6817yn95h5w
DW_AT_stmt_list 0x0000048f
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x000071d8
DW_AT_high_pc 56 <highpc: 0x00007210>

LOCAL_SYMBOLS:
< 1><0x0000002a> DW_TAG_namespace
DW_AT_name hostpaths
< 2><0x0000002f> DW_TAG_subprogram
DW_AT_low_pc 0x000071d8
DW_AT_high_pc 56 <highpc: 0x00007210>
DW_AT_frame_base len 0x0001: 0x6f:
DW_OP_reg31
DW_AT_linkage_name _ZN9hostpaths4main17h310bbbc6eea9b247E
DW_AT_name main
DW_AT_decl_file 0x00000001 /root/Code/hostpaths/src/main.rs
DW_AT_decl_line 0x00000001
DW_AT_main_subprogram yes(1)

.debug_line: line number info for a single cu
Source lines (from CU-DIE at .debug_info offset 0x00000a38):

        NS new statement, BB new basic block, ET end of text sequence
        PE prologue end, EB epilogue begin
        IS=val ISA number, DI=val discriminator value

[lno,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x000071d8 [ 1, 0] NS uri: "/root/Code/hostpaths/src/main.rs"
0x000071e8 [ 2, 5] NS PE
0x00007204 [ 3, 2] NS ET EB
0x00007210 [ 3, 2] NS ET

COMPILE_UNIT:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name library/std/src/lib.rs/@/std.1826b7b9c036f23b-cgu.0
DW_AT_stmt_list 0x000004d6
DW_AT_comp_dir /rustc/cc66ad468955717ab92600c770da8c1601a4ff33
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00093c20
ranges: 1468 at .debug_ranges offset 605216 (0x00093c20) (23488 bytes)
[ 0] range entry 0x00000001 0x00000001
[ 1] range entry 0x00000001 0x00000001
[ 2] range entry 0x00007258 0x0000727c
[ 3] range entry 0x0000727c 0x000072a0
[ 4] range entry 0x00000001 0x00000001
[ 5] range entry 0x000072a0 0x000072c4
[ 6] range entry 0x00000001 0x00000001
[ 7] range entry 0x00000001 0x00000001
[ 8] range entry 0x00000001 0x00000001
[ 9] range entry 0x00000001 0x00000001
[10] range entry 0x00000001 0x00000001
[11] range entry 0x00000001 0x00000001
[12] range entry 0x00000001 0x00000001
[13] range entry 0x00000001 0x00000001
[14] range entry 0x00000001 0x00000001
[15] range entry 0x00000001 0x00000001
[16] range entry 0x00000001 0x00000001
[17] range entry 0x00000001 0x00000001
[18] range entry 0x00000001 0x00000001
[19] range entry 0x00000001 0x00000001
[20] range entry 0x00000001 0x00000001
[21] range entry 0x00000001 0x00000001
[22] range entry 0x00000001 0x00000001
[23] range entry 0x00000001 0x00000001
[24] range entry 0x00000001 0x00000001
[25] range entry 0x00000001 0x00000001
[26] range entry 0x000072c4 0x000072d0
[27] range entry 0x00000001 0x00000001
[28] range entry 0x00000001 0x00000001
[29] range entry 0x00000001 0x00000001
[30] range entry 0x00000001 0x00000001
[31] range entry 0x00000001 0x00000001
[32] range entry 0x00000001 0x00000001
[33] range entry 0x00000001 0x00000001
[34] range entry 0x00000001 0x00000001

global die-in-sect 0x000dc546, cu-in-sect 0x000dc52e, die-in-cu 0x00000023, cu-header-in-sect 0x000dc523 'int'
global die-in-sect 0x000dc54b, cu-in-sect 0x000dc52e, die-in-cu 0x00000028, cu-header-in-sect 0x000dc523 'mul'
global die-in-sect 0x000dc550, cu-in-sect 0x000dc52e, die-in-cu 0x0000002d, cu-header-in-sect 0x000dc523 'i128_overflowing_mul'
global die-in-sect 0x000dc55c, cu-in-sect 0x000dc52e, die-in-cu 0x00000039, cu-header-in-sect 0x000dc523 '__muloti4'
global die-in-sect 0x000dc569, cu-in-sect 0x000dc52e, die-in-cu 0x00000046, cu-header-in-sect 0x000dc523 'UMulo'
global die-in-sect 0x000dc56e, cu-in-sect 0x000dc52e, die-in-cu 0x0000004b, cu-header-in-sect 0x000dc523 'mulo'
global die-in-sect 0x000dc59d, cu-in-sect 0x000dc58a, die-in-cu 0x0000001e, cu-header-in-sect 0x000dc57f 'core'
global die-in-sect 0x000dc5a2, cu-in-sect 0x000dc58a, die-in-cu 0x00000023, cu-header-in-sect 0x000dc57f 'num'
global die-in-sect 0x000dc5d6, cu-in-sect 0x000dc58a, die-in-cu 0x00000057, cu-header-in-sect 0x000dc57f 'compiler_builtins'
global die-in-sect 0x000dc5db, cu-in-sect 0x000dc58a, die-in-cu 0x0000005c, cu-header-in-sect 0x000dc57f 'int'
global die-in-sect 0x000dc5e0, cu-in-sect 0x000dc58a, die-in-cu 0x00000061, cu-header-in-sect 0x000dc57f '{impl#23}'
global die-in-sect 0x000dc5e5, cu-in-sect 0x000dc58a, die-in-cu 0x00000066, cu-header-in-sect 0x000dc57f 'widen_mul'
global die-in-sect 0x000dc5f3, cu-in-sect 0x000dc58a, die-in-cu 0x00000074, cu-header-in-sect 0x000dc57f '{impl#10}'
global die-in-sect 0x000dc5f8, cu-in-sect 0x000dc58a, die-in-cu 0x00000079, cu-header-in-sect 0x000dc57f 'overflowing_add'
global die-in-sect 0x000dc604, cu-in-sect 0x000dc58a, die-in-cu 0x00000085, cu-header-in-sect 0x000dc57f 'wrapping_mul'
global die-in-sect 0x000dc63e, cu-in-sect 0x000dc61f, die-in-cu 0x0000002a, cu-header-in-sect 0x000dc614 'compiler_builtins'
global die-in-sect 0x000dc643, cu-in-sect 0x000dc61f, die-in-cu 0x0000002f, cu-header-in-sect 0x000dc614 'int'
global die-in-sect 0x000dc648, cu-in-sect 0x000dc61f, die-in-cu 0x00000034, cu-header-in-sect 0x000dc614 'udiv'
global die-in-sect 0x000dc652, cu-in-sect 0x000dc61f, die-in-cu 0x0000003e, cu-header-in-sect 0x000dc614 '__udivti3'
global die-in-sect 0x000dc6a1, cu-in-sect 0x000dc68e, die-in-cu 0x0000001e, cu-header-in-sect 0x000dc683 'compiler_builtins'
global die-in-sect 0x000dc6a6, cu-in-sect 0x000dc68e, die-in-cu 0x00000023, cu-header-in-sect 0x000dc683 'int'
global die-in-sect 0x000dc6ab, cu-in-sect 0x000dc68e, die-in-cu 0x00000028, cu-header-in-sect 0x000dc683 'udiv'
global die-in-sect 0x000dc6b0, cu-in-sect 0x000dc68e, die-in-cu 0x0000002d, cu-header-in-sect 0x000dc683 '__udivti3'
global die-in-sect 0x000dcdfe, cu-in-sect 0x000dcddf, die-in-cu 0x0000002a, cu-header-in-sect 0x000dcdd4 'core'
global die-in-sect 0x000dce03, cu-in-sect 0x000dcddf, die-in-cu 0x0000002f, cu-header-in-sect 0x000dcdd4 'num'
global die-in-sect 0x000dce08, cu-in-sect 0x000dcddf, die-in-cu 0x00000034, cu-header-in-sect 0x000dcdd4 '{impl#10}'
global die-in-sect 0x000dce4c, cu-in-sect 0x000dcddf, die-in-cu 0x00000078, cu-header-in-sect 0x000dcdd4 'wrapping_mul'
global die-in-sect 0x000dce73, cu-in-sect 0x000dcddf, die-in-cu 0x0000009f, cu-header-in-sect 0x000dcdd4 '{impl#9}'
global die-in-sect 0x000dce78, cu-in-sect 0x000dcddf, die-in-cu 0x000000a4, cu-header-in-sect 0x000dcdd4 'checked_div'
global die-in-sect 0x000dceec, cu-in-sect 0x000dcddf, die-in-cu 0x00000118, cu-header-in-sect 0x000dcdd4 '{impl#8}'
global die-in-sect 0x000dcefd, cu-in-sect 0x000dcddf, die-in-cu 0x00000129, cu-header-in-sect 0x000dcdd4 'leading_zeros'
global die-in-sect 0x000dcf16, cu-in-sect 0x000dcddf, die-in-cu 0x00000142, cu-header-in-sect 0x000dcdd4 'unchecked_shl'
global die-in-sect 0x000dcf23, cu-in-sect 0x000dcddf, die-in-cu 0x0000014f, cu-header-in-sect 0x000dcdd4 'wrapping_shl'
global die-in-sect 0x000dcf3d, cu-in-sect 0x000dcddf, die-in-cu 0x00000169, cu-header-in-sect 0x000dcdd4 'wrapping_add'
global die-in-sect 0x000dcf4a, cu-in-sect 0x000dcddf, die-in-cu 0x00000176, cu-header-in-sect 0x000dcdd4 'wrapping_sub'
global die-in-sect 0x000dcf5a, cu-in-sect 0x000dcddf, die-in-cu 0x00000186, cu-header-in-sect 0x000dcdd4 'compiler_builtins'
global die-in-sect 0x000dcf5f, cu-in-sect 0x000dcddf, die-in-cu 0x0000018b, cu-header-in-sect 0x000dcdd4 'int'
global die-in-sect 0x000dcf64, cu-in-sect 0x000dcddf, die-in-cu 0x00000190, cu-header-in-sect 0x000dcdd4 'specialized_div_rem'
global die-in-sect 0x000dcf69, cu-in-sect 0x000dcddf, die-in-cu 0x00000195, cu-header-in-sect 0x000dcdd4 'u64_by_u64_div_rem'
global die-in-sect 0x000dcf7a, cu-in-sect 0x000dcddf, die-in-cu 0x000001a6, cu-header-in-sect 0x000dcdd4 'carrying_mul'
global die-in-sect 0x000dcf86, cu-in-sect 0x000dcddf, die-in-cu 0x000001b2, cu-header-in-sect 0x000dcdd4 'carrying_mul_add'
global die-in-sect 0x000dcf93, cu-in-sect 0x000dcddf, die-in-cu 0x000001bf, cu-header-in-sect 0x000dcdd4 'u128_div_rem'
global die-in-sect 0x000dd18d, cu-in-sect 0x000dcddf, die-in-cu 0x000003b9, cu-header-in-sect 0x000dcdd4 'u64_normalization_shift'
global die-in-sect 0x000dd199, cu-in-sect 0x000dcddf, die-in-cu 0x000003c5, cu-header-in-sect 0x000dcdd4 'u64_div_rem'
global die-in-sect 0x000dd270, cu-in-sect 0x000dcddf, die-in-cu 0x0000049c, cu-header-in-sect 0x000dcdd4 'u32_normalization_shift'
global die-in-sect 0x000dd27c, cu-in-sect 0x000dcddf, die-in-cu 0x000004a8, cu-header-in-sect 0x000dcdd4 'u32_div_rem'

.debug_str
name at offset 0x00000000, length 56 is 'clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))'
name at offset 0x00000039, length 30 is 'src/main.rs/@/1x7unpbrf03a8pv0'
name at offset 0x00000058, length 20 is '/root/Code/hostpaths'
name at offset 0x0000006d, length 4 is 'core'
name at offset 0x00000072, length 43 is '_ZN4core4hint9black_box17h0489e5e106d4c941E'
name at offset 0x0000009e, length 13 is 'black_box<()>'
name at offset 0x000000ac, length 5 is 'dummy'
name at offset 0x000000b2, length 3 is 'std'
name at offset 0x000000b6, length 10 is 'sys_common'
name at offset 0x000000c1, length 9 is 'backtrace'
name at offset 0x000000cb, length 4 is 'fn()'
name at offset 0x000000d0, length 1 is 'F'
name at offset 0x000000d2, length 79 is '_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h020da3e7b890d5afE'
name at offset 0x00000122, length 38 is '__rust_begin_short_backtrace<fn(), ()>'
name at offset 0x00000149, length 6 is 'result'
name at offset 0x00000150, length 30 is 'src/main.rs/@/28rm0kdzpfe7ey5o'
name at offset 0x0000016f, length 83 is '<std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable}'
name at offset 0x000001c3, length 13 is 'drop_in_place'
name at offset 0x000001d1, length 9 is '*const ()'
name at offset 0x000001db, length 9 is '__method3'
name at offset 0x000001e5, length 9 is '__method4'
name at offset 0x000001ef, length 9 is '__method5'
name at offset 0x000001f9, length 10 is 'lang_start'
name at offset 0x00000204, length 4 is 'main'
name at offset 0x00000209, length 88 is '<std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable_type}'
name at offset 0x00000262, length 3 is 'sys'
name at offset 0x00000266, length 4 is 'unix'
name at offset 0x0000026b, length 14 is 'process_common'
name at offset 0x0000027a, length 3 is '__0'
name at offset 0x0000027e, length 76 is '_ZN3std3sys4unix7process14process_common8ExitCode6as_i3217h4183bdb7d9dab282E'
name at offset 0x000002cb, length 6 is 'as_i32'
name at offset 0x000002d2, length 50 is '&std::sys::unix::process::process_common::ExitCode'
name at offset 0x00000305, length 4 is 'self'
name at offset 0x0000030a, length 51 is '_ZN3std7process8ExitCode6to_i3217hf3c1d142668369a2E'
name at offset 0x0000033e, length 6 is 'to_i32'
name at offset 0x00000345, length 42 is '_ZN3std2rt10lang_start17hcc825410e97d6fa6E'
name at offset 0x00000370, length 14 is 'lang_start<()>'
name at offset 0x0000037f, length 5 is 'isize'
name at offset 0x00000385, length 72 is 'ZN3std2rt10lang_start28$u7b$$u7b$closure$u7d$$u7d$17h8192fb3172ff855bE'
name at offset 0x000003ce, length 15 is '{closure#0}<()>'
name at offset 0x000003de, length 4 is 'argc'
name at offset 0x000003e3, length 4 is 'argv'
name at offset 0x000003e8, length 16 is '*const *const u8'
name at offset 0x000003f9, length 30 is 'src/main.rs/@/2myp2rgsftcdybvl'
name at offset 0x00000418, length 3 is 'ops'
name at offset 0x0000041c, length 8 is 'function'
name at offset 0x00000425, length 6 is 'FnOnce'
name at offset 0x0000042c, length 4 is 'Self'
name at offset 0x00000431, length 4 is 'Args'
name at offset 0x00000436, length 90 is '_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h6ec275a85f4af5e3E'
name at offset 0x00000491, length 55 is 'call_once<std::rt::lang_start::{closure_env#0}<()>, ()>'
name at offset 0x000004c9, length 58 is '_ZN4core3ops8function6FnOnce9call_once17h167e44184967ae57E'
name at offset 0x00000504, length 19 is 'call_once<fn(), ()>'

name at offset 0x0015221e, length 16 is 'FEAT_SVE_BITPERM'
name at offset 0x0015222f, length 12 is 'FEAT_SME_F64'
name at offset 0x0015223c, length 77 is '/cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.98'
name at offset 0x0015228a, length 10 is 'FEAT_FLAGM'
name at offset 0x00152295, length 9 is 'FEAT_DPB2'
name at offset 0x0015229f, length 9 is 'FEAT_SME2'
name at offset 0x001522a9, length 8 is 'FEAT_DPB'
name at offset 0x001522b2, length 11 is 'FEAT_MEMTAG'
name at offset 0x001522be, length 8 is 'FEAT_DIT'
name at offset 0x001522c7, length 12 is 'FEAT_FRINTTS'
name at offset 0x001522d4, length 8 is 'FEAT_AES'
name at offset 0x001522dd, length 13 is 'FEAT_SVE_I8MM'
name at offset 0x001522eb, length 17 is 'FEAT_LS64_ACCDATA'
name at offset 0x001522fd, length 165 is 'GNU C17 8.5.0 -mlittle-endian -mabi=lp64 -gdwarf-4 -O3 -ffunction-sections -fdata-sections -fPIC -fno-builtin -fvisibility=hidden -ffreestanding -fomit-frame-pointer'
name at offset 0x001523a3, length 7 is 'FEAT_FP'
name at offset 0x001523ab, length 8 is 'FEAT_RNG'
name at offset 0x001523b4, length 13 is 'FEAT_SVE_SHA3'
name at offset 0x001523c2, length 11 is 'FEAT_FLAGM2'
name at offset 0x001523ce, length 10 is 'FEAT_PMULL'
name at offset 0x001523d9, length 10 is 'FEAT_RCPC2'
name at offset 0x001523e4, length 134 is '/cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.100/src/lib.rs/@/compiler_builtins.fbde4e3a12289b66-cgu.006'
name at offset 0x0015246b, length 71 is 'ZN4core3num22$LT$impl$u20$u128$GT$13leading_zeros17hc016392c4977122fE'
name at offset 0x001524b3, length 68 is 'ZN4core3num21$LT$impl$u20$u64$GT$11checked_div17he5b4c59432d5a6d4E'
name at offset 0x001524f8, length 19 is 'specialized_div_rem'
name at offset 0x0015250c, length 87 is '_ZN17compiler_builtins3int19specialized_div_rem18u64_by_u64_div_rem17h5cf15bf623998f8fE'
name at offset 0x00152564, length 18 is 'u64_by_u64_div_rem'
name at offset 0x00152577, length 12 is 'u128_div_rem'
name at offset 0x00152584, length 95 is '_ZN17compiler_builtins3int19specialized_div_rem12u128_div_rem12carrying_mul17h1278e4bd287f5835E'
name at offset 0x001525e4, length 99 is '_ZN17compiler_builtins3int19specialized_div_rem12u128_div_rem16carrying_mul_add17h3b04855146f01876E'
name at offset 0x00152648, length 16 is 'carrying_mul_add'
name at offset 0x00152659, length 70 is 'ZN4core3num22$LT$impl$u20$u128$GT$12wrapping_add17ha1d62e3ed0b909f1E'
name at offset 0x001526a0, length 92 is '_ZN17compiler_builtins3int19specialized_div_rem23u64_normalization_shift17h29db280630d8f8ddE'
name at offset 0x001526fd, length 23 is 'u64_normalization_shift'
name at offset 0x00152715, length 70 is 'ZN4core3num21$LT$impl$u20$u64$GT$13unchecked_shl17h013be78670b403d0E'
name at offset 0x0015275c, length 69 is 'ZN4core3num21$LT$impl$u20$u64$GT$12wrapping_shl17h2ed399b68cbf51c5E'
name at offset 0x001527a2, length 92 is '_ZN17compiler_builtins3int19specialized_div_rem23u32_normalization_shift17h499e047d9296d51eE'
name at offset 0x001527ff, length 23 is 'u32_normalization_shift'
name at offset 0x00152817, length 81 is '_ZN17compiler_builtins3int19specialized_div_rem12u128_div_rem17h597f8ddaf6c54e22E'
name at offset 0x00152869, length 80 is '_ZN17compiler_builtins3int19specialized_div_rem11u64_div_rem17hd92fbf8e8c932120E'
name at offset 0x001528ba, length 80 is '_ZN17compiler_builtins3int19specialized_div_rem11u32_div_rem17hd33109245e823d1eE'
name at offset 0x0015290b, length 11 is 'u32_div_rem'

.debug_aranges

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/1x7unpbrf03a8pv0
DW_AT_stmt_list 0x00000000
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00006fd4
DW_AT_high_pc 32 <highpc: 0x00006ff4>

arange starts at 0x00006fd4, length of 0x00000020, cu_die_offset = 0x0000000b
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/28rm0kdzpfe7ey5o
DW_AT_stmt_list 0x000000fb
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00000060
ranges: 3 at .debug_ranges offset 96 (0x00000060) (48 bytes)
[ 0] range entry 0x00006ff4 0x0000705c
[ 1] range entry 0x0000705c 0x0000708c
[ 2] range end 0x00000000 0x00000000

arange starts at 0x0005f640, length of 0x00000030, cu_die_offset = 0x000000ef
arange starts at 0x00006ff4, length of 0x00000068, cu_die_offset = 0x000000ef
arange starts at 0x0000705c, length of 0x00000030, cu_die_offset = 0x000000ef
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/2myp2rgsftcdybvl
DW_AT_stmt_list 0x0000022a
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00000090
ranges: 5 at .debug_ranges offset 144 (0x00000090) (80 bytes)
[ 0] range entry 0x0000708c 0x000070b0
[ 1] range entry 0x000070b0 0x000070cc
[ 2] range entry 0x000070cc 0x00007118
[ 3] range entry 0x00007118 0x00007128
[ 4] range end 0x00000000 0x00000000

arange starts at 0x0000708c, length of 0x00000024, cu_die_offset = 0x00000364
arange starts at 0x000070b0, length of 0x0000001c, cu_die_offset = 0x00000364
arange starts at 0x000070cc, length of 0x0000004c, cu_die_offset = 0x00000364
arange starts at 0x00007118, length of 0x00000010, cu_die_offset = 0x00000364
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/3859zwxehh9zy90t
DW_AT_stmt_list 0x00000361
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00007128
DW_AT_high_pc 160 <highpc: 0x000071c8>

arange starts at 0x00007128, length of 0x000000a0, cu_die_offset = 0x000004f2
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/3j9vqpyocbf7jtty
DW_AT_stmt_list 0x0000040a
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x000071c8
DW_AT_high_pc 16 <highpc: 0x000071d8>

arange starts at 0x000071c8, length of 0x00000010, cu_die_offset = 0x00000976
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name src/main.rs/@/59t0y6817yn95h5w
DW_AT_stmt_list 0x0000048f
DW_AT_comp_dir /root/Code/hostpaths
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x000071d8
DW_AT_high_pc 56 <highpc: 0x00007210>

arange starts at 0x000071d8, length of 0x00000038, cu_die_offset = 0x00000a38
arange end

COMPILE_UNIT

:
< 0><0x0000000b> DW_TAG_compile_unit
DW_AT_producer clang LLVM (rustc version 1.73.0 (cc66ad4 2023-10-03))
DW_AT_language DW_LANG_Rust
DW_AT_name library/std/src/lib.rs/@/std.1826b7b9c036f23b-cgu.0
DW_AT_stmt_list 0x000004d6
DW_AT_comp_dir /rustc/cc66ad468955717ab92600c770da8c1601a4ff33
DW_AT_GNU_pubnames yes(1)
DW_AT_low_pc 0x00000000
DW_AT_ranges 0x00093c20
ranges: 1468 at .debug_ranges offset 605216 (0x00093c20) (23488 bytes)
[ 0] range entry 0x00000001 0x00000001
[ 1] range entry 0x00000001 0x00000001
[ 2] range entry 0x00007258 0x0000727c
[ 3] range entry 0x0000727c 0x000072a0
[ 4] range entry 0x00000001 0x00000001
[ 5] range entry 0x000072a0 0x000072c4
[ 6] range entry 0x00000001 0x00000001
[ 7] range entry 0x00000001 0x00000001
[ 8] range entry 0x00000001 0x00000001
[ 9] range entry 0x00000001 0x00000001
[10] range entry 0x00000001 0x00000001
[11] range entry 0x00000001 0x00000001
[12] range entry 0x00000001 0x00000001
[13] range entry 0x00000001 0x00000001
[14] range entry 0x00000001 0x00000001
[15] range entry 0x00000001 0x00000001
[16] range entry 0x00000001 0x00000001
[17] range entry 0x00000001 0x00000001
[18] range entry 0x00000001 0x00000001
[19] range entry 0x00000001 0x00000001
[20] range entry 0x00000001 0x00000001
[21] range entry 0x00000001 0x00000001
[22] range entry 0x00000001 0x00000001
[23] range entry 0x00000001 0x00000001
[24] range entry 0x00000001 0x00000001
[25] range entry 0x00000001 0x00000001
[26] range entry 0x000072c4 0x000072d0
[27] range entry 0x00000001 0x00000001
[28] range entry 0x00000001 0x00000001
[29] range entry 0x00000001 0x00000001
[30] range entry 0x00000001 0x00000001

</details>

@bjorn3
Copy link
Member

bjorn3 commented Oct 21, 2023

Yeah, Linux. Looks like both the DW_AT_comp_dir (compilation directory) and the line table don't have the remapping applied. I can't reproduce this locally with rustc 1.72.1 and 1.73.0. Did I do something different than you?

$cd /tmp
$ cargo new foo
$ cd foo
$ mkdir .cargo
$ cat > .cargo/config.toml <<EOF
$ [build]
$ rustflags = ["--remap-path-prefix=/tmp/foo=/bar"]
$ EOF
$ cat > src/main.rs <<EOF
fn main() {
    println!("Hello, world!");
}
EOF
$ cargo build
$ dwarfdump target/debug/foo | grep /tmp
$ dwarfdump target/debug/foo | grep /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                        DW_AT_decl_file             0x00000001 /bar/src/main.rs
0x00008a70  [   1, 0] NS uri: "/bar/src/main.rs"
                              DW_AT_decl_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                              DW_AT_decl_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                              DW_AT_decl_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                              DW_AT_decl_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                              DW_AT_decl_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
                                DW_AT_call_file             0x000000db /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs
0x00000000  [  63, 0] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x00000048  [ 131, 9] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x00000079  [ 141,13] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x000000e6  [ 132,12] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x000001ac  [ 136,39] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x000001c6  [ 135,19] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
0x00000000  [ 150, 0] NS uri: "/rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sync/barrier.rs"
name at offset 0x00000058, length    4 is '/bar'
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar
                    DW_AT_comp_dir              /bar

@abrisco
Copy link
Author

abrisco commented Oct 21, 2023

I can't reproduce this locally with rustc 1.72.1 and 1.73.0. Did I do something different than you?

Crap, I messed up the repro on linux. Linux appears to be working correctly for this case, though I have some other much more complicated cases where I see this. I'll try to get info there. Otherwise, the macOS case is still very reproducible if someone out there knows how to dig deeper. I'll do my best to learn about the Mach-O format too

@bjorn3
Copy link
Member

bjorn3 commented Oct 21, 2023

Could you send me a macOS executable with this issue? I could try if I can dig into it locally with llvm-objdump or some other tool that can read Mach-O files on Linux.

@abrisco
Copy link
Author

abrisco commented Oct 21, 2023

Could you send me a macOS executable with this issue? I could try if I can dig into it locally with llvm-objdump or some other tool that can read Mach-O files on Linux.

~/Code/hostpaths (master ✗) shasum -a 256 ./target/debug/hostpaths
1ca79fabc8c363f539c321702e07015ddc0b5903405332a3d3bab239a279f400  ./target/debug/hostpaths
~/Code/hostpaths (master ✗) shasum -a 256 ./target/debug/hostpaths.zip
0464c83b5d6280e375251fc431b6e43ba4b3980b9a0685cd3b96eda6b9961550  ./target/debug/hostpaths.zip

hostpaths.zip

@bjorn3
Copy link
Member

bjorn3 commented Oct 21, 2023

Looks like all references to the andrebrisco string are inside the symbol table and in particular are pointing to the object files. I believe this is used by dsymutil to find all object files again after linking to pack their debuginfo into a .dSYM bundle. macOS's linker seems to have a -oso_prefix option to remove a given prefix for these paths, but I don't know if calling it multiple times is allowed and you will break rustc's invocation of dsymutil with this as there is no way to pass options to the dsymutil invoked by rustc.

https://milen.me/writings/apple-linker-ld64-deterministic-builds-oso-prefix/

Could you try passing -Clink-arg=-Wl,-oso_prefix,/Users/andrebrisco in rustflags and see if that removes all mentions to andrebrisco? With that value you still get the paths relative to your home dir. You could try if multiple more specific prefixes would be accepted by the linker.

@bjorn3 bjorn3 added O-macos Operating system: macOS A-reproducibility Area: Reproducible / Deterministic builds labels Oct 21, 2023
@abrisco
Copy link
Author

abrisco commented Oct 21, 2023

Building debug still includes these symbols but not for release

~/Code/hostpaths (master ✗) cargo build --verbose
   Compiling hostpaths v0.1.0 (/Users/andrebrisco/Code/hostpaths)
     Running `/Users/andrebrisco/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name hostpaths --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=339 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C metadata=cab8592e56686741 -C extra-filename=-cab8592e56686741 --out-dir /Users/andrebrisco/Code/hostpaths/target/debug/deps -C incremental=/Users/andrebrisco/Code/hostpaths/target/debug/incremental -L dependency=/Users/andrebrisco/Code/hostpaths/target/debug/deps --remap-path-prefix=/root/andrebrisco/Code/hostpaths=. --remap-path-prefix=/Users/andrebrisco/.rustup=. -Clink-arg=-Wl,-oso_prefix,/Users/andrebrisco`
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
~/Code/hostpaths (master ✗) xxd ./target/debug/hostpaths | grep andrebrisco -C10
0006ff40: 6535 4500 2f55 7365 7273 2f61 6e64 7265  e5E./Users/andre
0006ff50: 6272 6973 636f 2f43 6f64 652f 686f 7374  brisco/Code/host
0006ff60: 7061 7468 732f 7372 632f 6d61 696e 2e72  paths/src/main.r
0006ff70: 732f 402f 0032 3062 7078 3474 6e76 6732  s/@/.20bpx4tnvg2
0006ff80: 7066 6334 3300 2f43 6f64 652f 686f 7374  pfc43./Code/host
0006ff90: 7061 7468 732f 7461 7267 6574 2f64 6562  paths/target/deb
0006ffa0: 7567 2f64 6570 732f 686f 7374 7061 7468  ug/deps/hostpath
0006ffb0: 732d 6361 6238 3539 3265 3536 3638 3637  s-cab8592e566867
0006ffc0: 3431 2e32 3062 7078 3474 6e76 6732 7066  41.20bpx4tnvg2pf
0006ffd0: 6334 332e 7263 6775 2e6f 002f 5573 6572  c43.rcgu.o./User
0006ffe0: 732f 616e 6472 6562 7269 7363 6f2f 436f  s/andrebrisco/Co
0006fff0: 6465 2f68 6f73 7470 6174 6873 2f73 7263  de/hostpaths/src
00070000: 2f6d 6169 6e2e 7273 2f40 2f00 3234 6564  /main.rs/@/.24ed
00070010: 6d6b 786a 6a72 3834 6574 6578 002f 436f  mkxjjr84etex./Co
00070020: 6465 2f68 6f73 7470 6174 6873 2f74 6172  de/hostpaths/tar
00070030: 6765 742f 6465 6275 672f 6465 7073 2f68  get/debug/deps/h
00070040: 6f73 7470 6174 6873 2d63 6162 3835 3932  ostpaths-cab8592
00070050: 6535 3636 3836 3734 312e 3234 6564 6d6b  e56686741.24edmk
00070060: 786a 6a72 3834 6574 6578 2e72 6367 752e  xjjr84etex.rcgu.
00070070: 6f00 2f55 7365 7273 2f61 6e64 7265 6272  o./Users/andrebr
00070080: 6973 636f 2f43 6f64 652f 686f 7374 7061  isco/Code/hostpa
00070090: 7468 732f 7372 632f 6d61 696e 2e72 732f  ths/src/main.rs/
000700a0: 402f 0032 7778 6562 7261 7876 3364 3566  @/.2wxebraxv3d5f
000700b0: 6a63 6600 2f43 6f64 652f 686f 7374 7061  jcf./Code/hostpa
000700c0: 7468 732f 7461 7267 6574 2f64 6562 7567  ths/target/debug
000700d0: 2f64 6570 732f 686f 7374 7061 7468 732d  /deps/hostpaths-
000700e0: 6361 6238 3539 3265 3536 3638 3637 3431  cab8592e56686741
000700f0: 2e32 7778 6562 7261 7876 3364 3566 6a63  .2wxebraxv3d5fjc
00070100: 662e 7263 6775 2e6f 002f 5573 6572 732f  f.rcgu.o./Users/
00070110: 616e 6472 6562 7269 7363 6f2f 436f 6465  andrebrisco/Code
00070120: 2f68 6f73 7470 6174 6873 2f73 7263 2f6d  /hostpaths/src/m
00070130: 6169 6e2e 7273 2f40 2f00 3278 7377 7538  ain.rs/@/.2xswu8
00070140: 306f 7a64 3178 3465 7472 002f 436f 6465  0ozd1x4etr./Code
00070150: 2f68 6f73 7470 6174 6873 2f74 6172 6765  /hostpaths/targe
00070160: 742f 6465 6275 672f 6465 7073 2f68 6f73  t/debug/deps/hos
00070170: 7470 6174 6873 2d63 6162 3835 3932 6535  tpaths-cab8592e5
00070180: 3636 3836 3734 312e 3278 7377 7538 306f  6686741.2xswu80o
00070190: 7a64 3178 3465 7472 2e72 6367 752e 6f00  zd1x4etr.rcgu.o.
000701a0: 2f55 7365 7273 2f61 6e64 7265 6272 6973  /Users/andrebris
000701b0: 636f 2f43 6f64 652f 686f 7374 7061 7468  co/Code/hostpath
~/Code/hostpaths (master ✗) cargo build --release --verbose
   Compiling hostpaths v0.1.0 (/Users/andrebrisco/Code/hostpaths)
     Running `/Users/andrebrisco/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name hostpaths --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=339 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=5e58aa546f3141ad -C extra-filename=-5e58aa546f3141ad --out-dir /Users/andrebrisco/Code/hostpaths/target/release/deps -L dependency=/Users/andrebrisco/Code/hostpaths/target/release/deps --remap-path-prefix=/root/andrebrisco/Code/hostpaths=. --remap-path-prefix=/Users/andrebrisco/.rustup=. -Clink-arg=-Wl,-oso_prefix,/Users/andrebrisco`
    Finished release [optimized] target(s) in 0.15s
~/Code/hostpaths (master ✗) xxd ./target/release/hostpaths | grep andrebrisco -C10

@bjorn3
Copy link
Member

bjorn3 commented Oct 21, 2023

Great! Release builds being reproducible is much more important than debug builds being reproducible, right? I could take a look at the debug case to see if that one can be made reproducible too if you want though. I will need the debug mode executable for that.

@bjorn3
Copy link
Member

bjorn3 commented Oct 21, 2023

Also could you try if -Cstrip=debuginfo instead of -Clink-arg=-Wl,-oso_prefix,/Users/andrebrisco works too for the release mode case?

@abrisco
Copy link
Author

abrisco commented Oct 21, 2023

Also could you try if -Cstrip=debuginfo instead of -Clink-arg=-Wl,-oso_prefix,/Users/andrebrisco works too for the release mode case?

This works for the release and debug variants. Incredible to know! Does this mean the debug info is not controlled by rustc? Also, how did you identify where the username was in the macOS binary?

@bjorn3
Copy link
Member

bjorn3 commented Oct 22, 2023

-Cstrip=debuginfo will make rustc either tell the linker to skip debuginfo when linking, or will invoke strip to remove all debuginfo from the executable. In the case of macOS the second option is used. It seems that strip on macOS will remove the OSO symbol entries that contain these paths.

Also, how did you identify where the username was in the macOS binary?

I looked at it using llvm-objdump --full-contents and noticed that I couldn't find your username anywhere in the output. But when I opened it in Ghidra I could clearly see your username. After a bit I noticed that around the places where your username was mentioned a lot of strings that looked like symbol names were placed. I then used llvm-objdump --syms and indeed found these paths. I remembered something about how dsymutil uses information embedded in the linked executable to find the original object files. After a bit of searching I found mentions of the -oso_prefix linker flag.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 29, 2023
@weihanglo
Copy link
Member

The issue is that macOS default linker always generates OSO symbols with absolute paths. I hightly recommend this blog post bjorn3 previously shared.

Let's first see how other tools do. Buck build system use a "postprocess" approach to "relativize" those paths. Buck2 and Bazel, clever enough, just uses -oso_prefix.

Like bjorn3 says, -oso_prefix flag in ld removes those paths from object files, and rustc might want to leverage that. However, -oso_prefix was introduced in Xcode 11. That means the flag is available only on macOS Catalina 10.15 or later, whereas the minimal support macOS version is "Sierra+ 10.12+". Rustc cannot rely on -oso_prefix to remap those paths.

I am seeing this as a bug of --remap-path-prefix flag. We might want to use -oso_prefix someday, but maybe not now. Is it worthy pursuing a postprocess like buck does?


BTW, this is a small reproducer if people want to play with the options:

mkdir rustc-oso
pushd rustc-oso
echo "fn main() {}" >> main.rs

rustc main.rs -g
nm -pa main | grep "$HOME" # find both `SO` and `OSO` symbols

rustc main.rs -g --remap-path-prefix="$HOME"=
nm -pa main | grep "$HOME" # find only `OSO` symbols

rustc main.rs -g -Clink-arg="-Wl,-oso_prefix,$HOME"
nm -pa main | grep "$HOME" # find only `SO` symbols

rustc main.rs -g --remap-path-prefix="$HOME"= -Clink-arg="-Wl,-oso_prefix,$HOME"
nm -pa main | grep "$HOME" # all paths were removed!

popd

@BlackHoleFox
Copy link
Contributor

Like bjorn3 says, -oso_prefix flag in ld removes those paths from object files, and rustc might want to leverage that. However, -oso_prefix was introduced in Xcode 11. That means the flag is available only on macOS Catalina 10.15 or later, whereas the minimal support macOS version is "Sierra+ 10.12+". Rustc cannot rely on -oso_prefix to remap those paths.

Is it that -oso_prefix was introduced in XCode 11 and only works if you're using 11+ versions of Xcode or are the generated object files unusable on macOS versions before 10.15 for compatibility reasons?

@weihanglo
Copy link
Member

Is it that -oso_prefix was introduced in XCode 11 and only works if you're using 11+ versions of Xcode or are the generated object files unusable on macOS versions before 10.15 for compatibility reasons?

Not sure about the latter since I don't have any personal device old enough to verify that, but OSO symbols iiuc are for debugging purpose so should be fine if you don't debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-reproducibility Area: Reproducible / Deterministic builds C-bug Category: This is a bug. O-macos Operating system: macOS
Projects
None yet
Development

No branches or pull requests

6 participants