Bug#931962: diffoscope: Doesn't behave nicely in the face of NOBITS eh_frame

Mike Hommey mh+reportbug at glandium.org
Sat Jul 13 01:50:55 BST 2019


Package: diffoscope
Version: 117
Severity: important

Dear Maintainer,

When comparing Debian debug packages, diffoscope ends up showing hexdump
diffs, when it could, in fact, output much nicer diffs.

The two attached files are a small .debug file from two
jenkins.debian.net firefox debug package builds, that differ because of
missing -fdebug-prefix-map flags.

When comparing them, the output looks like:
--- /tmp/41aa9e49143d7d5d4fb5e05623976b644573b2.debug
+++ /tmp/b70f29bd619ba23d3879579b19209fda75ea3b.debug
│┄ Command `readelf --wide --debug-dump=frames /tmp/41aa9e49143d7d5d4fb5e05623976b644573b2.debug` exited with 1.
Output:
│┄ <none>
@@ -30,161 +30,161 @@
 000001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 000001f0: 0000 0000 0000 0000 1000 0000 0000 0000  ................
 00000200: 52e5 7464 0400 0000 d00d 0000 0000 0000  R.td............
 00000210: d03d 0000 0000 0000 d03d 0000 0000 0000  .=.......=......
 00000220: 0000 0000 0000 0000 3002 0000 0000 0000  ........0.......
 00000230: 0100 0000 0000 0000 0400 0000 1400 0000  ................
-00000240: 0300 0000 474e 5500 3341 aa9e 4914 3d7d  ....GNU.3A..I.=}
-00000250: 5d4f b5e0 5623 976b 6445 73b2 4743 433a  ]O..V#.kdEs.GCC:
+00000240: 0300 0000 474e 5500 a8b7 0f29 bd61 9ba2  ....GNU....).a..
+00000250: 3d38 7957 9b19 209f da75 ea3b 4743 433a  =8yW.. ..u.;GCC:
 00000260: 2028 4465 6269 616e 2038 2e33 2e30 2d31   (Debian 8.3.0-1
 00000270: 3929 2038 2e33 2e30 0001 0000 0000 0000  9) 8.3.0........
 00000280: 00f0 0000 0000 0000 0001 0000 0000 0000  ................
 00000290: 0078 9c7b c3c0 c0c0 c400 021c 6032 4000  .x.{........`2 at .
 000002a0: 4c31 0842 2886 4434 7e11 1abf 198d 3f05  L1.B(.D4~.....?.
etc.

First, there's the problem that diffoscope only displays readelf's
stdout, and its stderr is lost, which it contains the most important
information:
  section '.eh_frame' has the NOBITS type - its contents are unreliable.

Second, this skips everything else that diffoscope would normally do,
instead of falling back to a hexdump diff of the concerned section only.

With a readelf wrapper that always exits 0, this is what the output
looks like:
--- /tmp/41aa9e49143d7d5d4fb5e05623976b644573b2.debug
+++ /tmp/b70f29bd619ba23d3879579b19209fda75ea3b.debug
├ readelf --wide --sections {}
│ @@ -23,19 +23,19 @@
│    [18] .dynamic          NOBITS          0000000000003de0 000dd0 000200 10  WA  4   0  8
│    [19] .got              NOBITS          0000000000003fe0 000dd0 000020 08  WA  0   0  8
│    [20] .got.plt          NOBITS          0000000000004000 000dd0 000020 08  WA  0   0  8
│    [21] .data             NOBITS          0000000000004020 000dd0 000008 00  WA  0   0  8
│    [22] .bss              NOBITS          0000000000004028 000dd0 000008 00  WA  0   0  1
│    [23] .comment          PROGBITS        0000000000000000 00025c 00001d 01  MS  0   0  1
│    [24] .debug_aranges    PROGBITS        0000000000000000 000279 00005a 00   C  0   0  1
│ -  [25] .debug_info       PROGBITS        0000000000000000 0002d3 000330 00   C  0   0  1
│ -  [26] .debug_abbrev     PROGBITS        0000000000000000 000603 0000da 00   C  0   0  1
│ -  [27] .debug_line       PROGBITS        0000000000000000 0006dd 000176 00   C  0   0  1
│ -  [28] .debug_str        PROGBITS        0000000000000000 000853 0002c3 01 MSC  0   0  1
│ -  [29] .debug_ranges     PROGBITS        0000000000000000 000b16 00004e 00   C  0   0  1
│ +  [25] .debug_info       PROGBITS        0000000000000000 0002d3 00032e 00   C  0   0  1
│ +  [26] .debug_abbrev     PROGBITS        0000000000000000 000601 0000da 00   C  0   0  1
│ +  [27] .debug_line       PROGBITS        0000000000000000 0006db 000176 00   C  0   0  1
│ +  [28] .debug_str        PROGBITS        0000000000000000 000851 0002c4 01 MSC  0   0  1
│ +  [29] .debug_ranges     PROGBITS        0000000000000000 000b15 00004e 00   C  0   0  1
│    [30] .symtab           SYMTAB          0000000000000000 000b68 000690 18     31  49  8
│    [31] .strtab           STRTAB          0000000000000000 0011f8 0002ca 00      0   0  1
│    [32] .shstrtab         STRTAB          0000000000000000 0014c2 000137 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),
├ readelf --wide --notes {}
│ @@ -1,4 +1,4 @@
│
│  Displaying notes found in: .note.gnu.build-id
│    Owner                 Data size    Description
│ -  GNU                  0x00000014    NT_GNU_BUILD_ID (unique build ID bitstring)         Build ID: 3341aa9e9143d7d5d4fb5e05623976b644573b2
│ +  GNU                  0x00000014    NT_GNU_BUILD_ID (unique build ID bitstring)         Build ID: a8b70f29d619ba23d3879579b19209fda75ea3b
├ readelf --wide --debug-dump=rawline {}
│ @@ -21,19 +21,19 @@
│    Opcode 8 has 0 args
│    Opcode 9 has 1 arg
│    Opcode 10 has 0 args
│    Opcode 11 has 0 args
│    Opcode 12 has 1 arg
│
│   The Directory Table (offset 0x1b):
│ -  1  /build/1st/firefox-68.0/widget/gtk/mozgtk
│ +  1  /build/firefox-68.0/2nd/widget/gtk/mozgtk
│    2  /usr/lib/gcc/x86_64-linux-gnu/8/include
│    3  /usr/include/x86_64-linux-gnu/bits

etc.

Chances are this is involved in the firefox diffs timing out
https://tests.reproducible-builds.org/debian/dbd/unstable/amd64/firefox_68.0-1.diffoscope.html

Mike


More information about the Reproducible-builds mailing list