Description of problem: While trying to get the new Chromium update done (as usual, fixes a ton of really public CVE security issues), I noticed that the new code was failing to build on Fedora 32 aarch64. It builds fine on Fedora 31 and Rawhide, but something in the Fedora 32 aarch64 gcc is unhappy. [fedora@ip-172-30-1-162 Headless]$ g++ -MMD -MF obj/skia/skia_core_and_effects/SkModeColorFilter.o.d -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DSKIA_IMPLEMENTATION=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -I../.. -Igen -I../../third_party/skia -I../../third_party/libgifcodec -I../../third_party/vulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../third_party/vulkan/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fno-omit-frame-pointer -g0 -fvisibility=hidden -O2 -fno-ident -fdata-sections -ffunction-sections -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comments -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -std=c++17 -std=gnu++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wno-class-memaccess -c ../../third_party/skia/src/core/SkModeColorFilter.cpp -o obj/skia/skia_core_and_effects/SkModeColorFilter.o In file included from ../../third_party/skia/src/core/SkGlyph.h:16, from ../../third_party/skia/src/core/SkScalerContext.h:20, from ../../third_party/skia/src/gpu/GrResourceProvider.h:13, from ../../third_party/skia/src/gpu/GrSurfaceProxyPriv.h:13, from ../../third_party/skia/src/gpu/GrProcessor.h:18, from ../../third_party/skia/src/gpu/GrXferProcessor.h:14, from ../../third_party/skia/src/core/SkBlendModePriv.h:29, from ../../third_party/skia/src/core/SkModeColorFilter.cpp:13: ../../third_party/skia/include/private/SkVx.h:559:76: internal compiler error: in instantiate_decl, at cp/pt.c:25419 559 | bit_pun<float32x4_t>(e))); | ^ I've attached the preprocessed source which was autogenerated. Version-Release number of selected component (if applicable): gcc-10.1.1-1.fc32.aarch64 How reproducible: Every time. I even had Fedora Infrastructure spin up an F32 aarch64 instance so I could reproduce this (and get the preprocessed source). Steps to Reproduce: 1. Build chromium-83.0.4103.97 on Fedora 32 aarch64 Actual results: internal compiler error: in instantiate_decl, at cp/pt.c:25419 Expected results: Chromium package for aarch64 Additional info: To be crystal clear, this doesn't fail on epel8 aarch64, Fedora 31 aarch64, or Fedora 33 aarch64. Just Fedora 32 aarch64. (It also succeeds on x86_64 everywhere). There are people actively exploiting security holes in Chromium 81, so I would really like to figure out how to get Chromium building again for Fedora 32 aarch64 so I can push out this update. Thanks in advance.
Created attachment 1697827 [details] Preprocessed source
Reproduced, reducing now. Note the f33 gcc is the same as f32.
Unfortunately, this really can't be reduced in any way, because it depends on luck or thereof in the C++ FE template specialization hashing. What I see in the debugger is that bit_pun function template is specialized twice, once with <Vec, vector(4) float> and once with <Vec, __Float32x4_t>. The former vector type is: elt:1 <vector_type 0x7fffea85cf18 type <real_type 0x7fffea7742a0 float type_6 SF size <integer_cst 0x7fffea76e198 constant 32> unit-size <integer_cst 0x7fffea76e1b0 constant 4> align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea7742a0 precision:32 pointer_to_this <pointer_type 0x7fffea774888> reference_to_this <reference_type 0x7fffe378d7e0>> type_6 V4SF size <integer_cst 0x7fffea754f90 128> unit-size <integer_cst 0x7fffea754fa8 16> align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea85cf18 nunits:4>> (and has TYPE_CANONICAL itself), while the other one is some vector type created by the aarch64 backend: elt:1 <vector_type 0x7fffea85f000 __Float32x4_t type <real_type 0x7fffea7742a0 float type_6 SF size <integer_cst 0x7fffea76e198 constant 32> unit-size <integer_cst 0x7fffea76e1b0 constant 4> align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea7742a0 precision:32 pointer_to_this <pointer_type 0x7fffea774888> reference_to_this <reference_type 0x7fffe378d7e0>> type_6 V4SF size <integer_cst 0x7fffea754f90 128> unit-size <integer_cst 0x7fffea754fa8 16> align:128 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality nunits:4>> (and has NULL TYPE_CANONICAL). In iterative_hash_template_arg for these VECTOR_TYPEs we end up: default: if (tree canonical = TYPE_CANONICAL (arg)) val = iterative_hash_object (TYPE_HASH (canonical), val); and thus hash it differently between vector(4) float and __Float32x4_t. But spec_hasher::equal calls comp_template_args for that and that in turn calls same_type_p on those and structural_comptypes is called because one of those lacks TYPE_CANONICAL, and there it does: case VECTOR_TYPE: if (gnu_vector_type_p (t1) != gnu_vector_type_p (t2) || maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2)) || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; and considers the two the same. Because it hashed differently, it is added twice into the hash table, and when we are unlucky, the two hash values modulo the size of the hash table are equal, so we have two different specializations (instantiations?) for the same thing and the check that retrieve_specialization returns the one we are considering fails. 2020-06-17 Jakub Jelinek <jakub> * pt.c (iterative_hash_template_arg): Handle VECTOR_TYPE. --- gcc/cp/pt.c.jj 2020-06-17 18:48:53.506617982 +0200 +++ gcc/cp/pt.c 2020-06-17 19:34:28.551298600 +0200 @@ -1924,10 +1924,21 @@ iterative_hash_template_arg (tree arg, h } break; - case DECLTYPE_TYPE: + case DECLTYPE_TYPE: val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg), val); break; + case VECTOR_TYPE: + { + bool gnu_vec = gnu_vector_type_p (arg); + val = iterative_hash_object (gnu_vec, val); + val = iterative_hash_template_arg (TREE_TYPE (arg), val); + inchash::hash hstate (val); + hstate.add_poly_int (TYPE_VECTOR_SUBPARTS (arg)); + val = hstate.end (); + } + break; + default: if (tree canonical = TYPE_CANONICAL (arg)) val = iterative_hash_object (TYPE_HASH (canonical), val); fixes this for me, but I wonder if we don't need to handle at least POINTER_TYPE and REFERENCE_TYPE too, because if a template argument is not a vector type, but e.g. a pointer to vector or reference to vector, due to the magic backend VECTOR_TYPEs with no TYPE_CANONICAL pointers to them will also have structural equality and thus would hash differently from pointers/references to the C++ FE created vector types. Thoughts on this?
The __Float32x4_t type is created in aarch64_init_simd_builtin_types using build_distinct_type_copy and explicitly requests structural equality: aarch64_simd_types[i].itype = build_distinct_type_copy (build_vector_type (eltype, GET_MODE_NUNITS (mode))); SET_TYPE_STRUCTURAL_EQUALITY (aarch64_simd_types[i].itype); For POINTER_TYPE/REFERENCE_TYPE, we could do: case REFERENCE_TYPE: { bool rval = TYPE_REF_IS_RVALUE (arg); val = iterative_hash_object (rval, val); } /* FALLTHRU */ case POINTER_TYPE: { machine_mode mode = TYPE_MODE (arg); val = iterative_hash_object (mode, val); val = iterative_hash_template_arg (TREE_TYPE (arg), val); } break; or so.
With a param mentioned by Patrick I have been able to construct a small testcase for trunk from scratch.
Does the aarch64 port expect this type to be considered equivalent to the GNU vector type or not? If so, why use build_distinct_type_copy over build_variant_type_copy? If not, they probably want to set TYPE_INDIVISIBLE_P so that structural_comptypes treats them as different.
I have no idea. Can you ask that question in PR95726, so that Richard Sandiford can answer it? I think they want TYPE_INDIVISIBLE_P just for the SVE variable length vectors which are different beasts.
This is not going to be resolved in the build I'm going to do right now. As a quick workaround, I'd suggest to copy skia/include/private/SkVx.h bit_pun to bit_pun2 (different name, identical content) and use bit_pun2 instead of bit_pun for instantiations with the ARM specific intrinsic types like uint32x4_t or float32x4_t (so sed -i -e 's/bit_pun<uint32x4_t>/bit_pun2<uint32x4_t>/g;s/bit_pun<float32x4_t>/bit_pun2<float32x4_t>/g' ).
Thanks Jakub. I've made that chromium patch and it looks like it resolves the issue for now.
This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.