[PATCH, applied] Bug 28364 - libwiretap fails self comparison

Dodji Seketeli dodji@redhat.com
Mon Oct 18 09:00:27 GMT 2021


Hello,

In this case, thanks to all the debugging infrastructure in place,
especially the canonical type debugging infrastructure, I was able to
notice that there was a canonicalization error on a function type when
reading the libwiretap binary as in:

    $ build/tools/abidw --debug-tc /usr/lib64/libwiretap.so.11.0.8
    structural & canonical equality different for type: function type void (wtap*)
    in compare_types_during_canonicalization at: /home/dodji/git/libabigail/PR28364/src/abg-ir.cc:13575: execution should not have reached this point!
    Abandon (core dumped)
    $

When digging deeper, I noticed that, in the DWARF reader, when
building a function type, we are associating a "textual
representation" of the function type 'void (wtap*)' to its DIE (inside
the current translation) way too early.

By too early, I mean, the association was done before the function
type was fully 'built'.  Its parameters were not 'collected', for
instance.  So that means that a 'pointer to that function type' could
be formed, with a wrong representation, during the time where the
function type wasn't fully formed.  Just moving the association to
after the type was fully constructed solved the issue.

This one was hard to spot!

Later, this uncovered the fact that we could now have (and thus
serialize) member functions of unions.  And it turned out the abixml
reader didn't expect those.  Oops.  I fixed that one as well.

	* src/abg-dwarf-reader.cc (build_function_type): Associate the DIE
	representation to the constructed type once it's fully built.
	* src/abg-reader.cc (build_function_type): Support member function of unions.
	* tests/data/Makefile.am: Add the new test input files to the
	source distribution.
	* tests/data/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64-self-check-report.txt:
	Add new test input file.
	* tests/data/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64.rpm:
	Likewise.
	* tests/data/test-diff-pkg/wireshark/wireshark-cli-debuginfo-3.4.9-1.fc36.x86_64.rpm:
	Likewise.
	* tests/test-diff-pkg.cc (in_out_specs): Add these new test input
	files to this test harness.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc                       |   3 ++-
 src/abg-reader.cc                             |   6 ++---
 tests/data/Makefile.am                        |   3 +++
 ...-3.4.9-1.fc36.x86_64-self-check-report.txt |  21 ++++++++++++++++++
 .../wireshark-cli-3.4.9-1.fc36.x86_64.rpm     | Bin 0 -> 21382553 bytes
 ...hark-cli-debuginfo-3.4.9-1.fc36.x86_64.rpm | Bin 0 -> 39197386 bytes
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |   2 +-
 tests/test-diff-pkg.cc                        |  12 ++++++++++
 8 files changed, 42 insertions(+), 5 deletions(-)
 create mode 100644 tests/data/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64-self-check-report.txt
 create mode 100644 tests/data/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64.rpm
 create mode 100644 tests/data/test-diff-pkg/wireshark/wireshark-cli-debuginfo-3.4.9-1.fc36.x86_64.rpm


The patch is too big to attach to this email.  You can browse its
content at https://sourceware.org/git/?p=libabigail.git;a=commit;h=991283269ea8eb9bf9b1d1f460164c222f60e888.

Cheers,

-- 
		Dodji



More information about the Libabigail mailing list