From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1E223858D38; Fri, 8 Mar 2024 22:30:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1E223858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709937002; bh=7Pz26beUULOuS01txOt5P6m3DCLG98nRLSFjrVw2s+c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Qj1L5ZcAS/YinOKDoTkiICIOV+tCElRgIqEFpnINVrsr402U9IOg8z+9MHm/QZdWM aB1qb28OGoiRrncBF0XOrSPW2iGg8F4XtXoPnaYMuCpm8YAm0nmv2YRG987ZByrywq H1BZZWXMB1RLlvQnv2xBzOr3W1wy9oBLVOIKCIWY= From: "ydeng339 at gatech dot edu" To: gdb-prs@sourceware.org Subject: [Bug gdb/31465] gdb batch mode crashes when execute "gdb.post_event(lambda: gdb.execute("c"))" in a stop event handler Date: Fri, 08 Mar 2024 22:30:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 15.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ydeng339 at gatech dot edu 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: 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=3D31465 --- Comment #2 from Deng, Yunjie --- (In reply to Tom Tromey from comment #1) > That stack trace isn't really that useful. >=20 > Could you try with git gdb? > We fixed a bug like this recently. Very thanks for your timely response! I compile the gdb git project (head acab5b12b9765d856d8618c11e4f54115396fda7) and find the crash disappeared. However, it has a new bug --- the gdb will exit directly without continue executing. Recall that I aim to use 'gdb.post_event(lambda: gdb.execute("c"= ))' to continue the program after the stop event is finished, but it doesn't wo= rk.=20 Recall that my demand is to continue executing the program after a breakpoi= nt. So I further try to use 'gdb.execute("c")' without 'gdb.post_event()'. That= is, the code is like this: ```=20 def on_stop(event): # Do some operations gdb.execute("c") gdb.events.stop.connect(on_stop) ``` Although this method can continue executing the program for a while, the py= thon script will end with the error message "Python Exception : maximum recursion depth exceeded while calling a Python object". I use python traceback and find that the python stack is filled wi= th the 'on_stop()' function. It seems that a new 'on_stop()' function is execu= ted even the last 'on_stop()' is still in stack. Such behavior leads stack over= flow when gdb runs for a while. --=20 You are receiving this mail because: You are on the CC list for the bug.=