Bug#1055637: Debian debdiff attached
For your convenience, i've attached the Debian debdiff - the original patch
contained some binaries as part of the unit test, i removed them and i kept only
the code section.
Let me know.
--
bye,
p.
diff -Nru libabigail-2.4/debian/changelog libabigail-2.4/debian/changelog
--- libabigail-2.4/debian/changelog 2023-10-31 11:03:41.000000000 +0000
+++ libabigail-2.4/debian/changelog 2023-11-09 11:29:34.000000000 +0000
@@ -1,3 +1,10 @@
+libabigail (2.4-2) unstable; urgency=medium
+
+ * debian/patches/0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch:
+ - Fix assert violation while setting translation unit for unique types (Closes: #1055637)
+
+ -- Paolo Pisati <paolo.pisati@canonical.com> Thu, 09 Nov 2023 11:29:34 +0000
+
libabigail (2.4-1) unstable; urgency=medium
* New upstream version.
diff -Nru libabigail-2.4/debian/patches/0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch libabigail-2.4/debian/patches/0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch
--- libabigail-2.4/debian/patches/0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch 1970-01-01 00:00:00.000000000 +0000
+++ libabigail-2.4/debian/patches/0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch 2023-11-09 11:29:34.000000000 +0000
@@ -0,0 +1,100 @@
+From 35eed7922edf2e49604ff9d60eba20357152e36c Mon Sep 17 00:00:00 2001
+From: Dodji Seketeli <dodji@redhat.com>
+Date: Wed, 8 Nov 2023 14:46:04 +0100
+Subject: [PATCH] Bug 31045 - Don't try setting translation unit for unique
+ types
+
+Unique types (void, pointer to void and variadic parameter types)
+should not have their translation unit set whenever they are being
+added to a scope. This is because they are supposed to be created
+independently from any translation unit, even if technically, they are
+set to the translation unit they are referenced from, for the first
+time.
+
+To handle this, a new function maybe_set_translation_unit is created
+to handle the setting of the translation unit for decls added to a
+scope by scope_decl::{add,insert}_member_decl. That new function
+asserts that unique types should have their translation unit be set.
+
+ * src/abg-ir.cc (maybe_set_translation_unit): Define new static
+ function.
+ (scope_decl::{add,insert}_member_decl): Use it.
+ * tests/data/test-abidiff-exit/PR31045/zfs-abigail-2.4/libnvpair.{abi,so,suppr}:
+ New test input files.
+ * tests/data/test-abidiff-exit/PR31045/zfs-abigail-2.4/test-PR31045-report-1.txt:
+ New reference test output.
+ * tests/data/Makefile.am: Add the new test material above to
+ source distribution.
+ * tests/test-abidiff-exit.cc (in_out_specs): Add the input above
+ to this test harness.
+
+Signed-off-by: Dodji Seketeli <dodji@redhat.com>
+---
+ src/abg-ir.cc | 42 +-
+ 1 file changed, 30 insertions(+), 12 deletions(-)
+
+--- a/src/abg-ir.cc
++++ b/src/abg-ir.cc
+@@ -7974,6 +7974,34 @@
+ && get_canonical_types().empty());
+ }
+
++/// Set the translation unit of a decl
++///
++/// It also perform some IR integrity checks.
++///
++/// This is a sub-routine of scope_decl::{insert,add}_member_decl.
++///
++/// @param decl the decl to set the translation unit for.
++///
++/// @param tu the translation unit to set.
++static void
++maybe_set_translation_unit(const decl_base_sptr& decl,
++ translation_unit* tu)
++{
++ if (translation_unit* existing_tu = decl->get_translation_unit())
++ // The decl already belongs to a translation unit.
++ // Either:
++ //
++ // 1/ it's a unique type, in which case we should not add it to
++ // any translation unique since unique types are "logically"
++ // supposed to belong to no translation unit in particular, as
++ // they are unique.
++ //
++ // 2/ or the decl was already added to this translation unit.
++ ABG_ASSERT(tu == existing_tu || is_unique_type(is_type(decl)));
++ else
++ decl->set_translation_unit(tu);
++}
++
+ /// Add a member decl to this scope. Note that user code should not
+ /// use this, but rather use add_decl_to_scope.
+ ///
+@@ -7999,12 +8027,7 @@
+ update_qualified_name(member);
+
+ if (translation_unit* tu = get_translation_unit())
+- {
+- if (translation_unit* existing_tu = member->get_translation_unit())
+- ABG_ASSERT(tu == existing_tu);
+- else
+- member->set_translation_unit(tu);
+- }
++ maybe_set_translation_unit(member, tu);
+
+ maybe_update_types_lookup_map(member);
+
+@@ -8141,12 +8164,7 @@
+ update_qualified_name(member);
+
+ if (translation_unit* tu = get_translation_unit())
+- {
+- if (translation_unit* existing_tu = member->get_translation_unit())
+- ABG_ASSERT(tu == existing_tu);
+- else
+- member->set_translation_unit(tu);
+- }
++ maybe_set_translation_unit(member, tu);
+
+ maybe_update_types_lookup_map(member);
+
diff -Nru libabigail-2.4/debian/patches/series libabigail-2.4/debian/patches/series
--- libabigail-2.4/debian/patches/series 2023-10-31 11:03:41.000000000 +0000
+++ libabigail-2.4/debian/patches/series 2023-11-09 11:29:34.000000000 +0000
@@ -1 +1,2 @@
arch-indep-pkgconfig.diff
+0001-Bug-31045-Don-t-try-setting-translation-unit-for-uni.patch
Reply to: