public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Fixing various issues found while working on PR30309
@ 2023-09-07 13:32 Dodji Seketeli
  2023-09-07 13:34 ` [PATCH 01/16] reader: fix indentation Dodji Seketeli
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:32 UTC (permalink / raw)
  To: dodji; +Cc: libabigail

Hello,

While working on the problem report 30309 at
https://sourceware.org/bugzilla/show_bug.cgi?id=30309, I found several
smaller related issues that could be addressed independently from the
reported problem itself.  As the initial issue still needs more care,
I think it's worthwhile to merge the following patches into the main
line the source code.

Please note that the original issue is being handled in the branch
"canonicalize-types-in-order" at
https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/users/dodji/canonicalize-types-in-order.

I am thus merging the patches that follows this message into the main
branches, from the "canonicalize-types-in-order" branch.

Dodji Seketeli (16):
  reader: fix indentation
  tools-utils: Fix indentation
  dwarf-reader,ir: Make logging a property of the middle end
  dwarf-reader: Fix some logging
  abipkgdiff: Initialize libxml2 to use it in a multi-thread context
  tools-utils: Avoid endless loop
  {dwarf,elf}reader: Don't consider no symbol table as an error
  abipkgdiff: Avoid comparing binaries that are outside of the package
  ir: Add missing ABG_RETURN in the comparison engine
  ir: Add fn types to type lookup maps
  ir: Fix forgetting canonicalizing some function types
  ir: Avoid forgetting potential seemingly duplicated member functions
  ir: Really avoid canonicalizing decl-only classes
  ir: Use non qualified typedef name for type canonicalization
  ir: Fix qualification as non-confirmed propagated canonical types
  dwarf-reader: Do not re-use typedefs in a scope

 include/abg-fwd.h                             |     8 +-
 include/abg-ir.h                              |    11 +-
 include/abg-tools-utils.h                     |     1 +
 src/abg-dwarf-reader.cc                       |    38 +-
 src/abg-elf-reader.cc                         |     8 +-
 src/abg-ir-priv.h                             |    21 +-
 src/abg-ir.cc                                 |   328 +-
 src/abg-reader.cc                             |    76 +-
 src/abg-tools-utils.cc                        |    40 +-
 tests/data/Makefile.am                        |     2 +
 .../test-abidiff/test-PR18791-report0.txt     |    13 -
 tests/data/test-annotate/libtest23.so.abi     |   453 +-
 .../test-annotate/libtest24-drop-fns-2.so.abi |   598 +-
 .../test-annotate/libtest24-drop-fns.so.abi   |   598 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 14179 ++--
 .../data/test-annotate/test17-pr19027.so.abi  |  2162 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  8862 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  7403 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10938 +--
 .../data/test-annotate/test21-pr19092.so.abi  |    88 +-
 .../test42-PR21296-clanggcc-report0.txt       |    14 +-
 .../test31-pr18535-libstdc++-report-0.txt     |    31 +-
 .../test31-pr18535-libstdc++-report-1.txt     |    31 +-
 .../data/test-diff-filter/test41-report-0.txt |    30 +-
 .../symlink-dir-test1-report1.txt             |     0
 .../symlink-dir-test1-report1.txt             |     0
 .../PR22015-libboost_iostreams.so.abi         |  2291 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    | 14659 ++--
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |  8778 +--
 tests/data/test-read-dwarf/libtest23.so.abi   |   447 +-
 .../libtest24-drop-fns-2.so.abi               |   586 +-
 .../test-read-dwarf/libtest24-drop-fns.so.abi |   586 +-
 .../test-read-dwarf/test-libaaudio.so.abi     |     8 +-
 .../test-read-dwarf/test-libandroid.so.abi    | 12052 ++--
 tests/data/test-read-dwarf/test0.hash.abi     |     4 +-
 tests/data/test-read-dwarf/test1.hash.abi     |    10 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |  3136 +-
 .../test-read-dwarf/test11-pr18828.so.abi     | 11668 ++--
 .../test-read-dwarf/test12-pr18844.so.abi     | 24630 ++++---
 .../test-read-dwarf/test15-pr18892.so.abi     | 13995 ++--
 .../test-read-dwarf/test16-pr18904.so.abi     | 16831 ++---
 .../test-read-dwarf/test17-pr19027.so.abi     |  2132 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  8768 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  7127 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10671 +--
 .../test-read-dwarf/test21-pr19092.so.abi     |    82 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 57411 ++++++++--------
 .../test9-pr18818-clang.so.abi                |  3545 +-
 .../test28-without-std-fns-ref.xml            |   350 +-
 .../test28-without-std-vars-ref.xml           |   348 +-
 tests/test-diff-pkg.cc                        |    32 +-
 tools/abipkgdiff.cc                           |    27 +-
 52 files changed, 121298 insertions(+), 124809 deletions(-)
 create mode 100644 tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt
 create mode 100644 tests/data/test-diff-pkg/symlink-dir-test1-report1.txt

-- 
2.39.3

-- 
		Dodji


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

* [PATCH 01/16] reader: fix indentation
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
@ 2023-09-07 13:34 ` Dodji Seketeli
  2023-09-07 13:35 ` [PATCH 02/16] tools-utils: Fix indentation Dodji Seketeli
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:34 UTC (permalink / raw)
  To: libabigail; +Cc: dodji

Hello,

	* src/abg-reader.cc (build_function_type): Fix indentation.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-reader.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index 8e9c5b3a..520d158a 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -4214,16 +4214,16 @@ build_function_type(reader&	rdr,
     {
       method_class_type =
 	is_class_or_union_type(rdr.build_or_get_type_decl(method_class_id,
-							   /*add_decl_to_scope=*/true));
+							  /*add_decl_to_scope=*/true));
       ABG_ASSERT(method_class_type);
     }
 
- function_type_sptr fn_type(is_method_t
-			    ? new method_type(method_class_type,
-					      /*is_const=*/false,
-					      size, align)
-			    : new function_type(return_type,
-						parms, size, align));
+  function_type_sptr fn_type(is_method_t
+			     ? new method_type(method_class_type,
+					       /*is_const=*/false,
+					       size, align)
+			     : new function_type(return_type,
+						 parms, size, align));
 
   rdr.get_translation_unit()->bind_function_type_life_time(fn_type);
   rdr.key_type_decl(fn_type, id);
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 02/16] tools-utils: Fix indentation
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
  2023-09-07 13:34 ` [PATCH 01/16] reader: fix indentation Dodji Seketeli
