This was filled at https://bugzilla.redhat.com/show_bug.cgi?id=
2114909
When analysing the edit script representing the changes in the base
base classes of a given class, libabigail refers to the changed base
classes using their names.
The problem is that there can be several changed base classes that
have the same name, even though their /qualified/ names are
different. That was wreaking having havoc down the road.
To solve the problem, use the qualified name of the base classes,
instead of their simple name.
Note that this change did also ameliorate other existing change
reports in the test suite.
While testing the fix, I realized that class_decl::base_spec doesn't
set its qualified name. That leads to the fact that it's the
non-qualified name that is used for sorting the base class names in
the change reports. This can lead to instabilities, depending on the
platform, in test output. This is also fixed.
Fixed thus.
* src/abg-comparison.cc
(class_diff::ensure_lookup_tables_populated): Refer to the added
or removed base class using its qualified name.
* src/abg-ir.cc (class_decl::base_spec::base_spec): Set the
qualified name of the base_spec.
* tests/data/test-abidiff-exit/test-rhbz2114909-report-1.txt: New
reference test output.
* tests/data/test-abidiff-exit/test-rhbz2114909-v{0,1}.o: New
input test binaries.
* tests/data/test-abidiff-exit/test-rhbz2114909-v{0,1}.cc: Source
code of the binaries, above.
* tests/data/Makefile.am: Add the new test materials above to
source distribution.
* tests/test-abidiff-exit.cc (in_out_specs): Add the new tests to
this harness.
* tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
unsigned i = it->index();
class_decl::base_spec_sptr b =
first_class_decl()->get_base_specifiers()[i];
- string name = b->get_base_class()->get_name();
+ string name = b->get_base_class()->get_qualified_name();
ABG_ASSERT(get_priv()->deleted_bases_.find(name)
== get_priv()->deleted_bases_.end());
get_priv()->deleted_bases_[name] = b;
unsigned i = *iit;
class_decl::base_spec_sptr b =
second_class_decl()->get_base_specifiers()[i];
- string name = b->get_base_class()->get_name();
+ string name = b->get_base_class()->get_qualified_name();
ABG_ASSERT(get_priv()->inserted_bases_.find(name)
== get_priv()->inserted_bases_.end());
string_base_sptr_map::const_iterator j =
priv_(new priv(base, offset_in_bits, is_virtual))
{
runtime_type_instance(this);
+ set_qualified_name(base->get_qualified_name());
}
/// Get the base class referred to by the current base class
test-abidiff-exit/ld-2.28-210.so \
test-abidiff-exit/ld-2.28-211.so \
test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.txt \
-test-abidiff-exit/ld-2.28-21x.so.sources.txt \
+test-abidiff-exit/ld-2.28-21x.so.sources.txt \
+test-abidiff-exit/test-rhbz2114909-v0.cc \
+test-abidiff-exit/test-rhbz2114909-v0.o \
+test-abidiff-exit/test-rhbz2114909-v1.cc \
+test-abidiff-exit/test-rhbz2114909-v1.o \
+test-abidiff-exit/test-rhbz2114909-report-1.txt \
\
test-diff-dwarf/test0-v0.cc \
test-diff-dwarf/test0-v0.o \
--- /dev/null
+Functions changes summary: 0 Removed, 1 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+1 function with some indirect sub-type change:
+
+ [C] 'function void foo(ns2::C&)' at test-rhbz2114909-v1.cc:33:1 has some indirect sub-type changes:
+ parameter 1 of type 'ns2::C&' has sub-type changes:
+ in referenced type 'class ns2::C' at test-rhbz2114909-v1.cc:22:1:
+ type size changed from 160 to 96 (in bits)
+ 2 base class deletions:
+ class ns1::base_1 at test-rhbz2114909-v0.cc:3:1
+ class ns2::base_1 at test-rhbz2114909-v0.cc:16:1
+ 1 base class change:
+ 'class ns1::base_2' at test-rhbz2114909-v0.cc:8:1 changed:
+ 2 data member changes:
+ 'int m0' offset changed from 96 to 32 (in bits) (by -64 bits)
+ 'char m1' offset changed from 128 to 64 (in bits) (by -64 bits)
+
--- /dev/null
+namespace ns1
+{
+class base_1
+{
+ int m0;
+};
+
+class base_2
+{
+ int m0;
+};
+}
+
+namespace ns2
+{
+class base_1
+{
+ int m0;
+};
+
+class C : public base_1, ns1::base_1, ns1::base_2
+{
+ int m0;
+ char m1;
+public:
+ C()
+ {}
+};
+}
+
+void
+foo(ns2::C&)
+{
+}
--- /dev/null
+namespace ns1
+{
+class base_1
+{
+ int m0;
+};
+
+class base_2
+{
+ int m0;
+};
+}
+
+namespace ns2
+{
+
+class base_1
+{
+ int m0;
+};
+
+class C : public ns1::base_2
+{
+ int m0;
+ char m1;
+public:
+ C()
+ {}
+};
+}
+
+void
+foo(ns2::C&)
+{
+}
underlying type 'class std::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' changed:
type name changed from 'std::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' to 'std::__cxx11::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >'
type size changed from 128 to 192 (in bits)
- 1 base class change:
- 'class std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' changed:
- type name changed from 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl _M_impl' changed:
- type name changed from 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl' to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::__detail::_List_node_base _M_node' changed:
- type name changed from 'std::__detail::_List_node_base' to 'std::_List_node<long unsigned int>'
- type size changed from 128 to 192 (in bits)
- 1 base class insertion:
- struct std::__detail::_List_node_base
- 2 data member deletions:
- 'std::__detail::_List_node_base* _M_next', at offset 0 (in bits)
- 'std::__detail::_List_node_base* _M_prev', at offset 64 (in bits)
- 1 data member insertion:
- 'unsigned long int _M_data', at offset 128 (in bits)
- and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node'
- and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl'
+ 1 base class deletion:
+ class std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >
+ 1 base class insertion:
+ class std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >
'bool clearing_' offset changed from 128 to 192 (in bits) (by +64 bits)
[C] 'method bool sigc::connection::blocked()' has some indirect sub-type changes:
type of 'std::list<sigc::slot_base, std::allocator<sigc::slot_base> > slots_' changed:
type name changed from 'std::list<sigc::slot_base, std::allocator<sigc::slot_base> >' to 'std::__cxx11::list<sigc::slot_base, std::allocator<sigc::slot_base> >'
type size changed from 128 to 192 (in bits)
- 1 base class change:
- 'class std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >' changed:
- type name changed from 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >' to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl _M_impl' changed:
- type name changed from 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl' to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::__detail::_List_node_base _M_node' changed, as reported earlier
- and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node'
- and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl'
+ 1 base class deletion:
+ class std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >
+ 1 base class insertion:
+ class std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >
[C] 'method bool sigc::internal::signal_impl::blocked()' has some indirect sub-type changes:
implicit parameter 0 of type 'const sigc::internal::signal_impl*' has sub-type changes:
underlying type 'class std::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' changed:
type name changed from 'std::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' to 'std::__cxx11::list<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >'
type size changed from 128 to 192 (in bits)
- 1 base class change:
- 'class std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' changed:
- type name changed from 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >' to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl _M_impl' changed:
- type name changed from 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl' to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::__detail::_List_node_base _M_node' changed:
- type name changed from 'std::__detail::_List_node_base' to 'std::_List_node<long unsigned int>'
- type size changed from 128 to 192 (in bits)
- 1 base class insertion:
- struct std::__detail::_List_node_base
- 2 data member deletions:
- 'std::__detail::_List_node_base* _M_next', at offset 0 (in bits)
- 'std::__detail::_List_node_base* _M_prev', at offset 64 (in bits)
- 1 data member insertion:
- 'unsigned long int _M_data', at offset 128 (in bits)
- and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node'
- and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl'
+ 1 base class deletion:
+ class std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >
+ 1 base class insertion:
+ class std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >
'bool clearing_' offset changed from 128 to 192 (in bits) (by +64 bits)
[C] 'method void sigc::internal::signal_impl::block(bool)' has some indirect sub-type changes:
type of 'std::list<sigc::slot_base, std::allocator<sigc::slot_base> > slots_' changed:
type name changed from 'std::list<sigc::slot_base, std::allocator<sigc::slot_base> >' to 'std::__cxx11::list<sigc::slot_base, std::allocator<sigc::slot_base> >'
type size changed from 128 to 192 (in bits)
- 1 base class change:
- 'class std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >' changed:
- type name changed from 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >' to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- type of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl _M_impl' changed:
- type name changed from 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl' to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl'
- type size changed from 128 to 192 (in bits)
- 1 data member change:
- name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node', size changed from 128 to 192 (in bits) (by +64 bits)
- and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl'
+ 1 base class deletion:
+ class std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >
+ 1 base class insertion:
+ class std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >
================ end of changes of 'libsigc-2.0.so.0.0.0'===============
"data/test-abidiff-exit/test-PR29144-report-2.txt",
"output/test-abidiff-exit/test-PR29144-report-2.txt"
},
- {
+ {
"data/test-abidiff-exit/ld-2.28-210.so",
"data/test-abidiff-exit/ld-2.28-211.so",
"",
"data/test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.txt",
"output/test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.txt"
},
+ {
+ "data/test-abidiff-exit/test-rhbz2114909-v0.o",
+ "data/test-abidiff-exit/test-rhbz2114909-v1.o",
+ "",
+ "",
+ "",
+ "--no-default-suppression",
+ abigail::tools_utils::ABIDIFF_ABI_CHANGE,
+ "data/test-abidiff-exit/test-rhbz2114909-report-1.txt",
+ "output/test-abidiff-exit/test-rhbz2114909-report-1.txt"
+ },
{0, 0, 0 ,0, 0, 0, abigail::tools_utils::ABIDIFF_OK, 0, 0}
};