public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Bug 26591 - tentative fix for some duplicate type ids
@ 2021-05-07 18:42 Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 1/3] XML writer: treat function types more uniformly Giuliano Procida
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-05-07 18:42 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

This is RFC, because while this does fix some of the problems, there
may be unforseen consquences of the approach taken. Also, it has been
lightly tests (only on a subset of the test suite so far).

Comments welcome!

Giuliano Procida (3):
  XML writer: treat function types more uniformly
  XML writer: don't emit already emitted types
  XML writer: emit enclosing types of scoped declarations

 src/abg-writer.cc                             |   111 +-
 .../data/test-annotate/test13-pr18894.so.abi  |   298 +-
 .../data/test-annotate/test14-pr18893.so.abi  |  5516 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 22297 +++----
 .../data/test-annotate/test17-pr19027.so.abi  | 38596 +++++------
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |   726 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  9085 +--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10103 +--
 .../data/test-annotate/test21-pr19092.so.abi  |  6549 +-
 .../PR22015-libboost_iostreams.so.abi         |    10 -
 .../test-read-dwarf/PR22122-libftdc.so.abi    |     5 -
 .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi |   395 +-
 .../test-read-dwarf/PR26261/PR26261-exe.abi   |     4 -
 .../test-read-dwarf/test-libandroid.so.abi    |  2818 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |    25 -
 .../test-read-dwarf/test12-pr18844.so.abi     |  3881 +-
 .../test-read-dwarf/test13-pr18894.so.abi     |   184 +-
 .../test-read-dwarf/test14-pr18893.so.abi     |  3807 +-
 .../test-read-dwarf/test15-pr18892.so.abi     | 16117 ++---
 .../test-read-dwarf/test16-pr18904.so.abi     |  4862 +-
 .../test-read-dwarf/test17-pr19027.so.abi     | 12443 ++--
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |   428 -
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  6378 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  6329 +-
 .../test-read-dwarf/test21-pr19092.so.abi     |  3299 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 53768 ++++++----------
 .../test9-pr18818-clang.so.abi                |    50 -
 27 files changed, 74647 insertions(+), 133437 deletions(-)

-- 
2.31.1.607.g51e8a6a459-goog


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

* [RFC PATCH 1/3] XML writer: treat function types more uniformly
  2021-05-07 18:42 [RFC PATCH 0/3] Bug 26591 - tentative fix for some duplicate type ids Giuliano Procida
@ 2021-05-07 18:42 ` Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 2/3] XML writer: don't emit already emitted types Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 3/3] XML writer: emit enclosing types of scoped declarations Giuliano Procida
  2 siblings, 0 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-05-07 18:42 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

Bug 26591 - detect pathologically redundant types in abixml

The XML writer has some special treatment of function types (compared
with pointer types, for example). This commit removes the special
treatment.

While I believe this is a safe and reasonably sensible thing to do,
the real reason for this change is that it makes the following changes
to eliminate duplicate types work properly.

	* src/abg-writer.cc (fn_type_ptr_set_type): Remove typedef.
	(writer_context::m_referenced_fn_types_set): Remove member.
	(writer_context::get_referenced_types): Adjust documentation.
	(writer_context::get_referenced_non_canonical_types): Ditto.
	(writer_context::record_type_as_referenced): Adjust
	documentation and remove special handling of function types.
	(writer_context::type_is_referenced): Ditto.
	(writer_context::clear something): Remove special handling of
	function types.
	(writer_context::write_translation_unit): Adjust comments.
	Remove special handling of function types. Drop code that
	attempts to emit live TU function types that are referenced
	and unemitted.
	* tests/data/test-annotate/test13-pr18894.so.abi: Refresh.
	* tests/data/test-annotate/test14-pr18893.so.abi: Refresh.
	* tests/data/test-annotate/test15-pr18892.so.abi: Refresh.
	* tests/data/test-annotate/test17-pr19027.so.abi: Refresh.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-annotate/test21-pr19092.so.abi: Refresh.
	* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi:
	Refresh.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Refresh.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Refresh.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Refresh.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Refresh.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Refresh.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Refresh.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Refresh.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Refresh.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Refresh.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-writer.cc                             |    77 +-
 .../data/test-annotate/test13-pr18894.so.abi  |    90 +-
 .../data/test-annotate/test14-pr18893.so.abi  |  1176 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 14882 ++++++++--------
 .../data/test-annotate/test17-pr19027.so.abi  |  5277 +++---
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  4101 ++---
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |    44 +-
 .../data/test-annotate/test21-pr19092.so.abi  |  2774 +--
 .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi |   156 +-
 .../test-read-dwarf/test-libandroid.so.abi    |    54 +-
 .../test-read-dwarf/test12-pr18844.so.abi     |    22 +-
 .../test-read-dwarf/test13-pr18894.so.abi     |    50 +-
 .../test-read-dwarf/test14-pr18893.so.abi     |  1130 +-
 .../test-read-dwarf/test15-pr18892.so.abi     | 14709 +++++++--------
 .../test-read-dwarf/test16-pr18904.so.abi     |    14 +-
 .../test-read-dwarf/test17-pr19027.so.abi     |  4928 ++---
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  3949 ++--
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |    24 +-
 .../test-read-dwarf/test21-pr19092.so.abi     |  2100 +--
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi |  9292 +++++-----
 20 files changed, 32750 insertions(+), 32099 deletions(-)

Patch too large to post here. See:
https://github.com/myxoid/libabigail/commit/3c7b1189ecec88cfb0bedd30d514ec84040c775e

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

* [RFC PATCH 2/3] XML writer: don't emit already emitted types
  2021-05-07 18:42 [RFC PATCH 0/3] Bug 26591 - tentative fix for some duplicate type ids Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 1/3] XML writer: treat function types more uniformly Giuliano Procida
@ 2021-05-07 18:42 ` Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 3/3] XML writer: emit enclosing types of scoped declarations Giuliano Procida
  2 siblings, 0 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-05-07 18:42 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

