When two virtual members functions have the same virtual index, the
same pretty representation, and one of them has no ELF symbols, then
they might be sorted in a way or in an other. This sorting hazard
breaks the runtestreaddwarf test on EL6.
This patch addresses that to make the virtual member function that has
no ELF symbol to come before the one with an ELF symbol.
Also, it turned out that runtestannotate is broken on EL6 too because
we are trying to demangle c++11-mangled symbols in there, and the
demangler (which is C++<11 only) on that platform doesn't really like
that. So this patch removes the tests in which there are c++11 symbols
that we try to demangle.
* src/abg-ir.cc (virtual_member_function_less_than::operator()):
Update comment. When two virtual functions have the same virtual
index and one of them has no ELF symbol, then that function is
less than the one with an ELF symbol.
* tests/data/Makefile.am: Remove
test-annotate/{test9-pr18818-clang.so.abi, test11-pr18828.so.abi,
test12-pr18844.so.abi, test16-pr18904.so.abi,
test22-pr19097-libstdc++.so.6.0.17.so.abi}.
* tests/data/test-annotate/test10-pr18818-gcc.so.abi: Remove.
* tests/data/test-annotate/test11-pr18828.so.abi: Likewise.
* tests/data/test-annotate/test12-pr18844.so.abi: Likewise.
* tests/data/test-annotate/test16-pr18904.so.abi: Likewise.
* tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Likewise.
* tests/test-annotate.cc (in_out_specs): Remove those tests above
which input files have been removed.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/test-valgrind-suppressions.supp: Make Helgrind
suppressions less specific to libgcc_s version.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/test-valgrind-suppressions.supp: Make the ostream writting
suppressions be less specific so that they can apply to all the
related false positives.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Moving this test away from using pthreads directly to use
abigail::workers.
This patch also updates the valgrind suppression file to suppress some
Helgrind false positives. Those are due to:
- libstdc++ apparently having some benign data races when emitting
data to ostream. This seems related to some facet manipulation that
happen at that point.
- some benign data race in some elfutils functions.
* tests/test-read-dwarf.cc (iospec, spec_lock, write_lock)
(out_abi_base, in_elf_base, in_abi_base): Remove these global
variables.
(handle_in_out_spec): Remove this.
(struct test_task): Write this task that does what
handle_in_out_spec was doing.
(test_task_sptr): Define new typedef.
(main): Remove the pthreads artifacts. Use the new test_task type
along with the abigail::workers interface.
* tests/test-valgrind-suppressions.supp: Add more helgrind
suppressions for ostream writting false positives.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests): When
A test fails, display the fedabipkgdiff command that triggered the failure.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
With this patch, the code of abipkgdiff.cc doesn't use the pthreads
API directly anymore. Rather, it uses the higher level "Workers
Queue" API provided by the abigail::workers namespace.
The main benefits are:
- better code readability and maintainability. The code base doesn't
have any global variable anymore. This is going to be helpful when
adding new features to the abipkgdiff.cc code base.
- faster code. The tests/runtestdiffpkg test program executes on ~
17s without the patch, and on ~ 11s with the patch on my old X220
laptop.
* tools/abipkgdiff.cc: Remove ftw.h, pthread.h, unistd.h, add
fts.h and abg-workers.h.
(verbose, elf_file_paths_tls_key, reports_map, env_map, map_lock)
(arg_lock, prog_options): Remove all these global variables.
(struct package_descriptor): Remove this type.
(pthread_routine_extract_package)
(first_package_tree_walker_callback_fn)
(second_package_tree_walker_callback_fn, pthread_routine_compare)
(pthread_join, pthread_routine_extract_pkg_and_map_its_content):
Remove these functions.
(options::{num_workers, verbose}): Define new data members.
(options::options): Initialize the new verbose and num_workers data members.
(package::erase_extraction_directory)
(erase_created_temporary_directories_parent): Take the program
options in parameter. Don't use the global verbose variable
anymore.
(package::erase_extraction_directories)
(erase_created_temporary_directories, extract_package): Take the
program options in parameter.
(extract_rpm, extract_deb, extract_tar): Likewise. And don't use
the global verbose variable anymore.
(compare): Don't use the global verbose variable anymore. Use the
new compare_task type along with the abigail::workers::queue type.
(pkg_extraction_task, pkg_prepare_task, compare_task)
(comparison_done_notify): Define new classes.
(maybe_update_vector_of_package_content): Define new static
function.
(create_maps_of_package_content): Don't take the ftw_cp_type
anymore. Don't use the global verbose variable anymore. Use the
fts_{open,read,close} functions, rather than the ftw one.
(extract_package_and_map_its_content): Don't use pthreads anymore.
Use the new pkg_extraction_task type created along with the
abigail::workers::queue type.
(prepare_packages): Don't use pthreads anymore. Use the new
pkg_prepare_task type along with the abigail::workers::queue type.
(elf_size_is_greater): Adjust to use
abigail::workers::queue::tasks, rather than the previous
compaer_args_sptr type.
(parse_command_line): Adjust to stop using the global verbose
variable.
(main): Remove use of global variables prog_options and also the
packages variable.
* tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt:
Adjust.
* tests/data/test-diff-pkg/dirpkg-0-report-0.txt: Likewise.
* tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt:
Likewise.
* tests/data/test-diff-pkg/test-rpm-report-0.txt: Likewise.
* tests/data/test-diff-pkg/test-rpm-report-1.txt: Likewise.
* tests/data/test-diff-pkg/test-rpm-report-2.txt: Likewise.
* tests/data/test-diff-pkg/test-rpm-report-3.txt: Likewise.
* tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt:
Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Under "make check-valgrindk", when valgrind returns errors, these
errors are ignored by make. It turns out it is the autoconf
VALGRIND_CHECK_RULES macro that does this. Fixed thus.
* autoconf-archive/ax_valgrind_check.m4 (check-valgrind): Don't
ignore errors.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/Makefile.am (check-valgrind-helgrind-recursive): New
target to run the tests recursively under the control of
Valgrind's Helgrind tool.
* tests/test-valgrind-suppressions.supp: Update this suppression
file with suppressions for Helgrind.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
While making abipkgdiff to use the abigail::workers API to do away
with using pthreads directory, it appeared that the abigail::workers
API needs fixes and enhancements.
Fixes
=====
* Don't try to schedule a task if the pointer to the task is nil
* Fix a data race when bringing workers (of a queue) down
* Always try to wake up all waiting threads when bringing down queue
workers.
* Fix a data race when accessing the queue condition variable
* Fix a data race when notifying listeners about the end of the job
performed by the task.
Enhancements
============
* Pass the "task done" notifier by reference, to the worker queue.
Without this, the worker queue needs to copy the "task done" notifier
by value. This implies that user code needs to provide task done
notifier instances that come with potentially complicated copy
constructors. By passing it by reference and by just re-using the
notifier from the user code, we do away with the need for copying
altogether. This also fixes some latent copying bugs.
* Add a workers::queue::schedule_tasks() method
This allows user code to schedule a vector of tasks at once.
* make workers::queue::get_completed_tasks() return a non-const vector
This enables user code to sort the completed tasks as they wish.
* include/abg-workers.h (queue::tasks_type): New typedef.
(queue::queue): Pass task_done_notify by reference.
(queue::schedule_tasks): Declare new member function.
(queue::get_completed_tasks): Return non-const vector.
* src/abg-workers.cc (queue::priv::default_notify): New data
member.
(queue::priv::notify): Make this data member be a reference.
(queue::priv::priv): Initialize the notify data member to either
the new default_notify (if no notifier is provided by the
constructor) or to the notifier provided by the constructor.
(queue::priv::schedule_task): Do not schedule a nil task. Update
comment.
(queue::priv::schedule_tasks): Add a new member function.
(queue::priv::do_bring_workers_down): Update comment. Protect
access to "bring_workers_down" with tasks_todo_mutex to prevent a
data race. Call pthread_cond_broadcast on the queue_cond
unconditionaly to prevent some worker threads to keep waiting for
ever. Also, protect the access to the queue_cond by the
queue_cond_mutex to precent a data race.
(queue::queue): Pass the notifier by reference. Update comment.
(queue::schedule_task): Update comment.
(queue::schedule_tasks): Define new member function.
(queue::wait_for_workers_to_complete): Update comment.
(queue::get_completed_tasks): Return a non-const vector. Update
comment.
(worker::wait_to_execute_a_task): Update several comments. Make
the execution of the notification code to be synchronized (on the
tasks_done_mutex).
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
I tried to run:
fedabipkgdiff vte291-0.39.1-1.fc22.x86_64 vte291-0.39.90-1.fc22.x86_64
And it wouldn't work :-(
The program considers the two packages as not being "peers". This has
to do with the RPM.is_peer method which considers the two package as
not being "peers", just because they have the same release number
(1.fc22).
They should be considered peers, though, because they have the same
name but different {version, release} pairs.
This patch fixes the RPM.is_peer method and adds the aforementioned
packages to the regression test suite for good measure.
* tools/fedabipkgdiff (RPM.is_peer): Update comment. Fix logic.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-0.39.1-1.fc22.x86_64.rpm:
New test input file.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-debuginfo-0.39.1-1.fc22.x86_64.rpm: Likewise.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-devel-0.39.1-1.fc22.x86_64.rpm: Likewise.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-0.39.90-1.fc22.x86_64.rpm: Likewise.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-debuginfo-0.39.90-1.fc22.x86_64.rpm: Likewise.
* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-devel-0.39.90-1.fc22.x86_64.rpm:
Likewise.
* tests/data/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt: Likewise.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/mockfedabipkgdiff.in: Update the package and build
information to add the new vte291-0.39.1-1.fc22.x86_64.rpm and
vte291-0.39.90-1.fc22.x86_64.rpm packages (as well as their devel
and debuginfo packages) into the "mock" Koji build database.
* tests/runtestfedabipkgdiff.py.in: Make this test harness run
over the two aforementioned packages.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The runtestfedabipkgdiff.py test was missing some input files from the
source distribution.
This patch adds them back.
Also, the test file name
test-fedabipkgdiff/test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt
was too long for tar to handle so that file was left out of the final
source distribution tarball. This patch renames that file to a
smaller name.
make distcheck should pass again now.
* tests/data/Makefile.am: Add three missing test input files to
the source distribution tarball. Renamed
test-fedabipkgdiff/test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt
into
test-fedabipkgdiff/test6-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt.
* tests/runtestfedabipkgdiff.py.in (FEDABIPKGDIFF_TEST_SPECS):
Renamed
test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt
into
test6-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch is a quick one liner to add a missing new line to an error
message from the runtestfedabipkgdiff.py test harness.
* tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests): Add
missing new line to an error message.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
It turns out the test <builddir>/tests/runtestfedabipkgdiff.py is
failing, but "make check TESTS=runtestfedabipkgdiff.py" is not.
In other words, runtestfedabipkgdiff.py is failing silently; we don't
see it when doing "make check".
The reason why runtestfedabipkgdiff.py is failing is that
mockfedabipkgdiff is trying to patch the global variable
DEFAULT_KOJI_TOPDIR from the fedabipkgdiff file; and that global
variable is not present in that file. The right global variable that
we want is DEFAULT_KOJI_TOPURL.
This patch fixes that issue.
The reason why the failing above is silent is because the the main
function wasn't returning 0 upon success and 1 otherwise.
This patch fixes that issue as well.
So with this patch, <builddir>/tests/runtestfedabipkgdiff does not
fail anymore and when it does, the "make check TESTS=runtestfedabipkgdiff.py"
fails as well.
* tests/mockfedabipkgdiff.in (run_fedabipkgdiff): Patch
fedabipkgdiff.DEFAULT_KOJI_TOPURL instead of
fedabipkgdiff.DEFAULT_KOJI_TOPDIR.
* tests/runtestfedabipkgdiff.py.in (main): Properly return 0 upon
success, 1 otherwise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
There are cases where a virtual member function doesn't have an
implementation that is defined and publicly exported. This is the
cases for virtual pure classes.
Even in those cases, users might want to detect vtable changes on
virtual member pure classes (interfaces).
Now that, for C++ binaries, all the partial representations of a class
are merged into one class (in a given binary), we can envision to
compare virtual member functions of classes as part of comparing two
classes.
This is what this patch does. While comparing two classes, the
virtual member functions are compared too.
Note that as there can be several virtual member functions that have
the same vtable offset (think about a virtual destructor that might
have several generated functions that 'conceptually' share the same
vtable offset), comparing the virtual functions can be a little bit
non-trivial.
The approach taken is to check that in the first set of virtual
functions, each virtual function actually matches at least one virtual
function in the second set. And the match is a "loose" one. That is,
it doesn't take into account the symbol name or the mangled name.
The patch also fixes the "less than" operator used to sort virtual
member functions.
There is also a buglet in the way we compute the highest vtable offset
number today. This patch provides a new function named
class_decl::get_biggest_vtable_offset that is used in the change reports.
The patch also fixes a related bug in where we were forgetting to
report about added and removed virtual member functions without an
associated elf symbol. This patch fixes that.
* include/abg-ir.h (class_decl::get_biggest_vtable_offset):
Declare new member function.
* src/abg-ir.cc (virtual_member_function_less_than::operator()):
Either compare the symbol id strings if the functions have
symbols or just compare their pretty representations.
(class_decl::get_biggest_vtable_offset): Define new member
function.
(methods_equal_modulo_elf_symbol)
(method_matches_at_least_one_in_vector): New static methods.
(equals): In the overload for classes, compare the virtual member
functions while comparing classes.
* src/abg-comparison.cc (represent): In the overload for
method_decl_sptr, fix the way we compute the highest vtable offset
number for a give class_decl.
(class_decl::ensure_lookup_tables_populated): Don't forget added
and removed virtual member functions in the report for changed
classes.
* tests/data/test-diff-dwarf/libtest41-PR20476-hidden-old.so: New
test binary input file.
* tests/data/test-diff-dwarf/libtest41-PR20476-hidden-new.so: Likewise.
* tests/data/test-diff-dwarf/test41-PR20476-hidden-report-0.txt:
New reference output.
* tests/data/Makefile.am: Add the new test material above to the
source distribution.
* tests/test-diff-dwarf.cc (in_out_spec): Add the new tests
here.
* tests/data/test-annotate/test10-pr18818-gcc.so.abi: Adjust.
* tests/data/test-annotate/test11-pr18828.so.abi: Adjust.
* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
* tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.
* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Adjust.
* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Adjust.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Adjust.
* tools/abidw.cc (parse_command_line): Don't require an empty
output file when parsing the --headers-dir option. This was a
thinko.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The runtestdiffpkg test has wrong paths to the spice-server packages.
Fixed thus.
* tests/test-diff-pkg.cc (in_out_specs): Fix paths to spice-server
packages.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This option that is present for the abidiff tool was missing for
abipkgdiff.
* doc/manuals/abidiff.rst: Fix a typo.
* doc/manuals/abipkgdiff.rst: Document the --harmless option.
* tools/abipkgdiff.cc: Update copyright year.
(options::show_harmless_changes): Add new data member.
(options::options): Initialize the new data member.
(display_usage): Add a help string for the new --harmless option.
(parse_command_line): Parse the new --harmless option.
(set_diff_context_from_opts): Configure the diff context
accordingly, if the user provided the --harmless option.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Under certain circumstances, a diff node (which we shall name N) that
belongs to the SUPPRESSED_CATEGORY category sees its belonging to that
category been propagated to its parent diff node, effectively
suppressing that parent diff node as well. This is how some function
diff nodes ends up being suppressed just because some of their
children diff nodes were suppressed.
This suppression category propagation is performed by a pass that
walks the diff nodes graph. To avoid infinite cycles, the pass avoids
visiting a diff node that is equivalent to a node that has already
been visited.
As a result, diff nodes equivalent to N (the class of equivalence of
N) are not traversed by the propagation pass. So their parent diff
nodes are not suppressed.
This leads to some functions not being suppressed as they should.
This phenomenon can be observed by comparing the two packages that are
provided in the regression test accompanying this patch using
abipkgdiff with the --redundant option.
Here is how the patch addresses the issue.
When the suppression category propagation pass considers a parent diff
node (named P) of a node N' (with N' being equivalent to N), it now
looks at the category of the *class of equivalence of N'* to determine
if that category should be propagated to P.
Previously, that pass would just look at the at the category of N'
(not the category of the class of equivalence of N') for the
propagation. But as N' has not been visited (because N has already
been visited and nodes equivalent to N are thus not visited) the
belonging of N' to the SUPPRESSED_CATEGORY hasn't been updated. So N'
isn't marked as being in SUPPRESSED_CATEGORY. So the
SUPPRESSED_CATEGORY wouldn't be propagated to P as it should.
So, with this patch abipkgdiff invoked with the --redundant option now
correctly yields:
$ abipkgdiff --redundant --d1 spice-debuginfo-0.12.4-19.el7.x86_64.rpm --d2 spice-debuginfo-0.12.8-1.el7.x86_64.rpm --devel1 spice-server-devel-0.12.4-19.el7.x86_64.rpm --devel2 spice-server-devel-0.12.8-1.el7.x86_64.rpm spice-server-0.12.4-19.el7.x86_64.rpm spice-server-0.12.8-1.el7.x86_64.rpm
================ changes of 'libspice-server.so.1.8.0'===============
Functions changes summary: 1 Removed, 2 Changed (62 filtered out), 8 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
[...]
2 functions with some indirect sub-type change:
[C]'function spice_image_compression_t spice_server_get_image_compression(SpiceServer*)' at reds.c:3618:1 has some indirect sub-type changes:
return type changed:
underlying type 'enum __anonymous_enum__' changed:
type size hasn't changed
7 enumerator deletions:
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_INVALID' value '0'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_OFF' value '1'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_AUTO_GLZ' value '2'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_AUTO_LZ' value '3'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_QUIC' value '4'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_GLZ' value '5'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_LZ' value '6'
9 enumerator insertions:
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_INVALID' value '0'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_OFF' value '1'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_AUTO_GLZ' value '2'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_AUTO_LZ' value '3'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_QUIC' value '4'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_GLZ' value '5'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_LZ' value '6'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_LZ4' value '7'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_ENUM_END' value '8'
[C]'function int spice_server_set_image_compression(SpiceServer*, spice_image_compression_t)' at reds.c:3602:1 has some indirect sub-type changes:
parameter 2 of type 'typedef spice_image_compression_t' changed:
underlying type 'enum __anonymous_enum__' changed:
type size hasn't changed
7 enumerator deletions:
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_INVALID' value '0'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_OFF' value '1'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_AUTO_GLZ' value '2'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_AUTO_LZ' value '3'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_QUIC' value '4'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_GLZ' value '5'
'__anonymous_enum__::SPICE_IMAGE_COMPRESS_LZ' value '6'
9 enumerator insertions:
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_INVALID' value '0'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_OFF' value '1'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_AUTO_GLZ' value '2'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_AUTO_LZ' value '3'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_QUIC' value '4'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_GLZ' value '5'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_LZ' value '6'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_LZ4' value '7'
'SpiceImageCompression::SPICE_IMAGE_COMPRESSION_ENUM_END' value '8'
================ end of changes of 'libspice-server.so.1.8.0'===============
$
* include/abg-comparison.h (diff::get_class_of_equiv_category):
Declare new member function.
* src/abg-comparison.cc: Update copyright year.
(diff::get_class_of_equiv_category): Define new member function.
(suppression_categorization_visitor::visit_end): When considering
children nodes category for propagation, consider the category of
the class of equivalence of children nodes.
* spice-debuginfo-0.12.4-19.el7.x86_64.rpm: New input test package.
* spice-debuginfo-0.12.8-1.el7.x86_64.rpm: Likewise.
* spice-server-0.12.4-19.el7.x86_64.rpm: Likewise.
* spice-server-0.12.8-1.el7.x86_64.rpm: Likewise.
* spice-server-devel-0.12.4-19.el7.x86_64.rpm: Likewise.
* spice-server-devel-0.12.8-1.el7.x86_64.rpm: Likewise.
* spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt:
New reference test output.
* spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Likewise.
* spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.
* tests/data/Makefile.am: Add the new test material above to
source distribution.
* tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs
to the list of packages to test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When using abipkgdiff types that are defined in files not present in
the devel packages provided by the --devel1 and --devel2 option are
dropped from the internal representation by default.
This has been designed as such, not only to avoid showing changes on
types that are not part of the public headers of a shared library, but
also to help lower the memory consumption of libabigail.
In this particular bug report, we see a library that uses types (in
its public interface) that are defined in headers of a *different*
package. For instance, suppose a particular package foo that uses
types defined in headers of the glib package. And some of those Glib
types can be present in its public interface.
So in this case, libabigail is dropping a type that is actually part
of the public interface of the library that is being analyzed, even if
the type was not defined in the devel package of the current package.
This patch addresses the issue by doing a number of things:
1/ If a type is defined in a file which path starts with
"/usr/include/", then consider it as a public type. This is so
that type coming from the public interface of other packages, and
that are defined in system headers are considered as part of the
public types of the package being analyzed.
2/ by default, don't drop types not defined in the associated
devel package. This will hinder our ability to decrease the
memory usage, but there have been a number of recent optimization
that help in that regard independently. So I am hoping this
shouldn't have a big impact now.
Incidentally, the option --dont-drop-private-types (from abidiff)
is changed into --drop-private-types, so that interested users can
still drop non-private types from the model, if they wish. That
--drop-private-types option is added to abipkgdiff too.
As the offended types are not dropped from the model anymore, the
usual filtering mechanisms of libabigail can take place.
* doc/manuals/abidiff.rst (--dont-drop-private-types): Remove documentation.
(--drop-private-types): Document this new option.
* src/abg-tools-utils.cc: Update copyright notice
(handle_fts_entry): On the generated suppression specification, do
not set the flag to drop matched types. Also, don't match types
defined in files which patch start with "/usr/include/".
* tools/abidiff.cc (options::options): Initialize the
drop_private_types data member to false.
(display_usage): Remove usage string for
--dont-drop-private-types. Add a new one for
--drop-private-types.
(parse_command_line): Don't part --dont-drop-private-types,
rather, parse --drop-private-types.
(set_suppressions): When the suppression for private types is
generated, if --drop-private-types was provided, then instruct the
suppression to drop matched types.
* tools/abipkgdiff.cc (options::drop_private_types): New option.
(options::options): Initialize the new drop_private_types data
member to false.
(display_usage): Add a usage string for --drop-private-types.
(parse_command_line): Parse the new --drop-private-types option.
(maybe_create_private_types_suppressions): Don't take just a
package, but a package_descriptor because the latter carries the
options. So when the user used the --drop-private-types option,
make the generated private types suppression to drop matched
types.
* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt:
Adjust.
* tests/test-diff-suppr.cc (in_out_specs): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When reading C++ class informatin DWARF, it can happen that a given
virtual member function does not yet have a vtable offset. Right now,
that offset is set to zero. Just like a virtual member function which
actual vtable offset is zero. So we don't make a difference between a
virtual function with no vtable offset and a virtual function with a
vtable offset set to zero.
This can lead to confusions during class comparison.
This patch fixes that problem by setting the default vtable offset to
-1. So whenever a vtable offset is -1 it means that the virtual
member function doesn't yet have a vtable offset.
* include/abg-fwd.h (member_function_has_vtable_offset): Declare
new function.
(get_member_function_vtable_offset): Return a ssize_t, not a
size_t.
(set_member_function_vtable_offset): Take a ssize_t, not a size_t.
* include/abg-ir.h (class_decl::virtual_mem_fn_map_type): Adjust
the map typedef to make it take ssize_t as the type of the key.
(mem_fn_context_rel::vtable_offset_in_bits_): Make this data
member be of ssize_t type, not size_t.
(mem_fn_context_rel::mem_fn_context_rel): Initialize the
vtable_offset_in_bits_ data member to -1.
* src/abg-ir.cc (member_function_has_vtable_offset): Define new
function.
(get_member_function_vtable_offset): Return a ssize_t, not a
size_t.
(set_member_function_vtable_offset): Take a ssize_t, not a size_t.
* src/abg-dwarf-reader.cc (die_virtual_function_index): Take an
int64_t& rather than a uint64_t&.
(finish_member_function_reading): Don't set the vtable offset if
it's -1.
* src/abg-reader.cc (build_class_decl): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
maybe_canonicalize_type is too strict when given a non type. In that
case, it should just return, not abort.
* src/abg-dwarf-reader.cc (maybe_canonicalize_type): Don't abort
when trying to canonicalize a decl.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
We were sometimes forgetting to properly add some types to the lookup
maps as such. Instead, the types were added as if they were decls,
leading to later type lookup to fail.
Fixed thus.
* src/abg-dwarf-reader.cc
(read_context::associate_die_to_artifact_by_repr_internal):
Choose the right type of representation depending on if we are
associating a type or a decl.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Adjust.
* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Adjust.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Adjust.
* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Adjust.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Adjust.
* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
We forget to register member functions for lookup (by DWARF DIE
representation). So member functions are not correctly found (by
lookup) and thus are not properly de-duplicated or updated.
* src/abg-dwarf-reader.cc (add_or_update_class_type): Register
member functions for lookup by member function DIE representation.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When a function needs to be completed, we sometimes wrongly
try to de-duplicate rather than just complete it.
* src/abg-dwarf-reader.cc
(build_or_get_fn_decl_if_not_suppressed): Do try to de-duplicate a
function if it's to be completed.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When pretty printing static methods from DWARF, we were forgetting the
first parameter for static methods.
* src/abg-dwarf-reader.cc
(die_return_and_parm_names_from_fn_type_die): Take a new
'is_static' parameter.
(die_qualified_type_name, die_pretty_print_type): Adjust calling
die_return_and_parm_names_from_fn_type_die.
(die_function_signature): Likewise. Also, do not forget to print
the first parameter for a static method.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
In the DWARF for C++, it can happens that a virtual constructor leads
to several (up to 3) destructor functions that all have the same
vtable offset. That vtable offset is the same as the offset of the
virtual destructor that the user actually defined in her source code.
This patch adds a map data structure to the private data of
class_decl. That map associates a vtable offset X to a vector of
virtual member functions that have the same vtable offset X.
That new map is populated whenever a virtual member function is added
to the class.
* include/abg-ir.h (class_or_union::virtual_mem_fn_map_type):
Define new typedef.
(class_decl::get_virtual_mem_fns_map): Declare new accessor.
* src/abg-ir.cc (class_decl::priv::virtual_mem_fns_map_): New data
member.
(class_decl::get_virtual_mem_fns_map): Define new accessor.
(fixup_virtual_member_function): Populate the new virtual member
functions map.
(class_decl::on_canonical_type_set): Sort the virtual member
function vectors stored in the new virtual member functions map.
(class_decl::add_member_function): Call
set_member_function_is_virtual *after* calling
set_member_function_vtable_offset because the former updates the
virtual function map, so it needs the vtable offset.
* src/abg-dwarf-reader.cc (finish_member_function_reading):
Likewise.
* src/abg-reader.cc (build_class_decl): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
During structural (function) type comparison, computing the pretty
representation of the type at hand appears high on performance profiles,
especially when type canonicalization wasn't really effective.
This patch adds a type_base::get_cached_pretty_representation() and a
function_type::get_cached_name() to cache the pretty representation of
a type, as well as the function type name. This is way, the type
representation is computed just once and stored into a cache.
subsequent invocations of the function just look into the cache
instead of computing the representation again.
Note that we do this only for non-canonicalized types because these
types can still be modified, and so caching the representation of a
type that might be changed (and thus see its representation change)
leads to issue. So the representation of non-canonicalized types is
not cached.
* include/abg-ir.h (type_base::get_cached_pretty_representation):
Declare new function.
(function_type::get_cached_name): Likewise.
* src/abg-ir.cc (get_method_type_name): Use the new
type_base::get_cached_pretty_representation function.
(type_base::priv::{internal_cached_repr_, cached_repr_}): Add new
data members.
(function_type::priv::{internal_cached_name_, cached_name_}):
Likewise.
(type_base::get_cached_pretty_representation): Define new
function.
(function_type::get_cached_name): Likewise.
(type_base::get_canonical_type_for): Call
type_base::get_cached_pretty_representation here, so the internal
representation is cached right before canonicalization.
(function_type::{mark_as_being_compared, unmark_as_being_compared,
comparison_started}): Uset he new type_base::get_cached_name to
speed up function type name retrieval.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
It turned out we were missing deep comparison operators for smart
pointers to function_decl and method_decl. Because of coming patches
that compare virtual member functions as part of comparing classes, we
need these deep comparison operators.
* include/abg-ir.h (operator==): Declare two new overloads for
function_decl_sptr an method_decl_sptr.
* src/abg-ir.cc (operator==): Define two new overloads for
function_decl_sptr an method_decl_sptr.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
abidiff libjvm.so libjvm.so is taking forever in the master branch
these days. At some point it was taking ~ 15 minutes and 15GB of RAM
on a non-optimized build.
Profiling of CPU usage showed that sorting virtual member
functions of a class whenever a new virtual member function is added
was the hot spot.
This patch now sorts virtual member functions once right after the
type was canonicalized. The patch adds a virtual function
type_base::on_canonical_type_set() that is invoked right after the
canonical type is set for a given type. class_decl gets its own
version of that virtual function: class_decl::on_canonical_type_set.
In that function, the patch does sort the virtual member functions of
the current class_decl.
Now with this patch, abidiff is still taking around 15 minutes but it
consumes less than 12GB of ram. This means the memory consumption was
reduced by 20%. abipkgdiff performs on 16:30 minutes and in less than
12GB of RAM as well. All these times are measured on a non-optimized
build.
* include/abg-ir.h ({type_base,
class_decl}::on_canonical_type_set): Declare new virtual member
function.
* src/abg-ir.cc (type_base::on_canonical_type_set): Define new
virtual member function that does nothing.
(class_decl::on_canonical_type_set): Define new virtual member
function that sorts the virtual member functions of class_decl.
(canonicalize): Invoke type_base::on_canonical_type_set when the
canonical type is set.
(fixup_virtual_member_function): Don't sort virtual member
functions here.
* src/abg-dwarf-reader.cc (finish_member_function_reading): Do not
sort virtual member functions here.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Enterprise Linux (at least) kernels come with ABI whitelist files that list the
names of the set of functions to be considered when looking at the ABI
exposed by the kernel to its modules.
This patch adds a new --linux-kernel-abi-whitelist option to abidiff
so that it drops changes that relate to functions that are *NOT*
defined in the whitelist.
The patch reads the whitelist file and generates one or several
instances of function_suppression that are applied when the two
binaries are loaded.
* include/abg-suppression.h
(function_suppression::function_suppression): Make the declaration
of the default constructor public.
* src/abg-suppression-priv.h (function_suppression::priv::priv):
Declare a default constructor.
* src/abg-suppression.cc
(function_suppression::function_suppression): Define default
constructor.
* include/abg-tools-utils.h
(gen_suppr_spec_from_kernel_abi_whitelist): Declare new function.
* src/abg-tools-utils.cc
(gen_suppr_spec_from_kernel_abi_whitelist): Define new function.
* tools/abidiff.cc (options::kernel_abi_whitelist_paths):
(display_usage): Display a help string for the new
--linux-kernel-abi-whitelist option.
(parse_command_line): Parse the --linux-kernel-abi-whitelist from
the command line.
(maybe_check_suppression_files): Check the presence of the kernel
abi whitelist files.
(set_suppressions): Generate suppression specifications from the
whitelist files.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch teaches the ELF/DWARF reader of libabigail to load special
ELF sections that are specific to Linux Kernel binaries (either
vmlinux or linux kernel modules).
The patch creates a new flag that tells the ELF reader that it needs
to consider the input binary as a Linux Kernel binary. This is the
new 'Linux Kernel mode'.
In this linux kernel mode, the reader expects sections that are named
__ksymtab and/or __ksymtab_gpl sections. Those sections contain
indexes (of ELF symbols described in the normal ELF symbol table) of
exported ELF symbols that are specifically marked by developers using
EXPORT_SYMBOL or EXPORT_SYMBOL_GPL macros. These are symbols of
global variables and functions defined and meant to be used by kernel
modules. They constitute the interface exported by the Linux Kernel
to its modules. So the patch only exports the publicly defined and
exported ELF symbols that are also listed in __ksymtab and
__ksymtab_gpl sections.
The patch also fixes and re-organizes things left and right so that
this new mode works in a well integrated manner with the other parts
of the reader:
- The load address of the binary is no more assumed to be the load
address specified by the program header that is at offset zero.
This is usually the case for user-space programs. To handle Linux
Kernel binaries, the load address is now the one specified by the
program header that is at the smallest offset.
- The patch now tries to populate the various symbol maps only when
necessary. That way, the new symbol maps defined for the ksymtab
and ksymtab_gpl section are also loaded only when necessary; that
is, when in Linux Kernel mode.
- The patch (more) agressively suppresses non-member functions or
variables that are not declarations and that have no associated
ELF symbol.
The patch knows how to recognize and read relevant ELF symbol
information from __ksymtab and __ksymtab_gpl sections.
The patch makes abidiff and abidw detect that a binary is a
Linux Kernel binary (either a vmlinux or a module). It does this by
detecting the presence of the speciall __ksymtab_strings section.
If it detects that a binary is a Linux Kernel binary then it only
considers functions and variables which are defined and exported in
the sense of ELF *AND* which ELF symbols are listed in the __ksymtab
and __ksymtab_gpl sections.
If users want abidiff and abidw to consider their input binaries as
normal ELF binaries then they can use the option --no-linux-kernel-mode.
* include/abg-dwarf-reader.h (create_read_context): Take a new
flag to say if the context is to read an ELF binary in linux
kernel mode.
* src/abg-dwarf-reader.cc (typedef address_set_type)
(address_set_sptr): New typedefs.
(get_binary_load_address): The load address of the binary is
the load address specified by the program header that is at the
smallest offset; not by the program header that is at offset zero.
(read_context::{ksymtab_section_, ksymtab_gpl_section_,
linux_exported_fn_syms_, linux_exported_var_syms_,
linux_exported_gpl_fn_syms_, linux_exported_gpl_var_syms_,
load_in_linux_kernel_mode_}): New data members.
(read_context::read_context): Initialize ksymtab_section_,
ksymtab_gpl_section_ and load_in_linux_kernel_mode_.
(read_context::{find_symbol_table_section, find_opd_section,
lookup_elf_fn_symbol_from_address,
lookup_elf_var_symbol_from_address, get_function_address,
get_variable_address}): Make these const.
(read_context::{find_ksymtab_section, find_ksymtab_gpl_section,
lookup_elf_symbol_from_address, function_symbol_is_exported,
variable_symbol_is_exported, linux_exported_fn_syms,
create_or_get_linux_exported_fn_syms, linux_exported_var_syms,
create_or_get_linux_exported_var_syms, linux_exported_gpl_fn_syms,
linux_exported_gpl_var_syms,
create_or_get_linux_exported_gpl_fn_syms,
linux_exported_gpl_var_syms,
create_or_get_linux_exported_gpl_var_syms, architecture_word_size,
load_kernel_symbol_table, load_ksymtab_symbols,
load_ksymtab_gpl_symbols,
load_linux_specific_exported_symbol_maps,
load_in_linux_kernel_mode}): New member functions.
(read_context::read_int_from_array_of_bytes): Factorize this
new member function out of ...
(read_context::{lookup_ppc64_elf_fn_entry_point_address}):
... this. Make this function const too.
(read_context::read_uint64_from_array_of_bytes): New function.
Uses read_int_from_array_of_bytes above.
(read_context::{fun_entry_addr_sym_map_sptr}): Try to load symbol
maps only when it's necessary.
(read_context::elf_architecture_is_big_endian): Fix logic.
(read_context::{var_addr_sym_map}): Express the const variant in
terms of the non-const one. In the non-const one, load the map
only when necessary.
(read_context::load_symbol_maps_from_symtab_section): Renamed
load_symbol_maps into this.
(read_context::is_linux_kernel_binary): Define new member
function.
(read_context::{function, variable}_symbol_is_exported): If we are
not prevented from considering loading in linux kernel mode, then
just looking at a linux kernel binary makes us consider the
special kernel sections.
(read_debug_info_into_corpus): Likewise.
(build_ir_node_from_die): Take a new flag that says if the ir node
is a declaration required by another concrete IR node.
(enum read_context::kernel_symbol_table_kind): New enum.
(read_context::load_symbol_maps): Support loading linux kernel
specific sections too.
(build_var_decl): Use the new
read_context::variable_symbol_is_exported.
(function_is_suppressed): Suppress non-member functions or
variables that are not declarations and that have no symbol.
(variable_is_suppressed, build_var_decl_if_not_suppressed): Take a
new flag that says if the variable is a declaration required by a
concrete variable. If non member variable that is a declaration
is not the specification of another concrete variable, then it's
suppressed.
(add_fn_symbols_to_map, add_var_symbols_to_map): New function
definitions.
(read_debug_info_into_corpus): If we are reading linux kernel or
linux kernel modules, only set explicitely exported symbols (in
the linux kernel binary sense) as exported function or variable
symbols.
(create_read_context): Take a new flag to say if the context is to
read an ELF binary in linux kernel mode.
* tools/abidiff.cc (options::options): Initialize
options::linux_kernel_mode to true.
(display_usage): Display usage of the --no-linux-kernel-mode option.
(parse_command_line): Parse the --no-linux-kernel-mode option.
* tools/abidw.cc (options::options): Initialize
options::linux_kernel_mode to true.
(display_usage): Display usage of --no-linux-kernel-mode option.
(parse_command_line): Parse the --no-linux-kernel-mode option.
* doc/manuals/abidiff.rst: Document the new --no-linux-kernel-mode
options.
* doc/manuals/abidw.rst: Likewise.
* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
Adjust.
* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.
* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.
* tests/data/test-read-dwarf/test14-pr18893.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/libtest23.so.abi: Adjust.
* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust.
* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-writer.cc (dump_location): Define new function and one
overload.
(dump_decl_location): Re-write in terms of the new dump_location.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When reading an ELF/DWARF binary that doesn't support the One
Definition Rule[1] (aka ODR), type de-duplication is done on a
per-translation unit basis only. That means that a type definition
must be unique only in a given translation unit, in that case.
[1]: https://en.wikipedia.org/wiki/One_Definition_Rule
When handling big C binaries like the Linux Kernel, this implies a lot
of type duplication still, as the same type can be re-defined in a lot
of different translation units.
This patch tries to de-duplicate types on a per-corpus basis, even in
cases where the ODR doesn't apply. It does so by noting that if two
types of the same kind and name are seen in two different translation
units and yet have the same source location (are defined in the same
spot) then they are the same type.
The patch does this for class, union and enum types as these seem to
be the kinds of types which are duplicated the most and thus consume
the most memory and later take the most time to canonicalize. In a
subsequent patch, we might want to try to de-duplicate typedef types
too, and see if gain anything.
Comparing two linux kernels shows that with this patch, we come back
to a speed (and memory consumption) that is comparable to when we were
considering C-based binaries as being suited to our (too aggressive)
ODR-based type de-duplication algorithm.
Below are the output of the comparison measured with /usr/bin/time
with the aggressive ODR-based type de-duplication algorithm and with
this patch. We compare the vmlinux binary coming from the package
kernel-3.10.0-515 against the one from kernel-3.10.0-327.el7.x86_64.
We use the kabi whitelists provided by the relevant
kernel-abi-whitelists packages for these kernels to restrict the
comparison to a meaningful subset of interfaces.
52.66user 0.64system 0:53.34elapsed 99%CPU (0avgtext+0avgdata 944416maxresident)k 0inputs+48outputs (0major+250750minor)pagefaults 0swaps
vs:
51.04user 0.87system 0:51.91elapsed 100%CPU (0avgtext+0avgdata 972560maxresident)k
0inputs+232outputs (0major+279983minor)pagefaults 0swaps
The full invocation and results are available at:
http://people.redhat.com/~dseketel/kabidiff/vmlinuz-3.10.0-327.el7.x86_64--vmlinuz-3.10.0-515.el7.x86_64.diff.whitelisted.with-unions.txt
vs
http://people.redhat.com/~dseketel/kabidiff/vmlinuz-3.10.0-327.el7.x86_64--vmlinuz-3.10.0-515.el7.x86_64.diff.whitelisted.with-unions.with-non-odr-support.txt
Note that to be able to compare the two kernels, the current tree must
contain the necessary patches that make libabigail understand Linux
Kernel binaries.
* src/abg-dwarf-reader.cc (build_enum_type)
(add_or_update_class_type, add_or_update_union_type): When the ODR
is not relevant, use the location of the type to detect if two
enum, class or union types of the same name actually represent the
same type.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
With this option, abidiff is now able to filter out added
symbols just like abipkgdiff is.
* doc/manuals/abidiff.rst: Document the new --no-added-syms
option.
* tools/abidiff.cc (struct options): Add show_added_syms and
set it to true by default.
(display_usage): Document the new options --no-added-syms. If
this is the only suppression option specified, it is equivalent
to specifying --show_{changed,deleted}_{fns,vars} as arguments
to abidiff. If any of those options are specified before
--no-added-syms, then it has no effect.
(parse_command_line): Parse the new option and set
show_added_{fns,vars,syms} and show_all_{fns,vars} to false if
--no-added-syms is specified.
* tests/test-diff-filter.cc: Add a test for the new option.
* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt:
Reference results for the new test.
* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt:
Likewise.
* tests/data/Makefile.am: Add the above test files to the list of
test data.
Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-corpus.h: Remove corpus_sptr typedef. It's in
abg-fwd.h now.
* src/abg-ir.cc: Remove some unnecessary vertical space.
* src/abg-reader.cc (build_function_decl): Cleanup some asserts.
* src/abg-writer.cc (write_function_type): Each the inspection of
the type id from within the debugger.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>