@ 2023-09-07 13:35 ` Dodji Seketeli
  2023-09-07 13:38 ` [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end Dodji Seketeli
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:35 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

	* src/abg-tools-utils.cc (string_suffix): Fix indentation.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-tools-utils.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 5287c99e..2ea6f8b4 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -1067,9 +1067,9 @@ split_string(const string& input_string,
 /// @return true iff the function could find a prefix for the suffix
 /// @p suffix in the input string @p input_string.
 bool
-string_suffix(const string& input_string,
-	      const string& prefix,
-	      string& suffix)
+string_suffix(const string&	input_string,
+	      const string&	prefix,
+	      string&		suffix)
 {
   // Some basic sanity check before we start hostilities.
   if (prefix.length() >= input_string.length())
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
  2023-09-07 13:34 ` [PATCH 01/16] reader: fix indentation Dodji Seketeli
  2023-09-07 13:35 ` [PATCH 02/16] tools-utils: Fix indentation Dodji Seketeli
@ 2023-09-07 13:38 ` Dodji Seketeli
  2023-09-07 13:39 ` [PATCH 04/16] dwarf-reader: Fix some logging Dodji Seketeli
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:38 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

Add a "do-log" property to the abigail::ir::environment::priv.  That
way, we can log finer grain time stamps during type canonicalization.
This is useful for debugging.

	* src/abg-dwarf-reader.cc (reader::read_debug_info_into_corpus):
	Set the do_log property on the environment from the do_log
	property of the reader.
	* src/abg-ir-priv.h (environment::priv::do_log_): New data member.
	(environment::priv::priv): Initialize it.
	(environment::priv::do_log): Define new accessor method.
	(canonicalize_types): Add logging.
	* src/abg-ir.cc (canonicalize): Add logging to time the
	canonicalization of each type.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc |  2 ++
 src/abg-ir-priv.h       | 21 ++++++++++++++++++---
 src/abg-ir.cc           | 16 ++++++++++++++++
 3 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index c20cf16b..180c1ade 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -2154,6 +2154,8 @@ public:
       env().set_self_comparison_debug_input(corpus());
 #endif
 
+    env().priv_->do_log(do_log());
+
     // Walk all the DIEs of the debug info to build a DIE -> parent map
     // useful for get_die_parent() to work.
     {
diff --git a/src/abg-ir-priv.h b/src/abg-ir-priv.h
index fe5a36cf..d0a0c48f 100644
--- a/src/abg-ir-priv.h
+++ b/src/abg-ir-priv.h
@@ -494,6 +494,7 @@ struct environment::priv
   bool					decl_only_class_equals_definition_;
   bool					use_enum_binary_only_equality_;
   bool					allow_type_comparison_results_caching_;
+  bool					do_log_;
   optional<bool>			analyze_exported_interfaces_only_;
 #ifdef WITH_DEBUG_SELF_COMPARISON
   bool					self_comparison_debug_on_;
@@ -520,7 +521,8 @@ struct environment::priv
       do_on_the_fly_canonicalization_(true),
       decl_only_class_equals_definition_(false),
       use_enum_binary_only_equality_(true),
-      allow_type_comparison_results_caching_(false)
+      allow_type_comparison_results_caching_(false),
+      do_log_(false)
 #ifdef WITH_DEBUG_SELF_COMPARISON
     ,
       self_comparison_debug_on_(false)
@@ -553,6 +555,14 @@ struct environment::priv
   allow_type_comparison_results_caching() const
   {return allow_type_comparison_results_caching_;}
 
+  void
+  do_log(bool f)
+  {do_log_ = f;}
+
+  bool
+  do_log() const
+  {return do_log_;}
+
   /// Cache the result of comparing two sub-types.
   ///
   /// @param first the first sub-type that has been compared. Its
@@ -1321,8 +1331,13 @@ canonicalize_types(const input_iterator& begin,
     return;
 
   // First, let's compute the canonical type of this type.
-  for (auto t = begin; t != end; ++t)
-    canonicalize(deref(t));
+  for (auto t = begin, i = 0; t != end; ++t, ++i)
+    {
+      if (deref(t)->get_environment().priv_->do_log())
+	std::cerr << "#" << std::dec << i << " ";
+
+      canonicalize(deref(t));
+    }
 
 #ifdef WITH_DEBUG_CT_PROPAGATION
   // Then now, make sure that all types -- which propagated canonical
diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 999fabcb..b33d6d68 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -15039,7 +15039,23 @@ canonicalize(type_base_sptr t)
   if (t->get_canonical_type())
     return t->get_canonical_type();
 
+  if (t->get_environment().priv_->do_log())
+    std::cerr << "Canonicalization of type '"
+	      << t->get_pretty_representation(true, true)
+	      << "/@#" << std::hex << t.get() << ": ";
+
+  tools_utils::timer tmr;
+
+  if (t->get_environment().priv_->do_log())
+    tmr.start();
   type_base_sptr canonical = type_base::get_canonical_type_for(t);
+
+  if (t->get_environment().priv_->do_log())
+    tmr.stop();
+
+  if (t->get_environment().priv_->do_log())
+    std::cerr << tmr << "\n";
+
   maybe_adjust_canonical_type(canonical, t);
 
   t->priv_->canonical_type = canonical;
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 04/16] dwarf-reader: Fix some logging
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (2 preceding siblings ...)
  2023-09-07 13:38 ` [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end Dodji Seketeli
@ 2023-09-07 13:39 ` Dodji Seketeli
  2023-09-07 13:39 ` [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context Dodji Seketeli
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:39 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

	* src/abg-dwarf-reader.cc
	(reader::{read_debug_info_into_corpus,
	canonicalize_types_scheduled}): Add missing new lines and spaces.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 180c1ade..6e472d3a 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -2184,7 +2184,7 @@ public:
       tools_utils::timer t;
       if (do_log())
 	{
-	  cerr << "building the libabigail internal representation ...";
+	  cerr << "building the libabigail internal representation ...\n";
 	  t.start();
 	}
       // And now walk all the DIEs again to build the libabigail IR.
@@ -2216,8 +2216,9 @@ public:
       if (do_log())
 	{
 	  t.stop();
-	  cerr << " DONE@" << corpus()->get_path()
-	       << ":"
+	  cerr << "building the libabigail internal representation "
+	       << "DONE for corpus << corpus()->get_path()"
+	       << " in :"
 	       << t
 	       << "\n";
 
@@ -2308,9 +2309,9 @@ public:
       if (do_log())
 	{
 	  t.stop();
-	  cerr << "late type canonicalizing DONE@"
+	  cerr << "late type canonicalizing DONE for "
 	       << corpus()->get_path()
-	       << ":"
+	       << " in :"
 	       << t
 	       << "\n";
 	}
@@ -4595,10 +4596,10 @@ public:
     tools_utils::timer cn_timer;
     if (do_log())
       {
-	cerr << "going to canonicalize types";
+	cerr << "DWARF Reader is going to canonicalize types";
 	corpus_sptr c = corpus();
 	if (c)
-	  cerr << " of corpus " << corpus()->get_path();
+	  cerr << " of corpus " << corpus()->get_path() << "\n";
 	cn_timer.start();
       }
 
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (3 preceding siblings ...)
  2023-09-07 13:39 ` [PATCH 04/16] dwarf-reader: Fix some logging Dodji Seketeli
@ 2023-09-07 13:39 ` Dodji Seketeli
  2023-09-07 13:40 ` [PATCH 06/16] tools-utils: Avoid endless loop Dodji Seketeli
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:39 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

While running some test, I stumbled upon a transient deadlock
happening when using libxml2's text reader to create a reader from a
buffer.  After reading the documentation at
https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Thread-safety, I
realized that users of the library need to initialize libxml2 before
using it in a multi-thread setting.

So this patch is providing the abigail::tools_utils::initialize()
function to be called prior to using the library.  This is going to be
the place where to perform this kind of one-time initialization.

	* include/abg-tools-utils.h (initialize): Declare ...
	* src/abg-tools-utils.cc (initialize): ... new function.
	* tools/abipkgdiff.cc (main): Invoke the new
	abigail::tools_utils::initialize() here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 include/abg-tools-utils.h |  1 +
 src/abg-tools-utils.cc    | 17 ++++++++++++++++-
 tools/abipkgdiff.cc       |  2 ++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h
index 7f931c5d..ef748871 100644
--- a/include/abg-tools-utils.h
+++ b/include/abg-tools-utils.h
@@ -30,6 +30,7 @@ using std::string;
 using std::set;
 using std::shared_ptr;
 
+void initialize();
 const char* get_system_libdir();
 const char* get_anonymous_struct_internal_name_prefix();
 const char* get_anonymous_union_internal_name_prefix();
diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 2ea6f8b4..62a0ebb1 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -33,7 +33,8 @@
 #include <ctype.h>
 #include <errno.h>
 #include <libgen.h>
-
+#include <libxml/parser.h>
+#include <libxml/xmlversion.h>
 #include <algorithm>
 #include <cstdlib>
 #include <cstring>
@@ -76,6 +77,20 @@ using namespace abigail::ini;
 namespace tools_utils
 {
 
+/// This function needs to be called before any libabigail function.
+///
+/// Users of libabigail must call it prior to using any of the
+/// functions of the library.
+///
+/// It intends to initialize the underlying libraries that might need
+/// initialization, especially, libxml2, in multi-threaded environments.
+void
+initialize()
+{
+  LIBXML_TEST_VERSION;
+  xmlInitParser();
+}
+
 /// Get the value of $libdir variable of the autotools build
 /// system.  This is where shared libraries are usually installed.
 ///
diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index 69661c5b..5ab5c22c 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -3887,6 +3887,8 @@ main(int argc, char* argv[])
 	      | abigail::tools_utils::ABIDIFF_ERROR);
     }
 
+  abigail::tools_utils::initialize();
+
   if (opts.self_check)
     return compare_to_self(first_package, opts);
 
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 06/16] tools-utils: Avoid endless loop
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (4 preceding siblings ...)
  2023-09-07 13:39 ` [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context Dodji Seketeli
@ 2023-09-07 13:40 ` Dodji Seketeli
  2023-09-07 13:41 ` [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error Dodji Seketeli
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:40 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Heloo,

	* src/abg-tools-utils.cc (is_dir): Avoid endless loop.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-tools-utils.cc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 62a0ebb1..e7155846 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -567,10 +567,18 @@ is_dir(const string& path)
   if (S_ISDIR(st.st_mode))
     return true;
 
-  string symlink_target_path;
-  if (maybe_get_symlink_target_file_path(path, symlink_target_path))
-    return is_dir(symlink_target_path);
+  if (S_ISLNK(st.st_mode))
+    {
+      string symlink_target_path;
+      if (maybe_get_symlink_target_file_path(path, symlink_target_path))
+	{
+	  if (!get_stat(path, &st))
+	    return false;
 
+	  if (S_ISDIR(st.st_mode))
+	    return true;
+	}
+    }
   return false;
 }
 
-- 
2.39.3


-- 
		Dodji


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

* [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (5 preceding siblings ...)
  2023-09-07 13:40 ` [PATCH 06/16] tools-utils: Avoid endless loop Dodji Seketeli
@ 2023-09-07 13:41 ` Dodji Seketeli
  2023-09-07 13:41 ` [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package Dodji Seketeli
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:41 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

Some binaries don't have any symbol table.  Libabigail's ELF and DWARF
readers error out on those binaries, making fedabipkgdiff emitting an
error when performing the self-comparison of the package containing
those binaries.

This patch handles a binary having no symbol table almost as a binary
that has an empty symbol table, making abipkgdiff and fedabipkgdiff
not error out on those binaries anymore.

This makes the command below succeed:

    $ fedabipkgdiff --self-compare -a --from fc34 glibc

	* src/abg-dwarf-reader.cc (reader::read_corpus): Return an empty
	corpus if no symbol was found. Do not crash when no symbol table
	is found.
	* src/abg-elf-reader.cc (reader::read_corpus): Consider a corpus
	with no symbol table as being OK.
	* src/abg-reader.cc (build_elf_symbol_from_reference): Do not
	crash when no symbol table is present.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc | 11 ++++++-----
 src/abg-elf-reader.cc   |  8 ++++----
 src/abg-reader.cc       | 13 ++++++++-----
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 6e472d3a..2416c7f3 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -2072,12 +2072,12 @@ public:
     // Load the generic ELF parts of the corpus.
     elf::reader::read_corpus(status);
 
-    if ((status & STATUS_NO_SYMBOLS_FOUND)
-	|| !(status & STATUS_OK))
-      // Either we couldn't find ELF symbols or something went badly
-      // wrong.  There is nothing we can do with this ELF file.  Bail
-      // out.
+    if (!(status & STATUS_OK))
+      {
+	// Something went badly wrong.  There is nothing we can do
+	// with this ELF file.  Bail out.
       return corpus_sptr();
+      }
 
     // If we couldn't find debug info from the elf path, then say it.
     if (dwarf_debug_info() == nullptr)
@@ -2143,6 +2143,7 @@ public:
     // Get out now if no debug info is found or if the symbol table is
     // empty.
     if (!dwarf_debug_info()
+	|| !corpus()->get_symtab()
 	|| !corpus()->get_symtab()->has_symbols())
       return corpus();
 
diff --git a/src/abg-elf-reader.cc b/src/abg-elf-reader.cc
index 7884c672..f4dae766 100644
--- a/src/abg-elf-reader.cc
+++ b/src/abg-elf-reader.cc
@@ -978,12 +978,12 @@ reader::read_corpus(status& status)
   // See if we could find symbol tables.
   if (!symtab())
     {
-      status |= STATUS_NO_SYMBOLS_FOUND;
+      status |= STATUS_NO_SYMBOLS_FOUND | STATUS_OK;
       // We found no ELF symbol, so we can't handle the binary.  Note
       // that we could have found a symbol table with no defined &
-      // exported ELF symbols in it.  That case is handled as an empty
-      // corpus, which is different from this case.
-      return corpus_sptr();
+      // exported ELF symbols in it.  Both cases are handled as an
+      // empty corpus.
+      return corpus();
     }
 
   // Set symbols information to the corpus.
diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index 520d158a..2b902096 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -3272,12 +3272,15 @@ build_elf_symbol_from_reference(reader& rdr, const xmlNodePtr node)
       if (name.empty())
 	return nil;
 
-      const elf_symbols& symbols =
-	  rdr.corpus()->get_symtab()->lookup_symbol(name);
+      if (rdr.corpus()->get_symtab())
+	{
+	  const elf_symbols& symbols =
+	    rdr.corpus()->get_symtab()->lookup_symbol(name);
 
-      for (const auto& symbol : symbols)
-	if (symbol->get_id_string() == sym_id)
-	  return symbol;
+	  for (const auto& symbol : symbols)
+	    if (symbol->get_id_string() == sym_id)
+	      return symbol;
+	}
     }
 
   return nil;
-- 
2.39.3


-- 
		Dodji


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

* [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (6 preceding siblings ...)
  2023-09-07 13:41 ` [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error Dodji Seketeli
@ 2023-09-07 13:41 ` Dodji Seketeli
  2023-09-07 13:42 ` [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine Dodji Seketeli
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:41 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

Some symlinks in some RPMs resolve to binaries outside of the package. In
those cases, avoid considering them.

	* src/abg-tools-utils.cc (maybe_get_symlink_target_file_path): Do
	not require that the file path points to a symlink.  A file path
	can point to a file that is not a symlink and yet the whole path
	can be in parent directory that is a symlink.  In this case,
	realpath will correctly resolve to the correct target file.
	* tools/abipkgdiff.cc (maybe_update_package_content): A path to a
	binary that is not inside the RPM (because a symlink resolved to a
	file outside of the RPM) should not be added to the set of
	binaries to be analyzed.
	* tests/data/test-diff-pkg/symlink-dir-test1-report1.txt: Add new
	test file.
	* tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt:
	Likewise.
	* tests/data/Makefile.am: Add new test file to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_specs): for the
	data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks test, the
	root dir of the package is
	data/test-diff-pkg/symlink-dir-test1/dir{1,2}.  Use that to test
	that the symlinks are properly handled.  Also, use the
	data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks as a root
	of an alternative package for which the symlinks resolve outside
	the package, under
	data/test-diff-pkg/symlink-dir-test1/dir{1,2}/targets.  In this
	later case, the symlinked files should be ignored in the
	comparison.  Likewise for
	data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-tools-utils.cc                        |  3 --
 tests/data/Makefile.am                        |  2 ++
 .../symlink-dir-test1-report1.txt             |  0
 .../symlink-dir-test1-report1.txt             |  0
 tests/test-diff-pkg.cc                        | 32 ++++++++++++++++---
 tools/abipkgdiff.cc                           | 25 ++++++++++++---
 6 files changed, 50 insertions(+), 12 deletions(-)
 create mode 100644 tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt
 create mode 100644 tests/data/test-diff-pkg/symlink-dir-test1-report1.txt

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index e7155846..08d50347 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -723,9 +723,6 @@ maybe_get_symlink_target_file_path(const string& file_path,
   if (!get_stat(file_path, &st))
     return false;
 
-  if (!S_ISLNK(st.st_mode))
-    return false;
-
   char *link_target_path = realpath(file_path.c_str(), NULL);
   if (!link_target_path)
     return false;
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 03361fab..b3434da5 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -2055,6 +2055,7 @@ test-diff-pkg/dirpkg-3-report-1.txt \
 test-diff-pkg/dirpkg-3-report-2.txt \
 test-diff-pkg/dirpkg-3.suppr \
 test-diff-pkg/symlink-dir-test1-report0.txt \
+test-diff-pkg/symlink-dir-test1-report1.txt \
 test-diff-pkg/symlink-dir-test1/dir1/symlinks/foo.o \
 test-diff-pkg/symlink-dir-test1/dir1/symlinks/libfoo.so \
 test-diff-pkg/symlink-dir-test1/dir1/targets/foo.c \
@@ -2300,6 +2301,7 @@ test-diff-pkg-ctf/cracklib-2.9.6-15-ol8u0.x86_64.rpm \
 test-diff-pkg-ctf/isl-debuginfo-0.16.1-6.x86_64.rpm	\
 test-diff-pkg-ctf/tarpkg-1-dir1.tar.gz \
 test-diff-pkg-ctf/symlink-dir-test1-report0.txt \
+test-diff-pkg-ctf/symlink-dir-test1-report1.txt \
 \
 test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \
 test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \
diff --git a/tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt b/tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/data/test-diff-pkg/symlink-dir-test1-report1.txt b/tests/data/test-diff-pkg/symlink-dir-test1-report1.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc
index 99dc381d..fbfa50d3 100644
--- a/tests/test-diff-pkg.cc
+++ b/tests/test-diff-pkg.cc
@@ -149,6 +149,18 @@ static InOutSpec in_out_specs[] =
     "data/test-diff-pkg/dirpkg-3-report-2.txt",
     "output/test-diff-pkg/dirpkg-3-report-2.txt"
   },
+  {
+    "data/test-diff-pkg/symlink-dir-test1/dir1",
+    "data/test-diff-pkg/symlink-dir-test1/dir2",
+    "--no-default-suppression ",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "data/test-diff-pkg/symlink-dir-test1-report0.txt",
+    "output/test-diff-pkg/symlink-dir-test1-report0.txt"
+  },
   {
     "data/test-diff-pkg/symlink-dir-test1/dir1/symlinks",
     "data/test-diff-pkg/symlink-dir-test1/dir2/symlinks",
@@ -158,8 +170,8 @@ static InOutSpec in_out_specs[] =
     "",
     "",
     "",
-    "data/test-diff-pkg/symlink-dir-test1-report0.txt ",
-    "output/test-diff-pkg/symlink-dir-test1-report0.txt "
+    "data/test-diff-pkg/symlink-dir-test1-report1.txt",
+    "output/test-diff-pkg/symlink-dir-test1-report1.txt"
   },
 #if WITH_TAR
   {
@@ -864,6 +876,18 @@ static InOutSpec in_out_specs[] =
     "data/test-diff-pkg-ctf/dirpkg-3-report-2.txt",
     "output/test-diff-pkg-ctf/dirpkg-3-report-2.txt"
   },
+  {
+    "data/test-diff-pkg-ctf/symlink-dir-test1/dir1",
+    "data/test-diff-pkg-ctf/symlink-dir-test1/dir2",
+    "--ctf --no-default-suppression ",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "data/test-diff-pkg-ctf/symlink-dir-test1-report0.txt",
+    "output/test-diff-pkg-ctf/symlink-dir-test1-report0.txt"
+  },
   {
     "data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks",
     "data/test-diff-pkg-ctf/symlink-dir-test1/dir2/symlinks",
@@ -873,8 +897,8 @@ static InOutSpec in_out_specs[] =
     "",
     "",
     "",
-    "data/test-diff-pkg-ctf/symlink-dir-test1-report0.txt ",
-    "output/test-diff-pkg-ctf/symlink-dir-test1-report0.txt "
+    "data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt",
+    "output/test-diff-pkg-ctf/symlink-dir-test1-report1.txt"
   },
 #if WITH_TAR
   {
diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index 5ab5c22c..3a601075 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -2323,14 +2323,20 @@ typedef shared_ptr<self_compare_task> self_compare_task_sptr;
 /// function only looks for a file name which name is the same as the
 /// value of this parameter.
 ///
+/// @param parent_dir_name the name of the directory that the file
+/// name denoted by @p entry should belong to.  If it doesn't (because
+/// it's a symlink that resolves to a file outside of that directory)
+/// then the vector of paths of is not updated.
+///
 /// @param paths out parameter.  This is the set of meaningful paths
 /// of the current directory tree being analyzed.  These paths are
 /// those that are going to be involved in ABI comparison.
 static void
-maybe_update_package_content(const FTSENT *entry,
-			     options &opts,
-			     const string& file_name_to_look_for,
-			     unordered_set<string>& paths)
+maybe_update_package_content(const FTSENT*		entry,
+			     options&			opts,
+			     const string&		file_name_to_look_for,
+			     const string&		parent_dir_name,
+			     unordered_set<string>&	paths)
 {
   if (entry == NULL
       || (entry->fts_info != FTS_F && entry->fts_info != FTS_SL)
@@ -2340,6 +2346,15 @@ maybe_update_package_content(const FTSENT *entry,
 
   string path = entry->fts_path;
   maybe_get_symlink_target_file_path(path, path);
+  string parent_dir = parent_dir_name;
+  maybe_get_symlink_target_file_path(parent_dir, parent_dir);
+
+  if (!parent_dir_name.empty())
+    {
+      string s;
+      if (!string_suffix(path, parent_dir, s))
+	return;
+    }
 
   if (!file_name_to_look_for.empty())
     {
@@ -2391,7 +2406,7 @@ get_interesting_files_under_dir(const string dir,
   FTSENT *entry;
   unordered_set<string> files;
   while ((entry = fts_read(file_hierarchy)))
-    maybe_update_package_content(entry, opts, file_name_to_look_for, files);
+    maybe_update_package_content(entry, opts, file_name_to_look_for, dir, files);
 
   for (unordered_set<string>::const_iterator i = files.begin();
        i != files.end();
-- 
2.39.3


-- 
		Dodji


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

* [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (7 preceding siblings ...)
  2023-09-07 13:41 ` [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package Dodji Seketeli
@ 2023-09-07 13:42 ` Dodji Seketeli
  2023-09-07 14:02 ` [PATCH 10/16] ir: Add fn types to type lookup maps Dodji Seketeli
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 13:42 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

During structural type comparison, we want to be able to break on the
first occurrence of two sub-types comparing different.  This is done
by setting a breakpoint into the notify_equality_failed function that
is called by the ABG_RETURN macro in the comparison functions.

The problem is that I stumbled upon some code paths that are missing
the ABG_RETURN macro.  Fixed thus.  This will help in debugging
sessions.

	* src/abg-ir.cc (equals): In the overload for function_type,
	class_decl and union_decl, add a missing ABG_RETURN.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-ir.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index b33d6d68..cb230082 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -20257,8 +20257,8 @@ equals(const function_type& l, const function_type& r, change_kind* k)
     // comparing them all over again.
     bool cached_result = false;
     if (l.get_environment().priv_->is_type_comparison_cached(l, r,
-							      cached_result))
-      return cached_result;
+							     cached_result))
+      ABG_RETURN(cached_result);
   }
 
   mark_types_as_being_compared(l, r);
@@ -24251,7 +24251,7 @@ equals(const class_decl& l, const class_decl& r, change_kind* k)
     // over again.
     bool result = false;
     if (l.get_environment().priv_->is_type_comparison_cached(l, r, result))
-      return result;
+      ABG_RETURN(result);
   }
 
   // if one of the classes is declaration-only then we take a fast
