public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/26135] New: Possible issue with type equality
@ 2020-06-18 16:48 gprocida+abigail at google dot com
  2020-06-24 16:18 ` [Bug default/26135] " dodji at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gprocida+abigail at google dot com @ 2020-06-18 16:48 UTC (permalink / raw)
  To: libabigail

https://sourceware.org/bugzilla/show_bug.cgi?id=26135

            Bug ID: 26135
           Summary: Possible issue with type equality
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida+abigail at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

The patch below may indicate a potential issue with type equality in libabigail
(note that this builds on the patch in
https://sourceware.org/pipermail/libabigail/2020q2/002355.html).

runtestreaddwarf reveals some instances where
types_defined_same_linux_kernel_corpus_public returns true for types that
compare as unequal. I think they are all anonymous structs with naming
typedefs.

Regards,
Giuliano

From dd249b7dc83df3609c23ec237a7ddb94e29abf44 Mon Sep 17 00:00:00 2001
From: Giuliano Procida <gprocida@google.com>
Date: Thu, 18 Jun 2020 13:50:59 +0100
Subject: [PATCH] check linux optimisation

---
 src/abg-ir.cc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 41a8e3f9..a8096690 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -11904,8 +11904,18 @@ type_base::get_canonical_type_for(type_base_sptr t)
          // Compare types by considering that decl-only classes don't
          // equal their definition.
          env->decl_only_class_equals_definition(false);
-         bool equal = types_defined_same_linux_kernel_corpus_public(**it, *t)
-                      || *it == t;
+         bool linux_eq =
types_defined_same_linux_kernel_corpus_public(**it, *t);
+         bool plain_eq = *it == t;
+         // is it really just an optimisation?
+         if (linux_eq > plain_eq)
+           {
+             std::cerr << "type equality discrepancy with "
+                       << t->get_pretty_representation()
+                       << " and "
+                       << (*it)->get_pretty_representation()
+                       << std::endl;
+           }
+         bool equal = linux_eq || plain_eq;
          // Restore the state of the on-the-fly-canonicalization and
          // the decl-only-class-being-equal-to-a-matching-definition
          // flags.
--
2.27.0.290.gba653c62da-goog

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-17 14:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 16:48 [Bug default/26135] New: Possible issue with type equality gprocida+abigail at google dot com
2020-06-24 16:18 ` [Bug default/26135] " dodji at redhat dot com
2020-06-24 17:17 ` [Bug default/26135] Wrong linkage name causes anonymous classes miscomparison dodji at redhat dot com
2020-06-24 17:22 ` dodji at redhat dot com
2020-06-24 17:22 ` dodji at redhat dot com
2020-06-25 14:56 ` gprocida+abigail at google dot com
2020-07-06 17:14 ` dodji at redhat dot com
2020-07-16 11:41 ` gprocida+abigail at google dot com
2020-07-16 18:32 ` gprocida+abigail at google dot com
2020-09-17 14:17 ` dodji at redhat dot com

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).