The XML writer sometimes emits type definitions entirely duplicated.
This happens if for some reason a type is emitted early but is later
emitted as one of the canonical types associated with a translation
unit.

Bug 26591 - detect pathologically redundant types in abixml

	* src/abg-writer.cc:
	(writer_context::write_canonical_types_of_scope): Do not emit
	already emitted types.
	* tests/data/test-annotate/test13-pr18894.so.abi: Refresh.
	* tests/data/test-annotate/test14-pr18893.so.abi: Refresh.
	* tests/data/test-annotate/test15-pr18892.so.abi: Refresh.
	* tests/data/test-annotate/test17-pr19027.so.abi: Refresh.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Refresh.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-annotate/test21-pr19092.so.abi: Refresh.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Refresh.
	* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi:
	Refresh.
	* tests/data/test-read-dwarf/PR26261/PR26261-exe.abi: Refresh.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Refresh.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Refresh.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Refresh.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Refresh.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Refresh.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Refresh.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Refresh.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Refresh.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Refresh.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Refresh.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-writer.cc                             |     2 +-
 .../data/test-annotate/test13-pr18894.so.abi  |   208 -
 .../data/test-annotate/test14-pr18893.so.abi  |  4680 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 10977 ++--
 .../data/test-annotate/test17-pr19027.so.abi  | 13461 +---
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |   726 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  4726 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  7850 +--
 .../data/test-annotate/test21-pr19092.so.abi  |  2017 +-
 .../PR22015-libboost_iostreams.so.abi         |    10 -
 .../test-read-dwarf/PR22122-libftdc.so.abi    |     5 -
 .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi |   279 -
 .../test-read-dwarf/PR26261/PR26261-exe.abi   |     4 -
 .../test-read-dwarf/test-libandroid.so.abi    |  2124 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |    20 -
 .../test-read-dwarf/test12-pr18844.so.abi     |  2821 +-
 .../test-read-dwarf/test13-pr18894.so.abi     |   134 -
 .../test-read-dwarf/test14-pr18893.so.abi     |  3019 +-
 .../test-read-dwarf/test15-pr18892.so.abi     |  3101 +-
 .../test-read-dwarf/test16-pr18904.so.abi     |  1084 +-
 .../test-read-dwarf/test17-pr19027.so.abi     |  8154 +--
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |   428 -
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  2920 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  4427 +-
 .../test-read-dwarf/test21-pr19092.so.abi     |  1587 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 50566 ++++++----------
 .../test9-pr18818-clang.so.abi                |    38 -
 27 files changed, 33379 insertions(+), 91989 deletions(-)

Patch too large to post here. See:
https://github.com/myxoid/libabigail/commit/e3f22b080743b41253f72558206109a0f94a292d

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

* [RFC PATCH 3/3] XML writer: emit enclosing types of scoped declarations
  2021-05-07 18:42 [RFC PATCH 0/3] Bug 26591 - tentative fix for some duplicate type ids Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 1/3] XML writer: treat function types more uniformly Giuliano Procida
  2021-05-07 18:42 ` [RFC PATCH 2/3] XML writer: don't emit already emitted types Giuliano Procida
@ 2021-05-07 18:42 ` Giuliano Procida
  2 siblings, 0 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-05-07 18:42 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

Bug 26591 - detect pathologically redundant types in abixml

One source of duplicated type ids in ABI XML is the writer emitting
scoped (nested) typed declarations before a later TU causes the
emission of the complete enclosing type declaration.

This commit causes the outermost enclosing type declaration to be
emitted immediately. This also prevents the later duplicate emission
of the type and any of its nested member types.

	* src/abg-writer.cc: (write_decl_in_scope): Emit the enclosing
	types of any nested type declaration.
	* tests/data/test-annotate/test15-pr18892.so.abi: Refresh.
	* tests/data/test-annotate/test17-pr19027.so.abi: Refresh.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Refresh.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Refresh.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Refresh.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Refresh.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Refresh.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Refresh.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Refresh.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-writer.cc                             |    32 +-
 .../data/test-annotate/test15-pr18892.so.abi  |   250 +-
 .../data/test-annotate/test17-pr19027.so.abi  |  2494 ++-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  8004 ++++----
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  2235 +--
 .../test-read-dwarf/test-libandroid.so.abi    |   276 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |     5 -
 .../test-read-dwarf/test12-pr18844.so.abi     |  1586 +-
 .../test-read-dwarf/test15-pr18892.so.abi     |   189 +-
 .../test-read-dwarf/test16-pr18904.so.abi     |  3860 ++--
 .../test-read-dwarf/test17-pr19027.so.abi     |  1557 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |  1955 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  1844 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 15644 ++++++++--------
 .../test9-pr18818-clang.so.abi                |    12 -
 15 files changed, 19556 insertions(+), 20387 deletions(-)

Patch quite large, not posting here. See:
https://github.com/myxoid/libabigail/commit/8fa8c3ae853cf2c1fabbc3795f5d7212bfd80619

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

end of thread, other threads:[~2021-05-07 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 18:42 [RFC PATCH 0/3] Bug 26591 - tentative fix for some duplicate type ids Giuliano Procida
2021-05-07 18:42 ` [RFC PATCH 1/3] XML writer: treat function types more uniformly Giuliano Procida
2021-05-07 18:42 ` [RFC PATCH 2/3] XML writer: don't emit already emitted types Giuliano Procida
2021-05-07 18:42 ` [RFC PATCH 3/3] XML writer: emit enclosing types of scoped declarations Giuliano Procida

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).