@@ -25438,7 +25438,7 @@ equals(const union_decl& l, const union_decl& r, change_kind* k)
     // over again.
     bool result = false;
     if (l.get_environment().priv_->is_type_comparison_cached(l, r, result))
-      return result;
+      ABG_RETURN(result);
   }
 
   bool result = equals(static_cast<const class_or_union&>(l),
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 10/16] ir: Add fn types to type lookup maps
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (8 preceding siblings ...)
  2023-09-07 13:42 ` [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine Dodji Seketeli
@ 2023-09-07 14:02 ` Dodji Seketeli
  2023-09-07 14:03 ` [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Dodji Seketeli
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:02 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

This is a fix to an inconsistency I stumbled upon while looking at
something else.

So, function types were not being added to the type lookup maps.
Fixed this.

	* src/abg-ir.cc (maybe_update_types_lookup_map): Handle function
	types.
	(translation_unit::bind_function_type_life_time): Update types
	lookup map.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-ir.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index cb230082..93d79b33 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -1479,6 +1479,8 @@ translation_unit::bind_function_type_life_time(function_type_sptr ftype) const
     ABG_ASSERT(existing_tu == this);
   else
     ftype->set_translation_unit(const_cast<translation_unit*>(this));
+
+  maybe_update_types_lookup_map(ftype);
 }
 
 /// This implements the ir_traversable_base::traverse virtual
@@ -14198,6 +14200,8 @@ maybe_update_types_lookup_map(const decl_base_sptr& decl)
     maybe_update_types_lookup_map(array_type);
   else if (array_type_def::subrange_sptr subrange_type = is_subrange_type(decl))
     maybe_update_types_lookup_map(subrange_type);
+  else if (function_type_sptr fn_type = is_function_type(decl))
+    maybe_update_types_lookup_map(fn_type);
   else
     ABG_ASSERT_NOT_REACHED;
 }
@@ -14218,6 +14222,8 @@ maybe_update_types_lookup_map(const type_base_sptr& type)
 {
   if (decl_base_sptr decl = get_type_declaration(type))
     maybe_update_types_lookup_map(decl);
+  else if (function_type_sptr fn_type = is_function_type(type))
+    maybe_update_types_lookup_map(fn_type);
   else
     ABG_ASSERT_NOT_REACHED;
 }
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 11/16] ir: Fix forgetting canonicalizing some function types
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (9 preceding siblings ...)
  2023-09-07 14:02 ` [PATCH 10/16] ir: Add fn types to type lookup maps Dodji Seketeli
