Objdump can’t parse our Linux debug information #30016

issue laanwj openend this issue on May 1, 2024
  1. laanwj commented at 8:37 pm on May 1, 2024: member

    Upstream issue: https://sourceware.org/bugzilla/show_bug.cgi?id=31692

    The debug information in the shipped .dbg artifacts seems to be unusable for objdump. The .debug_info section is corrupt:

    0$ tar -zxvf bitcoin-27.0-x86_64-linux-gnu-debug.tar.gz
    1$ objdump -Wi bitcoin-27.0/bin/bitcoin-cli.dbg
    2
    3Section '.debug_info' has an invalid size: 0.
    4
    5bitcoin-27.0/bin/bitcoin-cli.dbg:     file format elf64-x86-64
    6
    7Section '.debug_info' has an invalid size: 0.
    

    i’ve checked various Linux architectures (at least x86_64, ARM, RISC-V) and the same issue exists there. Interestingly, the Windows build is unaffected. Maybe because of a different gcc/binutils? Builds outside guix seem unaffected.

    My first thought is that something goes wrong while splitting the debug symbols. However, the unsplitted binaries suffer from the same problem:

    0$ objdump -Wi guix-build-27.0/distsrc-27.0-x86_64-linux-gnu/src/bitcoind
    1
    2Section '.debug_info' has an invalid size: 0
    

    This issue affects at least release 27.0 and current master.

    Edit: Looks like there is a .debug_info section in the files. objdump -s -j .debug_info bitcoin-27.0/bin/bitcoind.dbg shows contents, so it’s not really size 0. But it can’t be parsed somehow.

  2. laanwj added the label Build system on May 1, 2024
  3. laanwj assigned laanwj on May 1, 2024
  4. laanwj commented at 9:23 pm on May 1, 2024: member

    Okay, may be a objdump bug actually?

    readelf -wi (which should be equivalent to objdump -Wi) parses the same section fine. So does gdb it seems?

    (FWIW i did try various versions of objdump before reporting this)

  5. laanwj commented at 9:24 pm on May 1, 2024: member

    Closing for now.

    edit: It’s this objdump bug in dealing with compressed debug info sections: https://sourceware.org/bugzilla/show_bug.cgi?id=24319 which was supposedly fixed but… sigh

  6. laanwj closed this on May 1, 2024

  7. laanwj renamed this:
    Linux debug information for release is broken
    Objdump can't parse our Linux debug information
    on May 2, 2024
  8. laanwj added the label Upstream on May 2, 2024
  9. laanwj commented at 6:04 am on May 2, 2024: member

    Reopening with more accurate title (phew).

    Filed upstream issue: https://sourceware.org/bugzilla/show_bug.cgi?id=31692

  10. laanwj reopened this on May 2, 2024

  11. fanquake commented at 7:42 am on May 2, 2024: member

    Interestingly, the Windows build is unaffected. Maybe because of a different gcc/binutils?

    This is probably because the Windows Binutils is configured without support for compressed debug sections, as it was, iirc, causing other windows build issues.

  12. laanwj commented at 7:47 am on May 2, 2024: member

    This is probably because the Windows Binutils is configured without support for compressed debug sections, as it was, iirc, causing other windows build issues.

    Right, that makes sense. DWARF in PE binaires is a quite peculiar concept in the first place–heck, GNU even has its own way to encode the long section names needed: lief-project/LIEF#1043. i’m not surprised it’s not set up to handle compressed sections.

  13. laanwj closed this on May 2, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me