public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Bug 26992 - Try harder to resolve declaration-only classes
@ 2021-01-15 17:21 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2021-01-15 17:21 UTC (permalink / raw)
  To: libabigail

[-- Attachment #1: Type: text/plain, Size: 2678 bytes --]

Hello,

When a declaration of a class, named H, matches more than one
definition (let's call them D) of H (in several other translation
units of the abi corpus) then H is left unresolved; that is, H is
considered as being a declaration-only class.  Note that down the
road, H will compare different to all those Ds.

However when those Ds are all equal, it turns out that this can lead
to issues down the road.  This is because conceptually, H equals D.
But then by not resolving H to D (and there are several Ds), we
artificially create a situation where H is different from D.  We can
even create situations where those Ds are different among themselves.
So doing comparisons inevitably leads to spurious changes.

This is the root cause of the issue described in this bug at
https://sourceware.org/bugzilla/show_bug.cgi?id=26992.

To fix the issue, this patch thus resolves H to D when the different
Ds are all equal.

Note that a similar thing should be done for the process of resolving
declaration-only enums as well.  But I don't have an issue reproducer
at hand involving enums at the moment, so I am adding a comment to
read_context::resolve_declaration_only_enums for now.

I have also filled the enhancement request
https://sourceware.org/bugzilla/show_bug.cgi?id=27189 to track a task
that would do away with read_context::resolve_declaration_only_enums
altogether by factorizing out the resolution of declaration-only
abigail::ir::decl_base.

	* src/abg-dwarf-reader.cc
	(read_context::compare_before_canonicalisation): Define new member
	function.
	(read_context::resolve_declaration_only_classes): When there are
	more than one definition that can resolve a given declaration, if
	all those definitions are equal, then resolve the declaration to
	those definitions.
	(read_context::resolve_declaration_only_enums): Add a comment to
	update similarly update this function (or do away with it
	completely) later.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-diff-pkg/cogl-1.22.8-2.fc33.x86_64.rpm: Add new
	test input.
	* tests/data/test-diff-pkg/cogl-debuginfo-1.22.8-2.fc33.x86_64.rpm:
	Likewise.
	* tests/data/test-diff-pkg/cogl-1.22.8-2.fc33.x86_64.self-check-report-0.txt:
	Likewise.
	* tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs
	to the test harness.
	* tests/data/Makefile.am: Add the new test input files to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>

Applied to the mainline branch.

The patch is a bit big so I am attaching it gzip'ed here.


[-- Attachment #2: Compressed patch --]
[-- Type: application/gzip, Size: 2226061 bytes --]

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


-- 
		Dodji

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-15 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 17:21 [PATCH] Bug 26992 - Try harder to resolve declaration-only classes Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).