From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1057385843B; Mon, 27 Sep 2021 21:04:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1057385843B From: "ibhagatgnu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/102507] New: ICE in btf_finalize when compiling with -gbtf Date: Mon, 27 Sep 2021 21:04:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ibhagatgnu at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 21:04:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102507 Bug ID: 102507 Summary: ICE in btf_finalize when compiling with -gbtf Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: ibhagatgnu at gmail dot com Target Milestone: --- Noticed this ICE (in gmp) when bootstrapping GCC with -gbtf as an experimen= t. Program received signal SIGSEGV, Segmentation fault. 0x0000000000ce775c in simple_hashmap_traits, unsigned int>::is_empty, unsigned int> >::hash_entry> (entry=3D...) at /gcc/gcc/hash-map-traits.h:75 75 return H::is_empty (entry.m_key); Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.0.9.el7.x86_64 libgcc-4.8.5-16.el7.x86_64 libstdc++-4.8.5-16.el7.x86_64 (gdb) bt #0 0x0000000000ce775c in simple_hashmap_traits, unsigned int>::is_empty, unsigned int> >::hash_entry> (entry=3D...) at /gcc/gcc/hash-map-traits.h:75 #1 0x0000000000ce7bab in hash_map, unsigned int> >::hash_entry::is_empty (e=3D...) at /gcc/gcc/hash-map.h:71 #2 0x0000000000ce8623 in hash_table, unsigned int> >::hash_entry, false, xcallocator>::is_empty (v=3D...) at /gcc/gcc/hash-table.h:541 #3 0x0000000000ce8d30 in hash_table, unsigned int> >::hash_entry, false, xcallocator>::~hash_table (this=3D0x7ffff088fe10,=20 __in_chrg=3D) at /gcc/gcc/hash-table.h:681 #4 0x0000000000ce8c20 in hash_map, unsigned int> >::~hash_map (this=3D0x7ffff088fe10, __in_chrg=3D) at /gcc/gcc/hash-map.h:39 #5 0x0000000000ce8c3a in finalize, unsigned int> > > (p=3D0x7ffff088fe10) at /gcc/gcc/ggc.h:162 #6 0x0000000000c31dd2 in finalizer::call (this=3D0x3fd29f8) at /gcc/gcc/ggc-page.c:333 #7 0x0000000000c304be in ggc_handle_finalizers () at /gcc/gcc/ggc-page.c:1928 #8 0x0000000000c30bd7 in ggc_collect (mode=3DGGC_COLLECT_HEURISTIC) at /gcc/gcc/ggc-page.c:2228 #9 0x0000000001244668 in execute_one_pass (pass=3D0x3f2e730) at /gcc/gcc/passes.c:2639 #10 0x00000000012446dd in execute_pass_list_1 (pass=3D0x3f2e730) at /gcc/gcc/passes.c:2656 #11 0x0000000001244764 in execute_pass_list (fn=3D0x7ffff077f600, pass=3D0x= 3f2e6d0) at /gcc/gcc/passes.c:2667 #12 0x00000000012426a6 in do_per_function_toporder (callback=3D0x1244727 , data=3D0x3f2e6d0) at /gcc/gcc/passes.c:1773 #13 0x0000000001245384 in execute_ipa_pass_list (pass=3D0x3f2e670) at /gcc/gcc/passes.c:3003 #14 0x0000000000d1299a in ipa_passes () at /gcc/gcc/cgraphunit.c:2154 #15 0x0000000000d12dcc in symbol_table::compile (this=3D0x7ffff08c6000) at /gcc/gcc/cgraphunit.c:2289 #16 0x0000000000d13326 in symbol_table::finalize_compilation_unit (this=3D0x7ffff08c6000) at /gcc/gcc/cgraphunit.c:2537 #17 0x00000000013a19fd in compile_file () at /gcc/gcc/toplev.c:483 #18 0x00000000013a4b11 in do_compile () at /gcc/gcc/toplev.c:2233 #19 0x00000000013a4df7 in toplev::main (this=3D0x7fffffffdcf0, argc=3D24, argv=3D0x7fffffffddf8) at /gcc/gcc/toplev.c:2372 #20 0x00000000029109f2 in main (argc=3D24, argv=3D0x7fffffffddf8) at /gcc/gcc/main.c:39 Looks like the garbage collector, when cleaning up the btf_var_ids hash_map= , is working on invalid memory and bails out.=