From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E4881385841C; Fri, 4 Nov 2022 09:49:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4881385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667555370; bh=3P2cCi8Sa/xO5GoRdK1d+H7SluCNMID/IIToLCH1ZrA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E6MFS0TEnuUluNYS778FsOPGhiTK1UosIlxyjna8sRCj9lfhdjwG299piJwXbbxeM VoFGkBJHKl/4GPeDs4ssi88LJbZXXwSr/+4gN2MGiv7ecDJy5T9y1JpxOqtx6gynjC ah69ROWhTcO+yHAmDP7yXT8bmriTrdAHCDMEhphw= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug server/15746] "monitor exit", then "quit" leaves gdb still running Date: Fri, 04 Nov 2022 09:49:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: msaleem at codesourcery dot com 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=3D15746 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vries at gcc dot gnu.org --- Comment #3 from Tom de Vries --- (In reply to Tom Tromey from comment #2) > I ran into this recently as well. And me today.=20=20 Fairly easy to reproduce. Terminal 1 (run this command, first compile hello world into a.out): ... $ gdbserver --once 127.0.0.1:2345 ./a.out ... Terminal 2 (run this command and type 'y'): ... $ gdb -ex "target remote 127.0.0.1:2345" -ex "monitor exit" -ex quit Remote debugging using 127.0.0.1:2345 Reading /home/vries/a.out from remote target... ... 0x00007ffff7dd4550 in _start () from target:/lib64/ld-linux-x86-64.so.2 A debugging session is active. Inferior 1 [process 13005] will be killed. Quit anyway? (y or n) y Remote connection closed (gdb)=20 ... It's causing timeouts when running the testsuite in fancy host/target board combinations. With this to make it visible: ... diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index c9533758270..07b3ddccae2 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2046,6 +2046,9 @@ proc default_gdb_exit {} { exp_continue } -re "DOSEXIT code" { } + timeout { + warning "Timed out waiting for EOF" + } default { } } } ... and host board local-remote-host-notty and target board native-gdbserver (a= nd a branch full of testsuite fixes, and test-case gdb.base/print-file-var.exp),= I run into: ... Remote debugging from host ::1, port 57704^M get_version_1: &this_version_id=3D0x7ffff7dd1028, this_version_id=3D104^M get_version_2: &this_version_id=3D0x7ffff7dd1028, this_version_id=3D104^M monitor exit^M Killing process(es): 10766^M (gdb) quit^M A debugging session is active.^M ^M Inferior 1 [process 10766] will be killed.^M ^M Quit anyway? (y or n) y^M Remote connection closed^M (gdb) WARNING: Timed out waiting for EOF ... This happens as follows: - quit_command calls query_if_trace_running - a TARGET_CLOSE_ERROR is thrown - it's caught in remote_target::get_trace_status, but then rethrow because it's TARGET_CLOSE_ERROR - catch_command_errors catches the error, at which point quit command has been aborted. --=20 You are receiving this mail because: You are on the CC list for the bug.=