@ 2023-09-07 14:03 ` Dodji Seketeli
  2023-09-07 14:05 ` [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions Dodji Seketeli
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:03 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

It appears some function types are not canonicalized. Fixed thus.

	* src/abg-ir.cc (maybe_adjust_canonical_type): Once a missing
	member function has been copied from it's destination to the
	freshly canonicalized type, make sure the type of the member
	function is canonicalized as well.
	(copy_member_function): Bind the lifetime of the new function type
	to the lifetime of the current translation unit.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-ir.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 93d79b33..2bbb1a49 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -15006,7 +15006,11 @@ maybe_adjust_canonical_type(const type_base_sptr& canonical,
 		  // class doesn't have that member function.  Let's
 		  // copy that member function to the canonical class
 		  // then.
-		  copy_member_function (canonical_class, *i);
+		  {
+		    method_decl_sptr method =
+		      copy_member_function (canonical_class, *i);
+		    canonicalize(method->get_type());
+		  }
 	      }
 	}
     }
@@ -22873,7 +22877,7 @@ copy_member_function(const class_or_union_sptr& t, const method_decl* method)
 					    old_type->get_is_const(),
 					    old_type->get_size_in_bits(),
 					    old_type->get_alignment_in_bits()));
-  keep_type_alive(new_type);
+  t->get_translation_unit()->bind_function_type_life_time(new_type);
 
   method_decl_sptr
     new_method(new method_decl(method->get_name(),
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (10 preceding siblings ...)
  2023-09-07 14:03 ` [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Dodji Seketeli
@ 2023-09-07 14:05 ` Dodji Seketeli
  2023-09-07 14:07 ` [PATCH 13/16] ir: Really avoid canonicalizing decl-only classes Dodji Seketeli
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:05 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

In some rare cases expressed in DWARF from C++, a member function can
belong to both a declaration-only class (having no data member) in one
translation unit, and to a fully defined class in another translation
unit.  In those cases, the two classes are represented and considered
different.

But then, consider a destructor which mangled name is "D1".  D1 is
represented in both the decl-only class and the fully-defined class.
In the former case, its "this pointer" points to a decl-only class,
while in the later case its "this pointer" points a fully-defined
class.

So, D1 coming from the former case will compare different from the D1
coming from the later case, because of the spurious difference
"decl-only class" versus "fully-defined class".  This is in the
context of a self-comparison.

One way to fix this self-comparison subtle change is to give the
former D1 and the later D1 two different "function ID"s.  Today, the
function ID is just the mangled name, D1.  This patch is defining a
more involved ID which makes the difference between a member function
on a decl-only class and a member function on a fully-defined class.

Note that the only member functions that matter are virtual member
functions because they are the only member functions that are
considered when comparing two classes.

This fixes the self-comparison error found on the binary
gcc-gnat-12.3.1-1.fc37.x86_64/usr/libexec/gcc/x86_64-redhat-linux/12/gnat1
while running the self-comparison command below:

    $ fedabipkgdiff --self-compare -a --from fc37 gcc-gnat

	* src/abg-ir.cc (is_declaration_only_class_or_union_type): Add an
	overload for type_base_sptr.
	(function_decl::get_id): Virtual member functions that are defined
	on decl-only classes have a special ID to avoid confusing them
	with their counterparts defined on defined classes.
	* src/abg-reader.cc (build_function_decl)
	(build_function_decl_if_not_suppressed): Add a new
	add_to_exported_decls parameter to avoid adding the function to
	the set of exported decls to early.  For the function to be
	properly added to the set of exported decls, all its attributes
	must be set, including virtualness.  In some case, those
	attributes are not yet known by the end of the call to
	build_function_decl.  The caller must then set those properties
	and then add the function to the set of exported decls.
	(build_{class,union}_decl): Build the function first, then add its
	missing properties and *then* add it to the set of exported decls.
	(handle_function_decl): Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-ir.cc                                 | 31 +++++++
 src/abg-reader.cc                             | 42 +++++++---
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 82 +++++++++----------
 3 files changed, 102 insertions(+), 53 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 2bbb1a49..a1033c75 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -10564,6 +10564,21 @@ is_declaration_only_class_or_union_type(const type_base *t,
   return false;
 }
 
+
+/// Test wheter a type is a declaration-only class.
+///
+/// @param t the type to considier.
+///
+/// @param look_through_decl_only if true, then look through the
+/// decl-only class to see if it actually has a class definition in
+/// the same ABI corpus.
+///
+/// @return true iff @p t is a declaration-only class.
+bool
+is_declaration_only_class_or_union_type(const type_base_sptr& t,
+					bool look_through_decl_only)
+{return is_declaration_only_class_or_union_type(t.get(), look_through_decl_only);}
+
 /// Test wheter a type is a declaration-only class.
 ///
 /// @param t the type to considier.
@@ -21366,6 +21381,19 @@ function_decl::get_id() const
       const environment& env = get_type()->get_environment();
       if (elf_symbol_sptr s = get_symbol())
 	{
+	  string virtual_member_suffix;
+	  if (is_member_function(this))
+	      {
+		method_decl* m = is_method_decl(this);
+		ABG_ASSERT(m);
+		if (get_member_function_is_virtual(m))
+		  {
+		    if (is_declaration_only_class_or_union_type
+			(m->get_type()->get_class_type(),
+			 /*look_through_decl_only=*/true))
+		      virtual_member_suffix += "/o";
+		  }
+	      }
 	  if (s->has_aliases())
 	    // The symbol has several aliases, so let's use a scheme
 	    // that allows all aliased functions to have different
@@ -21374,6 +21402,9 @@ function_decl::get_id() const
 	  else
 	    // Let's use the full symbol name with its version as ID.
 	    priv_->id_ = env.intern(s->get_id_string());
+
+	  if (!virtual_member_suffix.empty())
+	    priv_->id_ = env.intern(priv_->id_ + virtual_member_suffix);
 	}
       else if (!get_linkage_name().empty())
 	priv_->id_= env.intern(get_linkage_name());
diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index 2b902096..993b6266 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -1397,11 +1397,11 @@ build_function_parameter (reader&, const xmlNodePtr);
 
 static function_decl_sptr
 build_function_decl(reader&, const xmlNodePtr,
-		    class_or_union_sptr, bool);
+		    class_or_union_sptr, bool, bool);
 
 static function_decl_sptr
 build_function_decl_if_not_suppressed(reader&, const xmlNodePtr,
-				      class_or_union_sptr, bool);
+				      class_or_union_sptr, bool, bool);
 
 static bool
 function_is_suppressed(const reader& rdr,
@@ -3440,16 +3440,21 @@ build_function_parameter(reader& rdr, const xmlNodePtr node)
 /// shared_ptr<function_decl> that is returned is then really a
 /// shared_ptr<method_decl>.
 ///
-/// @param add_to_current_scope if set to yes, the resulting of
+/// @param add_to_current_scope if set to yes, the result of
 /// this function is added to its current scope.
 ///
+/// @param add_to_exported_decls if set to yes, the resulting of this
+/// function is added to the set of decls exported by the current
+/// corpus being built.
+///
 /// @return a pointer to a newly created function_decl upon successful
 /// completion, a null pointer otherwise.
 static function_decl_sptr
-build_function_decl(reader&	rdr,
+build_function_decl(reader&		rdr,
 		    const xmlNodePtr	node,
 		    class_or_union_sptr as_method_decl,
-		    bool		add_to_current_scope)
+		    bool		add_to_current_scope,
+		    bool		add_to_exported_decls)
 {
   function_decl_sptr nil;
 
@@ -3555,7 +3560,8 @@ build_function_decl(reader&	rdr,
 
   rdr.maybe_canonicalize_type(fn_type, !add_to_current_scope);
 
-  rdr.maybe_add_fn_to_exported_decls(fn_decl.get());
+  if (add_to_exported_decls)
+    rdr.maybe_add_fn_to_exported_decls(fn_decl.get());
 
   return fn_decl;
 }
@@ -3578,6 +3584,10 @@ build_function_decl(reader&	rdr,
 /// @param add_to_current_scope if set to yes, the resulting of
 /// this function is added to its current scope.
 ///
+/// @param add_to_exported_decls if set to yes, the resulting of this
+/// function is added to the set of decls exported by the current
+/// corpus being built.
+///
 /// @return a pointer to a newly created function_decl upon successful
 /// completion.  If the function was suppressed by a suppression
 /// specification then returns nil.
@@ -3585,7 +3595,8 @@ static function_decl_sptr
 build_function_decl_if_not_suppressed(reader&			rdr,
 				      const xmlNodePtr		node,
 				      class_or_union_sptr	as_method_decl,
-				      bool			add_to_current_scope)
+				      bool			add_to_current_scope,
+				      bool			add_to_exported_decls)
 {
   function_decl_sptr fn;
 
@@ -3596,7 +3607,8 @@ build_function_decl_if_not_suppressed(reader&			rdr,
     ;
   else
     fn = build_function_decl(rdr, node, as_method_decl,
-			     add_to_current_scope);
+			     add_to_current_scope,
+			     add_to_exported_decls);
   return fn;
 }
 
@@ -5148,7 +5160,8 @@ build_class_decl(reader&		rdr,
 	    {
 	      if (function_decl_sptr f =
 		  build_function_decl_if_not_suppressed(rdr, p, decl,
-							/*add_to_cur_sc=*/true))
+							/*add_to_cur_sc=*/true,
+							/*add_to_exported_decls=*/false))
 		{
 		  method_decl_sptr m = is_method_decl(f);
 		  ABG_ASSERT(m);
@@ -5161,6 +5174,7 @@ build_class_decl(reader&		rdr,
 		  set_member_function_is_dtor(m, is_dtor);
 		  set_member_function_is_const(m, is_const);
 		  rdr.map_xml_node_to_decl(p, m);
+		  rdr.maybe_add_fn_to_exported_decls(f.get());
 		  break;
 		}
 	    }
@@ -5505,7 +5519,8 @@ build_union_decl(reader& rdr,
 	    {
 	      if (function_decl_sptr f =
 		  build_function_decl_if_not_suppressed(rdr, p, decl,
-							/*add_to_cur_sc=*/true))
+							/*add_to_cur_sc=*/true,
+							/*add_to_exported_decls=*/false))
 		{
 		  method_decl_sptr m = is_method_decl(f);
 		  ABG_ASSERT(m);
@@ -5514,6 +5529,7 @@ build_union_decl(reader& rdr,
 		  set_member_function_is_ctor(m, is_ctor);
 		  set_member_function_is_dtor(m, is_dtor);
 		  set_member_function_is_const(m, is_const);
+		  rdr.maybe_add_fn_to_exported_decls(f.get());
 		  break;
 		}
 	    }
@@ -5626,7 +5642,8 @@ build_function_tdecl(reader& rdr,
 	}
       else if (function_decl_sptr f =
 	       build_function_decl_if_not_suppressed(rdr, n, class_decl_sptr(),
-					 /*add_to_current_scope=*/true))
+						     /*add_to_current_scope=*/true,
+						     /*add_to_exported_decls=*/true))
 	fn_tmpl_decl->set_pattern(f);
     }
 
@@ -6204,7 +6221,8 @@ handle_function_decl(reader&	rdr,
 		     bool		add_to_current_scope)
 {
   return build_function_decl_if_not_suppressed(rdr, node, class_decl_sptr(),
-					       add_to_current_scope);
+					       add_to_current_scope,
+					       /*add_to_exported_decls=*/true);
 }
 
 /// Parse a 'class-decl' xml element.
diff --git a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
index 9ff6c6e4..3dfc812a 100644
--- a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
+++ b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
@@ -27187,7 +27187,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='2'>
-          <function-decl name='do_out' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='425' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_out' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='425' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1370'/>
@@ -27210,7 +27210,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='4'>
-          <function-decl name='do_in' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='436' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_in' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='436' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1374'/>
@@ -27223,7 +27223,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='5'>
-          <function-decl name='do_encoding' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='443' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_encoding' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='443' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <return type-id='type-id-6'/>
           </function-decl>
@@ -27235,7 +27235,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='7'>
-          <function-decl name='do_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='449' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='449' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1374'/>
@@ -27245,7 +27245,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='8'>
-          <function-decl name='do_max_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='453' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_max_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='453' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <return type-id='type-id-6'/>
           </function-decl>
@@ -33661,7 +33661,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='2'>
-          <function-decl name='do_out' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='425' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_out' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='425' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1370'/>
@@ -33684,7 +33684,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='4'>
-          <function-decl name='do_in' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='436' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_in' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='436' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE5do_inERS0_PKcS4_RS4_PwS6_RS6_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1374'/>
@@ -33697,7 +33697,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='5'>
-          <function-decl name='do_encoding' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='443' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_encoding' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='443' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE11do_encodingEv@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <return type-id='type-id-6'/>
           </function-decl>
@@ -33709,7 +33709,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='7'>
-          <function-decl name='do_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='449' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='449' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE9do_lengthERS0_PKcS4_m@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <parameter type-id='type-id-1369'/>
             <parameter type-id='type-id-1374'/>
@@ -33719,7 +33719,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='8'>
-          <function-decl name='do_max_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='453' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_max_length' mangled-name='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/codecvt.h' line='453' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt7codecvtIwc11__mbstate_tE13do_max_lengthEv@@GLIBCXX_3.4'>
             <parameter type-id='type-id-1368' is-artificial='yes'/>
             <return type-id='type-id-6'/>
           </function-decl>
@@ -38839,7 +38839,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='2'>
-          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEtw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1245' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEtw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1245' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE5do_isEtw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2275'/>
@@ -38847,7 +38847,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1264' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1264' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2280'/>
             <parameter type-id='type-id-2280'/>
@@ -38856,7 +38856,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='4'>
-          <function-decl name='do_scan_is' mangled-name='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1282' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_scan_is' mangled-name='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1282' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2280'/>
@@ -38865,7 +38865,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='5'>
-          <function-decl name='do_scan_not' mangled-name='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1300' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_scan_not' mangled-name='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1300' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2280'/>
@@ -38874,14 +38874,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='6'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1317' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1317' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_toupperEw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='7'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1334' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1334' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_toupperEPwPKw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2281'/>
             <parameter type-id='type-id-2280'/>
@@ -38889,14 +38889,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='8'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1350' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1350' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_tolowerEw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='9'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1367' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1367' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_tolowerEPwPKw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2281'/>
             <parameter type-id='type-id-2280'/>
@@ -38904,14 +38904,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='10'>
-          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1387' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1387' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE8do_widenEc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-202'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='11'>
-          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1409' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1409' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-4'/>
             <parameter type-id='type-id-4'/>
@@ -38920,7 +38920,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='12'>
-          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEwc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1432' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEwc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1432' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE9do_narrowEwc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <parameter type-id='type-id-202'/>
@@ -38928,7 +38928,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='13'>
-          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1458' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1458' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2280'/>
             <parameter type-id='type-id-2280'/>
@@ -40375,14 +40375,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='2'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIcE10do_toupperEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1007' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIcE10do_toupperEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1007' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIcE10do_toupperEc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2335' is-artificial='yes'/>
             <parameter type-id='type-id-2336'/>
             <return type-id='type-id-2336'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIcE10do_toupperEPcPKc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1024' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIcE10do_toupperEPcPKc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1024' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIcE10do_toupperEPcPKc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2335' is-artificial='yes'/>
             <parameter type-id='type-id-2342'/>
             <parameter type-id='type-id-2338'/>
@@ -40390,14 +40390,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='4'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIcE10do_tolowerEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1040' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIcE10do_tolowerEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1040' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIcE10do_tolowerEc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2335' is-artificial='yes'/>
             <parameter type-id='type-id-2336'/>
             <return type-id='type-id-2336'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='5'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIcE10do_tolowerEPcPKc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1057' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIcE10do_tolowerEPcPKc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1057' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIcE10do_tolowerEPcPKc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2335' is-artificial='yes'/>
             <parameter type-id='type-id-2342'/>
             <parameter type-id='type-id-2338'/>
@@ -40520,7 +40520,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='2'>
-          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEtw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1245' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEtw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1245' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE5do_isEtw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2275'/>
@@ -40528,7 +40528,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1264' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_is' mangled-name='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1264' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE5do_isEPKwS2_Pt@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2280'/>
             <parameter type-id='type-id-2280'/>
@@ -40537,7 +40537,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='4'>
-          <function-decl name='do_scan_is' mangled-name='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1282' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_scan_is' mangled-name='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1282' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_scan_isEtPKwS2_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2280'/>
@@ -40546,7 +40546,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='5'>
-          <function-decl name='do_scan_not' mangled-name='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1300' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_scan_not' mangled-name='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1300' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE11do_scan_notEtPKwS2_@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2242'/>
             <parameter type-id='type-id-2280'/>
@@ -40555,14 +40555,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='6'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1317' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1317' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_toupperEw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='7'>
-          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1334' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_toupper' mangled-name='_ZNKSt5ctypeIwE10do_toupperEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1334' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_toupperEPwPKw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2281'/>
             <parameter type-id='type-id-2280'/>
@@ -40570,14 +40570,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='8'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1350' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1350' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_tolowerEw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='9'>
-          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1367' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_tolower' mangled-name='_ZNKSt5ctypeIwE10do_tolowerEPwPKw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1367' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE10do_tolowerEPwPKw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2281'/>
             <parameter type-id='type-id-2280'/>
@@ -40585,14 +40585,14 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='10'>
-          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1387' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1387' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE8do_widenEc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-202'/>
             <return type-id='type-id-2275'/>
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='11'>
-          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1409' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_widen' mangled-name='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1409' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE8do_widenEPKcS2_Pw@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-4'/>
             <parameter type-id='type-id-4'/>
@@ -40601,7 +40601,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='12'>
-          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEwc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1432' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEwc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1432' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE9do_narrowEwc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2275'/>
             <parameter type-id='type-id-202'/>
@@ -40609,7 +40609,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='13'>
-          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1458' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_narrow' mangled-name='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets.h' line='1458' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2214' is-artificial='yes'/>
             <parameter type-id='type-id-2280'/>
             <parameter type-id='type-id-2280'/>
@@ -47214,7 +47214,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIcE6do_getEiiiRKSs' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1869' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIcE6do_getEiiiRKSs' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1869' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt8messagesIcE6do_getEiiiRKSs@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2771' is-artificial='yes'/>
             <parameter type-id='type-id-2772'/>
             <parameter type-id='type-id-6'/>
@@ -50629,7 +50629,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1874' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1874' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2831' is-artificial='yes'/>
             <parameter type-id='type-id-2772'/>
             <parameter type-id='type-id-6'/>
@@ -59336,7 +59336,7 @@
           </function-decl>
         </member-function>
         <member-function access='protected' const='yes' vtable-offset='3'>
-          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1874' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <function-decl name='do_get' mangled-name='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE' filepath='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/locale_facets_nonio.h' line='1874' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNKSt8messagesIwE6do_getEiiiRKSbIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4'>
             <parameter type-id='type-id-2831' is-artificial='yes'/>
             <parameter type-id='type-id-2772'/>
             <parameter type-id='type-id-6'/>
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 13/16] ir: Really avoid canonicalizing decl-only classes
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (11 preceding siblings ...)
  2023-09-07 14:05 ` [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions Dodji Seketeli
@ 2023-09-07 14:07 ` Dodji Seketeli
  2023-09-07 14:08 ` [PATCH 14/16] ir: Use non qualified typedef name for type canonicalization Dodji Seketeli
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:07 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

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

Hello,

is_non_canonicalized_type uses is_declaration_only_class_or_union_type
to detect decl-only classes, but it doesn't differentiate between
decl-only classes that are associated to a class definition and those
that are not.

We want to avoid canonicalizing decl-only classes that are not
associated to any class definition.

This patch fixes the invocation of
is_declaration_only_class_or_union_type to express the above
assertion.

This fix uncovered another self-comparison issue that was being
expressed when running the command below:

    $ abidw --abidiff tests/data/test-types-stability/PR27086-libstdc++.so.6.0.26

That one was due to an error in method_decl::set_linkage_name which
was making classes contain the wrong overloads of methods.  The patch
fixes that error too.

	* include/abg-fwd.h (is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type): Remove declarations.
	(is_typedef_ptr_or_ref_to_decl_only_class_or_union_type): Declare
	new function.
	* src/abg-ir.cc (is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type): Remove definitions.
	(is_typedef_ptr_or_ref_to_decl_only_class_or_union_type): Define
	new function.
	(is_non_canonicalized_type): Change the invocation of
	is_declaration_only_class_or_union_type to make it look through
	decl-only types.  Use
	is_typedef_ptr_or_ref_to_decl_only_class_or_union_type in lieu of
	is_{pointer,reference,typedef}_to_decl_only_class_or_union_type
	that got removed.
	(method_decl::set_linkage_name): Remove the mapping between the
	method and the old linkage name, only if the old name is different
	from the new name.  Duh.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 include/abg-fwd.h                             |     8 +-
 src/abg-ir.cc                                 |    68 +-
 tests/data/test-annotate/libtest23.so.abi     |   363 +-
 .../data/test-annotate/test15-pr18892.so.abi  |    55 -
 .../data/test-annotate/test17-pr19027.so.abi  |   934 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  5832 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  7483 ++--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  7566 ++--
 .../data/test-annotate/test21-pr19092.so.abi  |    88 +-
 .../PR22015-libboost_iostreams.so.abi         |   682 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    | 13186 +++----
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |  8778 ++---
 tests/data/test-read-dwarf/libtest23.so.abi   |   358 +-
 .../test-read-dwarf/test-libaaudio.so.abi     |     4 +-
 .../test-read-dwarf/test-libandroid.so.abi    |  1544 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |  1391 +-
 .../test-read-dwarf/test11-pr18828.so.abi     | 11160 +++---
 .../test-read-dwarf/test12-pr18844.so.abi     | 23647 ++++++------
 .../test-read-dwarf/test15-pr18892.so.abi     |    42 -
 .../test-read-dwarf/test16-pr18904.so.abi     | 15271 ++++----
 .../test-read-dwarf/test17-pr19027.so.abi     |   894 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  5738 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  7239 ++--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  7277 ++--
 .../test-read-dwarf/test21-pr19092.so.abi     |    82 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 31278 ++++++++--------
 .../test9-pr18818-clang.so.abi                |  2691 +-
 27 files changed, 76386 insertions(+), 77273 deletions(-)

The file is too large for the mailing list so I am attaching it gzipped.


[-- Attachment #2: 0013-ir-Really-avoid-canonicalizing-decl-only-classes.patch.gz --]
[-- Type: application/gzip, Size: 1569870 bytes --]

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


-- 
		Dodji

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

* [PATCH 14/16] ir: Use non qualified typedef name for type canonicalization
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (12 preceding siblings ...)
  2023-09-07 14:07 ` [PATCH 13/16] ir: Really avoid canonicalizing decl-only classes Dodji Seketeli
@ 2023-09-07 14:08 ` Dodji Seketeli
  2023-09-07 14:09 ` [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types Dodji Seketeli
  2023-09-07 14:10 ` [PATCH 16/16] dwarf-reader: Do not re-use typedefs in a scope Dodji Seketeli
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:08 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

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

Hello,

While looking into fixing self-comparison errors for the gcc-gnat
package[1], I stumbled upon the fact that a typedef that is defined in
the global scope is different from a typedef defined in a scope, even
if they both point to the same underlying type.  This is a spurious
difference that feeds a spurious explosion of the number of canonical
types, for no reason.  It can lead to spurious self-comparison errors
down the road.  Sadly, fixing this issue is not enough to fix the
self-comparison error in [1].

[1]: The command is:

    $ fedabipkgdiff --self-compare  -a --from fc37 gcc-gnat

	* include/abg-ir.h (reference_type_def::{pointed_to_type_,
	is_lvalue_}): Remove these data members.
	(reference_type_def::priv_): Add a unique data member.
	(typedef_decl::get_qualified_name): Add new virtual member
	functions.
	* src/abg-ir.cc (get_decl_name_for_comparison): If the decl we are
	comparing is a typedef, only consider its non-qualified name.
	(get_type_name): For internal purposes, the type name of a typedef
	is its non-qualified name.
	(pointer_type_def::get_qualified_name): For internal purposes, if
	the pointed-to name is a typedef, use the non-qualified name of
	the typedef.
	(reference_type_def::priv): Define new data type.
	(reference_type_def::reference_type_def): Initialize the new
	reference_type_def::priv_ data member and adjust to the move of
	the reference_type_def::pointed_to_type_ data member to
	reference_type_def::priv::pointed_to_type_.
	(reference_type_def::{s,g}et_pointed_to_type): Adjust.
	(reference_type_def::is_lvalue): Likewise.
	(reference_type_def::get_qualified_name): Support caching
	qualified names for internal and non-internal purposes.
	(typedef_decl::get_pretty_representation): For internal purposes,
	use non-qualified typedef name.
	(typedef_decl::get_qualified_name): Define the two overloads for
	this virtual member function.
	(function_decl::get_pretty_representation): Use the
	'qualified_name' parameter.  Also, rather than systematically
	using the qualified name of the return type, use get_type_name
	instead that knows when to use qualified names and when not to.
	(qualified_name_setter::do_update):
	* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt:
	Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test0.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test1.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Likewise.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 include/abg-ir.h                              |    11 +-
 src/abg-ir.cc                                 |   182 +-
 .../test-abidiff/test-PR18791-report0.txt     |    13 -
 tests/data/test-annotate/libtest23.so.abi     |   132 +-
 .../test-annotate/libtest24-drop-fns-2.so.abi |   598 +-
 .../test-annotate/libtest24-drop-fns.so.abi   |   598 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 14124 +++---
 .../data/test-annotate/test17-pr19027.so.abi  |  1238 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  4426 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  3824 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  6670 ++-
 .../test42-PR21296-clanggcc-report0.txt       |    14 +-
 .../PR22015-libboost_iostreams.so.abi         |  2305 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    | 14743 +++---
 tests/data/test-read-dwarf/libtest23.so.abi   |   131 +-
 .../libtest24-drop-fns-2.so.abi               |   586 +-
 .../test-read-dwarf/libtest24-drop-fns.so.abi |   586 +-
 .../test-read-dwarf/test-libaaudio.so.abi     |     4 +-
 .../test-read-dwarf/test-libandroid.so.abi    | 10274 ++--
 tests/data/test-read-dwarf/test0.hash.abi     |     4 +-
 tests/data/test-read-dwarf/test1.hash.abi     |    10 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |  2902 +-
 .../test-read-dwarf/test11-pr18828.so.abi     |  9501 ++--
 .../test-read-dwarf/test12-pr18844.so.abi     | 23913 +++++----
 .../test-read-dwarf/test15-pr18892.so.abi     | 13953 +++---
 .../test-read-dwarf/test16-pr18904.so.abi     | 13513 +++--
 .../test-read-dwarf/test17-pr19027.so.abi     |  1248 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  4403 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  3750 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  6651 ++-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 41099 ++++++++--------
 .../test9-pr18818-clang.so.abi                |  2628 +-
 .../test28-without-std-fns-ref.xml            |   350 +-
 .../test28-without-std-vars-ref.xml           |   348 +-
 34 files changed, 89416 insertions(+), 95316 deletions(-)

The file is too large for the mailing list so I am attaching it gzipped.


[-- Attachment #2: 0014-ir-Use-non-qualified-typedef-name-for-type-canonical.patch.gz --]
[-- Type: application/gzip, Size: 1915057 bytes --]

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


-- 
		Dodji

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

* [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (13 preceding siblings ...)
  2023-09-07 14:08 ` [PATCH 14/16] ir: Use non qualified typedef name for type canonicalization Dodji Seketeli
@ 2023-09-07 14:09 ` Dodji Seketeli
  2023-09-07 14:10 ` [PATCH 16/16] dwarf-reader: Do not re-use typedefs in a scope Dodji Seketeli
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:09 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

Hello,

While looking at something else, there are some types considered
having "non-confirmed propagated canonical type", even though those
types are not even canonical-type-propagated.  This patch fixes that.

That doesn't have any visible impact, but it's definitely more
correct.

	* src/abg-ir.cc (return_comparison_result): A type that doesn't
	have propagated canonical type can't be considered having
	"non-confirmed propagated canonical type".

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-ir.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index f318a027..e7a2d6a8 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -1041,7 +1041,10 @@ return_comparison_result(T& l, T& r, bool value,
 	  // eventually fails.
 	  env.priv_->add_to_types_with_non_confirmed_propagated_ct(is_type(&r));
 	}
-      else if (value == true && env.priv_->right_type_comp_operands_.empty())
+      else if (value == true
+	       && env.priv_->right_type_comp_operands_.empty()
+	       && is_type(&r)->priv_->canonical_type_propagated()
+	       && !is_type(&r)->priv_->propagated_canonical_type_confirmed())
 	{
 	  // The type provided in the 'r' argument is the type that is
 	  // being canonicalized; 'r' is not a mere subtype being
@@ -1052,7 +1055,9 @@ return_comparison_result(T& l, T& r, bool value,
 	  // "canonical type propagation" optimization.
 	  env.priv_->confirm_ct_propagation(&r);
 	}
-      else if (value == true)
+      else if (value == true
+	       && is_type(&r)->priv_->canonical_type_propagated()
+	       && !is_type(&r)->priv_->propagated_canonical_type_confirmed())
 	// In any other case, we are not sure if propagated types
 	// should be confirmed yet.  So let's mark them as such.
 	env.priv_->add_to_types_with_non_confirmed_propagated_ct(is_type(&r));
-- 
2.39.3



-- 
		Dodji


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

* [PATCH 16/16] dwarf-reader: Do not re-use typedefs in a scope
  2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
                   ` (14 preceding siblings ...)
  2023-09-07 14:09 ` [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types Dodji Seketeli
@ 2023-09-07 14:10 ` Dodji Seketeli
  15 siblings, 0 replies; 17+ messages in thread
From: Dodji Seketeli @ 2023-09-07 14:10 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail

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

Hello,

Sometimes, two typedefs of the same name can appear at the same scope
but point to different types, in DWARF.  Unbelievable but true.  In
those case, we do not want to re-use the typedef, obviously, as we can
possibly misrepresent the type graph in that case.

This fixes one self-comparison issue for the x86_64 sub-package of the
gcc-gnat package that is tested by doing:

    $ fedabipkgdiff --self-compare  -a --from fc37 gcc-gnat

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): Do not re-use
	a typedef from a given scope.
	* src/abg-reader.cc (build_typedef_type): Do not re-use typedefs
	with the same ID.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
	Likewise.
	* tests/data/test-diff-filter/test41-report-0.txt: Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc                       |    10 +-
 src/abg-reader.cc                             |     7 -
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  8830 ++--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10776 ++---
 .../test31-pr18535-libstdc++-report-0.txt     |    31 +-
 .../test31-pr18535-libstdc++-report-1.txt     |    31 +-
 .../data/test-diff-filter/test41-report-0.txt |    30 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    |  6150 +--
 .../test-read-dwarf/test-libandroid.so.abi    |  4862 ++-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |  2933 +-
 .../test-read-dwarf/test11-pr18828.so.abi     |  1239 +-
 .../test-read-dwarf/test12-pr18844.so.abi     |  3798 +-
 .../test-read-dwarf/test16-pr18904.so.abi     | 12355 +++---
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  8789 ++--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10651 ++---
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 35982 ++++++++--------
 .../test9-pr18818-clang.so.abi                |   736 +-
 17 files changed, 55160 insertions(+), 52050 deletions(-)

The file is too large for the mailing list so I am attaching it gzipped.


[-- Attachment #2: 0016-dwarf-reader-Do-not-re-use-typedefs-in-a-scope.patch.gz --]
[-- Type: application/gzip, Size: 1103862 bytes --]

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


-- 
		Dodji

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

end of thread, other threads:[~2023-09-07 14:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
2023-09-07 13:34 ` [PATCH 01/16] reader: fix indentation Dodji Seketeli
2023-09-07 13:35 ` [PATCH 02/16] tools-utils: Fix indentation Dodji Seketeli
2023-09-07 13:38 ` [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end Dodji Seketeli
2023-09-07 13:39 ` [PATCH 04/16] dwarf-reader: Fix some logging Dodji Seketeli
2023-09-07 13:39 ` [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context Dodji Seketeli
2023-09-07 13:40 ` [PATCH 06/16] tools-utils: Avoid endless loop Dodji Seketeli
2023-09-07 13:41 ` [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error Dodji Seketeli
2023-09-07 13:41 ` [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package Dodji Seketeli
2023-09-07 13:42 ` [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine Dodji Seketeli
2023-09-07 14:02 ` [PATCH 10/16] ir: Add fn types to type lookup maps Dodji Seketeli
2023-09-07 14:03 ` [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Dodji Seketeli
2023-09-07 14:05 ` [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions Dodji Seketeli
2023-09-07 14:07 ` [PATCH 13/16] ir: Really avoid canonicalizing decl-only classes Dodji Seketeli
2023-09-07 14:08 ` [PATCH 14/16] ir: Use non qualified typedef name for type canonicalization Dodji Seketeli
2023-09-07 14:09 ` [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types Dodji Seketeli
2023-09-07 14:10 ` [PATCH 16/16] dwarf-reader: Do not re-use typedefs in a scope 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).