From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF4E8385840B; Mon, 21 Feb 2022 05:56:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF4E8385840B From: "ppluzhnikov at google dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/28911] New: infcall.c:1287: internal-error: call_function_by_hand_dummy: Assertion `call_thread->thread_fsm () == sm' failed. Date: Mon, 21 Feb 2022 05:56:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google dot com X-Bugzilla-Status: NEW 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: Mon, 21 Feb 2022 05:56:07 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28911 Bug ID: 28911 Summary: infcall.c:1287: internal-error: call_function_by_hand_dummy: Assertion `call_thread->thread_fsm () =3D=3D sm' failed. Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: ppluzhnikov at google dot com Target Milestone: --- This looks very similar to bug 23191, but has simpler test case. Reproduced with GDB-10.0, 11.1, and current trunk dc5483c989f29fc9c7934965071ae1bb80cff902. // --- cut #include #include #include void f2(const std::string& s) {} void th() { while (1) { f2("a"); sleep(5); } } void f(const std::string& s) { f2(s); } int main(int argc,char* argv[]) { std::thread t(th); for (int i =3D 0; i < 10; i++) { f(std::to_string(i)); } t.join(); return 0; } // --- cut g++ -g pthread t2.cc && /build/gdb -q ./a.out Reading symbols from ./a.out... (gdb) b f2 if s.c_str() =3D=3D 0 Breakpoint 1 at 0x22f1: file t2.cc, line 6. (gdb) run Starting program: /tmp/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff7a4a640 (LWP 928550)] [Switching to Thread 0x7ffff7a4b740 (LWP 928547)] Error in testing breakpoint condition: The program stopped in another thread while making a function call from GDB. Evaluation of the expression containing the function (std::__cxx11::basic_string, std::allocator >::c_str() const) will be abandoned. When the function is done executing, GDB will silently stop. [Switching to Thread 0x7ffff7a4a640 (LWP 928550)] Thread 2 "a.out" hit Breakpoint 1, f2 (s=3D...) at t2.cc:6 6 void f2(const std::string& s) {} ../../gdb/infcall.c:1287: internal-error: call_function_by_hand_dummy: Assertion `call_thread->thread_fsm () =3D=3D sm' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x559b9b8a15bc gdb_internal_backtrace_1 ../../gdb/bt-utils.c:122 0x559b9b8a15bc _Z22gdb_internal_backtracev ../../gdb/bt-utils.c:168 0x559b9bbe7bf4 internal_vproblem ../../gdb/utils.c:394 0x559b9bbe7e2a _Z15internal_verrorPKciS0_P13__va_list_tag ../../gdb/utils.c:471 0x559b9bd01961 _Z14internal_errorPKciS0_z ../../gdbsupport/errors.cc:55 0x559b9b9f69a2 _Z27call_function_by_hand_dummyP5valueP4typeN3gdb10array_viewIS0_EEPFvPviES= 6_ ../../gdb/infcall.c:1287 0x559b9b99f0eb _ZN4expr23structop_base_operation16evaluate_funcallEP4typeP10expression6nos= ideRKSt6vectorISt10unique_ptrINS_9operationESt14default_deleteIS8_EESaISB_EE ../../gdb/eval.c:966 0x559b9b8b61c5 _ZN4expr20comparison_operationIL10exp_opcode14EXadL_Z13eval_op_equalP4typeP= 10expression6nosideS1_P5valueS8_EEE8evaluateES3_S5_S6_ ../../gdb/expop.h:1341 0x559b9b99ae2d _ZN10expression8evaluateEP4type6noside ../../gdb/eval.c:101 0x559b9b892085 breakpoint_cond_eval ../../gdb/breakpoint.c:4739 0x559b9b892085 bpstat_check_breakpoint_conditions ../../gdb/breakpoint.c:5303 0x559b9b892085 _Z18bpstat_stop_statusPK13address_spacemP11thread_infoRK17target_waitstatus= P6bpstat ../../gdb/breakpoint.c:5475 0x559b9ba143e2 handle_signal_stop ../../gdb/infrun.c:6203 0x559b9ba1621a handle_stop_requested ../../gdb/infrun.c:4473 0x559b9ba1621a handle_stop_requested ../../gdb/infrun.c:4468 0x559b9ba1621a handle_inferior_event ../../gdb/infrun.c:5707 0x559b9ba17d1a _Z20fetch_inferior_eventv ../../gdb/infrun.c:4094 0x559b9bd0228d gdb_wait_for_event ../../gdbsupport/event-loop.cc:700 0x559b9bd02559 gdb_wait_for_event ../../gdbsupport/event-loop.cc:596 0x559b9bd02559 _Z16gdb_do_one_eventv ../../gdbsupport/event-loop.cc:212 0x559b9ba598e4 start_event_loop ../../gdb/main.c:421 0x559b9ba598e4 captured_command_loop ../../gdb/main.c:481 0x559b9ba5b3e4 captured_main ../../gdb/main.c:1348 0x559b9ba5b3e4 _Z8gdb_mainP18captured_main_args ../../gdb/main.c:1363 0x559b9b8017bb main ../../gdb/gdb.c:32 --------------------- This is a bug, please report it. For instructions, see: . Aborted (core dumped) --=20 You are receiving this mail because: You are on the CC list for the bug.=