From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B9AE38356A7; Fri, 22 Jul 2022 13:02:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B9AE38356A7 From: "georgepee at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug backtrace/29395] New: blockframe.c:79: internal-error: get_frame_block: Assertion `bl != NULL' failed. Date: Fri, 22 Jul 2022 13:02:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: georgepee at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 13:02:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29395 Bug ID: 29395 Summary: blockframe.c:79: internal-error: get_frame_block: Assertion `bl !=3D NULL' failed. Product: gdb Version: 11.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: georgepee at gmail dot com Target Milestone: --- Starting with gdb 11.x, I encounter this assertion failure on certain backtraces ../../gdb/blockframe.c:79: internal-error: get_frame_block: Assertion `bl != =3D NULL' failed. Not really knowing much about the GDB and DWARF structures, I did this as an experiment and then GDB 11.x shows the same backtrace that GDB 10.x did.=20 ``` diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 50c464f44a2..0ee8313abea 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -70,13 +70,12 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) inline_count =3D frame_inlined_callees (frame); - while (inline_count > 0) + while (bl && (inline_count > 0)) { if (block_inlined_p (bl)) - inline_count--; + inline_count--; bl =3D BLOCK_SUPERBLOCK (bl); - gdb_assert (bl !=3D NULL); } return bl; ``` Comparing the values of frame_inlined_callees() from GDB 10.x and 11.x, I s= ee that they differ. I also tried GDB 12.1, and it outputs this: ``` ../../gdb/blockframe.c:79: internal-error: get_frame_block: Assertion `bl != =3D NULL' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x55a42dc123b7 gdb_internal_backtrace_1 ../../gdb/bt-utils.c:122 0x55a42dc123b7 _Z22gdb_internal_backtracev ../../gdb/bt-utils.c:168 0x55a42defaeec internal_vproblem ../../gdb/utils.c:394 0x55a42defb10a _Z15internal_verrorPKciS0_P13__va_list_tag ../../gdb/utils.c:471 0x55a42e034a71 _Z14internal_errorPKciS0_z ../../gdbsupport/errors.cc:55 0x55a42dbe9968 _Z15get_frame_blockP10frame_infoPm ../../gdb/blockframe.c:79 0x55a42dbe9968 _Z15get_frame_blockP10frame_infoPm ../../gdb/blockframe.c:55 0x55a42dc9e622 _ZN18dwarf_expr_context14get_frame_baseEPPKhPm ../../gdb/dwarf2/expr.c:782 0x55a42dca0346 _ZN18dwarf_expr_context16execute_stack_opEPKhS1_ ../../gdb/dwarf2/expr.c:1821 0x55a42dca1c53 _ZN18dwarf_expr_context4evalEPKhm ../../gdb/dwarf2/expr.c:1250 0x55a42dca1dee _ZN18dwarf_expr_context26push_dwarf_reg_entry_valueE24call_site_parameter_k= ind21call_site_parameter_ui ../../gdb/dwarf2/expr.c:914 0x55a42dca12bb _ZN18dwarf_expr_context16execute_stack_opEPKhS1_ ../../gdb/dwarf2/expr.c:2259 0x55a42dca1c53 _ZN18dwarf_expr_context4evalEPKhm ../../gdb/dwarf2/expr.c:1250 0x55a42dca1ea2 _ZN18dwarf_expr_context8evaluateEPKhmbP18dwarf2_per_cu_dataP10frame_infoPK1= 8property_addr_infoP4typeSA_l ../../gdb/dwarf2/expr.c:1089 0x55a42dcb43a0 dwarf2_evaluate_loc_desc_full ../../gdb/dwarf2/loc.c:1485 0x55a42dcb4e37 _Z24dwarf2_evaluate_loc_descP4typeP10frame_infoPKhmP18dwarf2_per_cu_dataP18= dwarf2_per_objfileb ../../gdb/dwarf2/loc.c:1529 0x55a42dcb4e37 loclist_read_variable ../../gdb/dwarf2/loc.c:3859 0x55a42dd14279 _ZNK13language_defn14read_var_valueEP6symbolPK5blockP10frame_info ../../gdb/findvar.c:617 0x55a42de8bbd0 _Z14read_frame_argRK19frame_print_optionsP6symbolP10frame_infoP9frame_argS7_ ../../gdb/stack.c:540 0x55a42de8c5c4 print_frame_args ../../gdb/stack.c:888 0x55a42de8ddb3 print_frame ../../gdb/stack.c:1391 0x55a42de8ddb3 _Z16print_frame_infoRK19frame_print_optionsP10frame_infoi10print_whatii ../../gdb/stack.c:1117 0x55a42de8f55a backtrace_command_1 ../../gdb/stack.c:2069 0x55a42de8f55a backtrace_command ../../gdb/stack.c:2188 0x55a42dc3e8a7 _Z8cmd_funcP16cmd_list_elementPKci ../../gdb/cli/cli-decode.c:2514 0x55a42dee0766 _Z15execute_commandPKci ../../gdb/top.c:702 0x55a42dcfce9b _Z15command_handlerPKc ../../gdb/event-top.c:597 0x55a42dcfd1cc _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE ../../gdb/event-top.c:800 0x55a42dcfd82c gdb_rl_callback_handler ../../gdb/event-top.c:229 0x7f9293ac8d4d ??? 0x55a42dcfc2dd gdb_rl_callback_read_char_wrapper_noexcept ../../gdb/event-top.c:187 0x55a42dcfd720 gdb_rl_callback_read_char_wrapper ../../gdb/event-top.c:204 0x55a42dcfc06f _Z19stdin_event_handleriPv ../../gdb/event-top.c:524 0x55a42e035554 gdb_wait_for_event ../../gdbsupport/event-loop.cc:700 0x55a42e03563a gdb_wait_for_event ../../gdbsupport/event-loop.cc:596 0x55a42e03563a _Z16gdb_do_one_eventv ../../gdbsupport/event-loop.cc:237 0x55a42ddb0b54 start_event_loop ../../gdb/main.c:421 0x55a42ddb0b54 captured_command_loop ../../gdb/main.c:481 0x55a42ddb2564 captured_main ../../gdb/main.c:1351 0x55a42ddb2564 _Z8gdb_mainP18captured_main_args ../../gdb/main.c:1366 0x55a42db5970a main ../../gdb/gdb.c:32 ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=