public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "gprocida+abigail at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/26135] New: Possible issue with type equality
Date: Thu, 18 Jun 2020 16:48:08 +0000	[thread overview]
Message-ID: <bug-26135-9487@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2020-06-18 16:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:48 gprocida+abigail at google dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26135-9487@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).