From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 075613858425; Tue, 20 Dec 2022 23:03:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 075613858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671577383; bh=VM2nVzYpu9o89by8was4Dd0amQGQwFGYWNBREV+V/ZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DfjVAIx44mk4jlGNpVp4NrofKrrx6YWM6e3Kd3QcG7oNWse7CsqIyXC88Co7wGFGe jsnG4V6yjVOU8/oB9T++pqyvMrD35K5rRM/eYuqAThyVxY3u2tAFyT6PMltPgsWgTS Y08Du7Jcjqhm6LL7dOB1Ag18DsXFKAhR/GLmroNU= From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug backtrace/29395] blockframe.c:79: internal-error: get_frame_block: Assertion `bl != NULL' failed. Date: Tue, 20 Dec 2022 23:03:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: backtrace X-Bugzilla-Version: 11.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29395 Simon Marchi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simark at simark dot ca --- Comment #9 from Simon Marchi --- I dissected the debug info a bit while looking at what GDB is doing. The execution is stopped in this hierarchy, in /usr/bin/kicad: 0x0000057d: DW_TAG_compile_unit DW_AT_producer ("GNU C++14 12.2.0 -march=3Dx86-64 -mtune= =3Dgeneric -g -g -O2 -O2 -std=3Dc++14 -fno-plt -fexceptions -fstack-clash-protection -fcf-protection=3Dfull -fPIE -fvisibility=3Dhidden -fvisibility-inlines-hid= den") DW_AT_language (DW_LANG_C_plus_plus_14) DW_AT_name=20=20=20=20=20=20=20 ("/usr/src/debug/kicad/kicad/kicad/dialogs/dialog_template_selector_base.cp= p") DW_AT_comp_dir ("/usr/src/debug/kicad/build/kicad") DW_AT_ranges (0x0000187d ... snip ... DW_AT_low_pc (0x0000000000000000) DW_AT_stmt_list (0x00000178) 0x00031917: DW_TAG_subprogram DW_AT_specification (0x00009a0c "_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9_M_assignERKS4_") DW_AT_decl_file ("/usr/include/c++/12.2.0/bits/basic_string.tcc") DW_AT_decl_line (273) DW_AT_decl_column (0x05) DW_AT_object_pointer (0x0003193b) DW_AT_low_pc (0x00000000002946d0) DW_AT_high_pc (0x00000000002947c8) DW_AT_frame_base (DW_OP_call_frame_cfa) DW_AT_call_all_calls (true) DW_AT_sibling (0x00031ecf) 0x00031961: DW_TAG_lexical_block DW_AT_ranges (0x000017a0 [0x00000000002946f5, 0x0000000000294729) [0x0000000000294750, 0x00000000002947c2)) DW_AT_sibling (0x00031ec1) 0x00031c77: DW_TAG_inlined_subroutine DW_AT_abstract_origin (0x000327c8 "_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13_M_set_lengthEm") DW_AT_entry_pc (0x000000000029471d) DW_AT_GNU_entry_view (0x0000) DW_AT_ranges (0x00001846 [0x000000000029471d, 0x0000000000294729) [0x00000000002947ac, 0x00000000002947b8)) DW_AT_call_file=20=20=20=20 ("/usr/include/c++/12.2.0/bits/basic_string.tcc") DW_AT_call_line (293) DW_AT_call_column (0x11) DW_AT_sibling (0x00031d4e) 0x00031cee: DW_TAG_inlined_subroutine DW_AT_abstract_origin (0x0003290b "_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7_M_dataEv") DW_AT_entry_pc (0x0000000000294721) DW_AT_GNU_entry_view (0x0001) DW_AT_ranges (0x00001858 [0x0000000000294721, 0x0000000000294721) [0x00000000002947ac, 0x00000000002947b8)) DW_AT_call_file=20=20 ("/usr/include/c++/12.2.0/bits/basic_string.h") DW_AT_call_line (268) DW_AT_call_column (0x1d) DW_AT_sibling (0x00031d17) get_frame_block calls get_frame_address_in_block_if_available, which returns 0x2947ab (actually, the relocated version of it, but I'm using the unreloca= ted version here so it matches the debug info above). This is because get_frame_address_in_block_if_available returns "pc - 1". This address fal= ls outside the block the frame is in, if you look at the last DW_TAG_inlined_subroutine's ranges. Another unrelated block is returned by block_for_pc. The value returned by frame_inlined_callees (which counts the number of inlined frame using the frame_infos) doesn't match the expected number of "inlined subroutine block" we see by going up the block tree, we eventually reach the global block and try to get its superblock. So I think that the root of the problem is get_frame_address_in_block not returning the right thing. In addition to checking that `gdb_assert (bl !=3D NULL);`, I think that get_frame_block should check that the block obtained from `bl->superblock (= )` isn't the global block nor the static block. I think we always expect to r= each a block that comes from a DW_TAG_subprogram or more precise. --=20 You are receiving this mail because: You are on the CC list for the bug.=