public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] Bug 30466 - harfbuzz fails self-check on f38
@ 2023-06-02 16:23 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-06-02 16:23 UTC (permalink / raw)
  To: libabigail; +Cc: Nick Alcock

[-- Attachment #1: Type: text/plain, Size: 17351 bytes --]

Hello,

[I am CC-ing Nick Alcock since this patch moderately touches the CTF front-end]

Since this commit:

    commit 43cbdd1501bab7d65ef08c79f0b07ebbdb2e4118
    Author: Dodji Seketeli <dodji@redhat.com>
    Date:   Thu Apr 13 16:48:52 2023 +0200

	ir: Recognize "void* as being equal to all other pointers in C

a pointer to void is considered equal to all other pointers to avoid
emitting some spurious changes while self-comparing glibc from fc37.

As a void pointer can now equal several kinds of types, it could no
longer be canonicalized.  But then, the 'exemplar pointer' based
optimization in the ABIXML writer (cf get_exemplar_type) makes it so
that two different void pointer IR nodes (that are structurally
equivalent) would result in two different nodes (with different
type-ids) being serialized out in ABIXML.  Later at ABIXML reading
time, aggregates types using these two different void pointer nodes
might yield canonical types that are different from the original ones,
depending on the order in which ABIXML types are canonicalized as that
order might differ from the order in which they were initially
canonicalized.  This difference leads to spurious self-comparison
errors.

To handle this, I am proposing that the void pointer type be a unique
IR type node in the system.  That way, the exemplar type optimization
would still work and we get rid of the spurious self-comparison error
change.  While doing this, I realized that the void type and the
variadic parameter type that are also unique types were not properly
enforced in all the front-ends as such.  So this patch fixes that.

The patch also make typedefs and pointer to decl-only classes be
non-canonicalized types because decl-only classes are non-canonicalized
already.  Pointers and typedefs to those types being canonicalized can
lead to different canonicalized type depending on the order of
canonicalization.

The rest of the patch is basically adjusting the other moving parts to
these core changes.

	* include/abg-fwd.h (is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type)
	(is_void_pointer_type_equivalent, is_unique_type): Declare new
	functions.
	(is_typedef, is_void_pointer_type): Declare new overloads.
	(is_declaration_only_class_or_union_type): Add a new
	look_through_decl_only flag as parameter.
	* include/abg-ir.h (environment::{get_void_pointer_type,
	is_void_pointer_type}): Define new member functions.
	* src/abg-ir-priv.h (environment::priv::{void_pointer_type}): Add
	new data member.
	* src/abg-ir.cc (decl_topo_comp::operator()): For unique types,
	use lexicographic sorting.
	(environment::{get_void_pointer_type, is_void_pointer_type}):
	Define new member function.
	(is_typedef, is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type, is_unique_type):
	Define new functions.
	(is_declaration_only_class_or_union_type): Add a new
	look_through_decl_only parameter.  Some decl-only class or union
	do have an associated definition; this function return false for
	these types if look_through_decl_only is set to true.
	(is_void_pointer_type_equivalent): Rename is_void_pointer_type
	into this.
	(is_void_pointer_type): Now that is_void_pointer_type equals is
	old version of this is_void_poitner, make the new version test if
	the type equals the unique void pointer type, or if it a pointer
	to void type.  It doesn't take typedefs into account, like what
	is_void_pointer_type_equivalent does.
	(equals): In the overload for pointer_type_def, use the new
	is_void_pointer_type_equivalent instead of
	is_void_pointer_type_equivalent.
	(is_non_canonicalized_type): Re-organize this.  Now, all unique
	types are non-canonicalized.  This was sort-of the case already
	but was not clearly stated as such.  The decl-only class-or-union
	types were already non-canonicalized, but pointers and typedefs to
	class-or-unions should also be non-canonicalized for the system to
	work because a decl-only class-or-unions equals all defined types
	in C++.
	* src/abg-btf-reader.cc
	(reader::build_ir_node_for_void_pointer_type): Define new member
	function that return a unique type for void pointer types.
	(reader::build_pointer_type): Use
	build_ir_node_for_void_pointer_type to build void pointer types.
	(reader::{build_ir_node_for_void_type,
	build_ir_node_for_variadic_parameter_type}): Simplify.
	* src/abg-ctf-reader.cc (build_ir_node_for_void_type)
	(build_ir_node_for_void_pointer_type): Define new functions.
	(process_ctf_function_type): Use build_ir_node_for_void_type for
	void types.
	(process_ctf_pointer_type): Use
	build_ir_node_for_void_pointer_type for void pointer types.
	* src/abg-dwarf-reader.cc (build_ir_node_for_void_pointer_type):
	Define a new function that returns a unique type for void pointer
	types.
	(build_pointer_type_def): Use the new
	build_ir_node_for_void_pointer_type to build void pointers.
	(build_ir_node_for_variadic_parameter_type): Simplify.
	* src/abg-reader.cc (read_type_id_string): Define this even
	not debugging self-comparison.
	(build_ir_node_for_void_type)
	(build_ir_node_for_void_pointer_type): Define new functions.
	(reader::{get_scope_for_node, get_scope_ptr_for_node}): New member
	functions.
	(reader::push_decl_to_current_scope): Remove this member function.
	This was using the scope of the last IR node built as the current
	scope.  The problem is that the scope of a unique IR node is the
	scope where it was used the first time; that has nothing to do
	with the current scope.  So this function is obsolete now that we
	are using unique IR nodes for real.
	(reader::push_decl_to_scope): New member function.  This is the
	one to use, now that push_decl_to_current_scope is no more.
	(reader::push_and_key_type_decl): Pass the scope_decl to use.
	Make this push the decl to the scope passed in parameter.  Add an
	overload that has the XML node to use to determine the scope to
	push the decl to.
	(reader::get_scope_for_node): Support template parameter type
	composition nodes.  Also, add an overload that takes just an XML
	node.
	(reader::get_scope_ptr_for_node): Define new member function.
	(build_namespace_decl, build_function_decl, build_var_decl): Use
	to reader::push_decl_to_scope, now that
	reader::push_decl_to_current_scope is gone.
	(build_type_decl): Use build_ir_node_for_void_type to build a void
	type.  Adjust the call to reader::push_and_key_type_decl.
	(build_qualified_type_decl, build_reference_type_def)
	(build_subrange_type, build_array_type_def, build_enum_type_decl)
	(build_typedef_decl, build_class_decl, build_union_decl)
	(build_function_tdecl, build_function_tdecl, build_class_tdecl)
	(build_type_tparameter, build_type_composition)
	(build_non_type_tparameter, build_template_tparameter): Adjust the
	call to reader::push_and_key_type_decl.
	(build_pointer_type_def): Likewise.  Use
	build_ir_node_for_void_pointer_type to build a void pointer IR
	node.  Also, build the pointed-to-type before the pointer type
	itself; this is required to catch a void pointer type early and
	use build_ir_node_for_void_pointer_type to build it.
	* src/abg-comp-filter.cc (has_void_ptr_to_ptr_change): Use the new
	is_void_pointer_type_equivalent in lieu of is_void_pointer_type.
	This is because the former takes typedefs into account and so is
	more accurate.
	* src/abg-comparison.cc
	(scope_diff::ensure_lookup_tables_populated): Do not consider
	unique types when accounting for added/removed types.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise.
	* tests/data/test-annotate/test0.abi: Likewise.
	* tests/data/test-annotate/test1.abi: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test2.so.abi: Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-annotate/test3.so.abi: Likewise.
	* tests/data/test-annotate/test5.o.abi: Likewise.
	* tests/data/test-read-btf/test1.o.abi: Likewise.
	* tests/data/test-read-ctf/test2.so.abi: Likewise.
	* tests/data/test-read-ctf/test2.so.hash.abi: Likewise.
	* tests/data/test-read-ctf/test8.o.abi: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR24378-fn-is-not-scope.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise.
	* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-PR26568-1.o.abi: Likewise.
	* tests/data/test-read-dwarf/test-PR26568-2.o.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-suppressed-alias.o.abi:
	Likewise.
	* tests/data/test-read-dwarf/test0.abi: Likewise.
	* tests/data/test-read-dwarf/test0.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test1.abi: Likewise.
	* tests/data/test-read-dwarf/test1.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* 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/test2.so.abi: Likewise.
	* tests/data/test-read-dwarf/test2.so.hash.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/test3-alias-1.so.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test3-alias-2.so.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test3-alias-3.so.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test3-alias-4.so.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test3.so.abi: Likewise.
	* tests/data/test-read-dwarf/test3.so.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test5.o.abi: Likewise.
	* tests/data/test-read-dwarf/test5.o.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-write/test17.xml: Likewise.
	* tests/data/test-read-write/test18.xml: Likewise.
	* tests/data/test-read-write/test19.xml: Likewise.
	* tests/data/test-read-write/test20.xml: Likewise.
	* tests/data/test-read-write/test21.xml: Likewise.
	* tests/data/test-read-write/test22.xml: Likewise.
	* tests/data/test-read-write/test23.xml: Likewise.
	* tests/data/test-read-write/test26.xml: Likewise.
	* tests/data/test-read-write/test27.xml: Likewise.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Likewise.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 include/abg-fwd.h                             |    32 +-
 include/abg-ir.h                              |     9 +
 src/abg-btf-reader.cc                         |    30 +-
 src/abg-comp-filter.cc                        |    12 +-
 src/abg-comparison.cc                         |    16 +-
 src/abg-ctf-reader.cc                         |    78 +-
 src/abg-dwarf-reader.cc                       |    40 +-
 src/abg-ir-priv.h                             |     1 +
 src/abg-ir.cc                                 |   312 +-
 src/abg-reader.cc                             |   274 +-
 tests/data/test-annotate/libtest23.so.abi     |   635 +-
 .../test-annotate/libtest24-drop-fns-2.so.abi |   626 +-
 .../test-annotate/libtest24-drop-fns.so.abi   |   626 +-
 .../test-anonymous-members-0.o.abi            |     4 +-
 tests/data/test-annotate/test0.abi            |    12 +-
 tests/data/test-annotate/test1.abi            |     2 +-
 .../data/test-annotate/test13-pr18894.so.abi  |  2096 +-
 .../data/test-annotate/test14-pr18893.so.abi  |  6772 ++-
 .../data/test-annotate/test15-pr18892.so.abi  | 26734 +++++-----
 .../data/test-annotate/test17-pr19027.so.abi  | 15511 +++---
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  8135 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 15448 +++---
 tests/data/test-annotate/test2.so.abi         |     4 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 11483 ++--
 .../data/test-annotate/test21-pr19092.so.abi  |  6272 ++-
 tests/data/test-annotate/test3.so.abi         |     4 +-
 tests/data/test-annotate/test5.o.abi          |    12 +-
 tests/data/test-read-btf/test1.o.abi          |    24 +-
 tests/data/test-read-ctf/test2.so.abi         |     2 +-
 tests/data/test-read-ctf/test2.so.hash.abi    |     2 +-
 tests/data/test-read-ctf/test8.o.abi          |     2 +-
 .../PR22015-libboost_iostreams.so.abi         |   669 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    | 12995 ++---
 .../PR24378-fn-is-not-scope.abi               |     2 +-
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |  4547 +-
 .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi |   249 +-
 .../test-read-dwarf/PR27700/test-PR27700.abi  |     2 +-
 tests/data/test-read-dwarf/libtest23.so.abi   |   590 +-
 .../libtest24-drop-fns-2.so.abi               |   579 +-
 .../test-read-dwarf/libtest24-drop-fns.so.abi |   579 +-
 .../data/test-read-dwarf/test-PR26568-1.o.abi |     2 +-
 .../data/test-read-dwarf/test-PR26568-2.o.abi |     2 +-
 .../test-read-dwarf/test-libaaudio.so.abi     |    73 +-
 .../test-read-dwarf/test-libandroid.so.abi    |  2345 +-
 .../test-suppressed-alias.o.abi               |     2 +-
 tests/data/test-read-dwarf/test0.abi          |     8 +-
 tests/data/test-read-dwarf/test0.hash.abi     |     4 +-
 tests/data/test-read-dwarf/test1.abi          |     2 +-
 tests/data/test-read-dwarf/test1.hash.abi     |     2 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |  3782 +-
 .../test-read-dwarf/test11-pr18828.so.abi     | 11169 ++--
 .../test-read-dwarf/test12-pr18844.so.abi     | 21800 ++++----
 .../test-read-dwarf/test13-pr18894.so.abi     |  2030 +-
 .../test-read-dwarf/test14-pr18893.so.abi     |  6713 ++-
 .../test-read-dwarf/test15-pr18892.so.abi     | 26618 +++++-----
 .../test-read-dwarf/test16-pr18904.so.abi     | 15819 +++---
 .../test-read-dwarf/test17-pr19027.so.abi     | 15251 +++---
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi |  7899 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 15259 +++---
 tests/data/test-read-dwarf/test2.so.abi       |     2 +-
 tests/data/test-read-dwarf/test2.so.hash.abi  |     2 +-
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 10968 ++--
 .../test-read-dwarf/test21-pr19092.so.abi     |  6171 ++-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 43312 ++++++++--------
 .../test-read-dwarf/test3-alias-1.so.hash.abi |     2 +-
 .../test-read-dwarf/test3-alias-2.so.hash.abi |     2 +-
 .../test-read-dwarf/test3-alias-3.so.hash.abi |     2 +-
 .../test-read-dwarf/test3-alias-4.so.hash.abi |     2 +-
 tests/data/test-read-dwarf/test3.so.abi       |     2 +-
 tests/data/test-read-dwarf/test3.so.hash.abi  |     2 +-
 tests/data/test-read-dwarf/test5.o.abi        |     8 +-
 tests/data/test-read-dwarf/test5.o.hash.abi   |     4 +-
 .../test9-pr18818-clang.so.abi                |  2824 +-
 tests/data/test-read-write/test17.xml         |    30 +-
 tests/data/test-read-write/test18.xml         |    14 +-
 tests/data/test-read-write/test19.xml         |    18 +-
 tests/data/test-read-write/test20.xml         |    28 +-
 tests/data/test-read-write/test21.xml         |    30 +-
 tests/data/test-read-write/test22.xml         |     2 +-
 tests/data/test-read-write/test23.xml         |     2 +-
 tests/data/test-read-write/test26.xml         |    22 +-
 tests/data/test-read-write/test27.xml         |    18 +-
 .../test28-without-std-fns-ref.xml            |   808 +-
 .../test28-without-std-vars-ref.xml           |   752 +-
 84 files changed, 154954 insertions(+), 154275 deletions(-)


The patch being too big for the mailing list, I am attaching it below
xzipped.


[-- Attachment #2: 0001-Bug-30466-harfbuzz-fails-self-check-on-f38.patch.xz --]
[-- Type: application/x-xz, Size: 1930816 bytes --]

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


-- 
		Dodji

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-02 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 16:23 [PATCH, applied] Bug 30466 - harfbuzz fails self-check on f38 Dodji Seketeli

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