Bug 21153 - abipkgdiff reports undetermined interface subtype changes
authorDodji Seketeli <dodji@redhat.com>
Wed, 5 Jul 2017 15:02:49 +0000 (17:02 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 5 Jul 2017 16:04:28 +0000 (18:04 +0200)
When a type has a noop qualifier and that noop qualifier disapears in
a subsequent version of that type, the two versions of the type have
different internal pretty representations.  And that leads to the type
canonicalization code ending up with two different canonical types for
the two versions, even if they should be considered equivalent.

This patch makes a noop-qualified type have the same internal pretty
representation as its non-qualified variant.

* src/abg-ir.cc (get_name_of_qualified_type): A noop-qualified
type has an empty string as reprsentation for its qualifier.
* src/abg-dwarf-reader.cc (die_qualified_type_name): Adjust to
comply with what is done in get_name_of_qualified_type.  Adjust
comment too.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Adjust.
* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt:
New reference test output.
* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm: New
test binary input.
* tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm: Likewise.
* tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm: Likewise.
* tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm Likewise.
* tests/data/Makefile.am: Add the new test inputs to source distribution.
* tests/test-diff-pkg.cc (in_out_specs): Make this test harness run on
the new test inputs above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
src/abg-ir.cc
tests/data/Makefile.am
tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt [new file with mode: 0644]
tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm [new file with mode: 0644]
tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
tests/test-diff-pkg.cc

index 75f2cae65b2bd6e5c0c60e0f3ed1de59f75d3475..d6f3736f74eff2cf56fa366896ada7df4d05b258 100644 (file)
@@ -10137,10 +10137,9 @@ die_qualified_type_name(const read_context& ctxt,
              // keep the qualified-ness of the type.  So we introduce
              // a 'no-op' qualifier here.  Please remember that this
              // has to be kept in sync with what is done in
-             // abigail::ir::qualified_type_def::build_name.  So if
-             // you change this here, you have to change that code
-             // there too.
-             repr = "noop-qual";
+             // get_name_of_qualified_type.  So if you change this
+             // here, you have to change that code there too.
+             repr = "";
            else if (!has_underlying_type_die
                     || die_is_void_type(&underlying_type_die))
              {
index f035c7176e36ce618ff1ad79613db21eb4489b7b..e918c447ffd5e49595f923fe64c8bfed785302fd 100644 (file)
@@ -5549,7 +5549,7 @@ get_name_of_qualified_type(const type_base_sptr& underlying_type,
     // Please remember that this has to be kept in sync with what is
     // done in die_qualified_name, in abg-dwarf-reader.cc.  So if you
     // change this code here, please change that code there too.
-    quals_repr = "noop-qual";
+    quals_repr = "";
 
   if (!quals_repr.empty())
     {
index bc107303c583db93d1d6e4d67621658526e64b18..d8582931dd104658e53db2db8f659d3deaa3885a 100644 (file)
@@ -1316,6 +1316,11 @@ test-diff-pkg/spice-server-devel-0.12.8-1.el7.x86_64.rpm \
 test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt \
 test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt \
 test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt \
+test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt \
+test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm \
+test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm \
+test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm \
+test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm \
 \
 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/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt b/tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt
new file mode 100644 (file)
index 0000000..35f603d
--- /dev/null
@@ -0,0 +1,62 @@
+================ changes of 'libcdio.so.16.0.0'===============
+  Functions changes summary: 0 Removed, 2 Changed, 0 Added functions
+  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+  2 functions with some indirect sub-type change:
+
+    [C]'function discmode_t mmc_get_dvd_struct_physical(const CdIo_t*, cdio_dvd_struct_t*)' at mmc.c:949:1 has some indirect sub-type changes:
+      parameter 2 of type 'cdio_dvd_struct_t*' has sub-type changes:
+        in pointed to type 'typedef cdio_dvd_struct_t' at dvd.h:130:1:
+          underlying type 'union __anonymous_union__' at dvd.h:122:1 changed:
+            type size hasn't changed
+            2 data member changes:
+             type of 'cdio_dvd_disckey_t __anonymous_union__::disckey' changed:
+               underlying type 'struct cdio_dvd_disckey' at dvd.h:100:1 changed:
+                 type size hasn't changed
+                 1 data member change:
+                  'unsigned int cdio_dvd_disckey::agid' offset changed from 30 to 22 (in bits) (by -8 bits)
+
+             type of 'cdio_dvd_physical_t __anonymous_union__::physical' changed:
+               underlying type 'struct cdio_dvd_physical' at dvd.h:86:1 changed:
+                 type size hasn't changed
+                 1 data member change:
+                  type of 'cdio_dvd_layer_t cdio_dvd_physical::layer[4]' changed:
+                    array element type 'typedef cdio_dvd_layer_t' changed: 
+                      underlying type 'struct cdio_dvd_layer' at dvd.h:65:1 changed:
+                        type size hasn't changed
+                        8 data member changes:
+                         'unsigned int cdio_dvd_layer::track_density' offset changed from 21 to 5 (in bits) (by -16 bits)
+                         'unsigned int cdio_dvd_layer::bca' offset changed from 24 to 0 (in bits) (by -24 bits)
+                         'unsigned int cdio_dvd_layer::disc_size' offset changed from 24 to 16 (in bits) (by -8 bits)
+                         'unsigned int cdio_dvd_layer::linear_density' offset changed from 25 to 1 (in bits) (by -24 bits)
+                         'unsigned int cdio_dvd_layer::nlayers' offset changed from 25 to 9 (in bits) (by -16 bits)
+                         'unsigned int cdio_dvd_layer::track_path' offset changed from 27 to 11 (in bits) (by -16 bits)
+                         'unsigned int cdio_dvd_layer::layer_type' offset changed from 28 to 12 (in bits) (by -16 bits)
+                         'unsigned int cdio_dvd_layer::min_rate' offset changed from 28 to 20 (in bits) (by -8 bits)
+                    type size hasn't changed
+
+
+
+    [C]'function discmode_t mmc_get_dvd_struct_physical_private(void*, mmc_run_cmd_fn_t, cdio_dvd_struct_t*)' at mmc.c:450:1 has some indirect sub-type changes:
+      parameter 3 of type 'cdio_dvd_struct_t*' has sub-type changes:
+        in pointed to type 'typedef cdio_dvd_struct_t' at dvd.h:130:1:
+          underlying type 'union __anonymous_union__' changed, as reported earlier
+
+
+================ end of changes of 'libcdio.so.16.0.0'===============
+
+================ changes of 'libiso9660++.so.0.0.0'===============
+  Functions changes summary: 1 Removed, 0 Changed, 1 Added functions
+  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+  1 Removed function:
+
+    'method void std::vector<ISO9660::Stat*, std::allocator<ISO9660::Stat*> >::_M_emplace_back_aux<ISO9660::Stat*>(ISO9660::Stat*&&)'    {_ZNSt6vectorIPN7ISO96604StatESaIS2_EE19_M_emplace_back_auxIJS2_EEEvDpOT_}
+
+  1 Added function:
+
+    'method void std::vector<ISO9660::Stat*, std::allocator<ISO9660::Stat*> >::_M_realloc_insert<ISO9660::Stat*>(std::vector<ISO9660::Stat*, std::allocator<ISO9660::Stat*> >::iterator, ISO9660::Stat*&&)'    {_ZNSt6vectorIPN7ISO96604StatESaIS2_EE17_M_realloc_insertIJS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_}
+
+
+================ end of changes of 'libiso9660++.so.0.0.0'===============
+
diff --git a/tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm b/tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm
new file mode 100644 (file)
index 0000000..9548f11
Binary files /dev/null and b/tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm differ
diff --git a/tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm b/tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm
new file mode 100644 (file)
index 0000000..466634b
Binary files /dev/null and b/tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm differ
diff --git a/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm b/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm
new file mode 100644 (file)
index 0000000..a9aaf7e
Binary files /dev/null and b/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm differ
diff --git a/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm b/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm
new file mode 100644 (file)
index 0000000..c5246aa
Binary files /dev/null and b/tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm differ
index 8cede4a7dae0adf66c0c9ded85d1e51686c4cc39..b1b31ff921c12844d291aa8077863f303a600872 100644 (file)
       <parameter type-id='type-id-1755'/>
       <return type-id='type-id-33'/>
     </function-decl>
-    <function-decl name='operator new' mangled-name='_ZnwmRKSt9nothrow_t' filepath='../../.././libstdc++-v3/libsupc++/new' line='101' column='1' visibility='default' binding='global' size-in-bits='64'>
-      <parameter type-id='type-id-66'/>
-      <parameter type-id='type-id-1754'/>
-      <return type-id='type-id-33'/>
-    </function-decl>
   </abi-instr>
   <abi-instr version='1.0' address-size='64' path='../../.././libstdc++-v3/libsupc++/pbase_type_info.cc' comp-dir-path='/tmp/legendre/spack-stage/spack-stage-wfh0ig/gcc-4.7.4/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++' language='LANG_C_plus_plus'>
     <namespace-decl name='__cxxabiv1'>
index 06ce41f75cf7f3f68e1ed76ee0453b9e329239d1..4db8f23abe29dd3b4d8facdfe33f86b0b0ef13fe 100644 (file)
@@ -486,6 +486,18 @@ static InOutSpec in_out_specs[] =
     "data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt",
     "output/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt"
   },
+  {
+    "data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm",
+    "data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm",
+    "--no-default-suppression --redundant",
+    "",
+    "data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm",
+    "data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm",
+    "",
+    "",
+    "data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt",
+    "output/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt"
+  },
 #endif //WITH_RPM
 
 #ifdef WITH_DEB