From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ABBD93858D33; Mon, 25 Mar 2024 18:19:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABBD93858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711390759; bh=z24sLhAM4PiK1leUV0ck2CyZ74Bv5TyuAeFYu8zf3hE=; h=From:To:Subject:Date:From; b=XsYUeHxZKwvsNA8jrFQdFHngFMTnvDzkcvORy4O08fh2lrt9OBDSQ6rMubqzWy+P9 qjQX7FYzC3SUSuiPe15zu8ZAzzctW+BjuAuCxWGr7+bSneIUP4blT3VfMhl1v8JCEG 4cCa8BeMI/3NKsI9aALllJl49d9BXMl6JrpVHOUU= From: "pedro at palves dot net" To: gdb-prs@sourceware.org Subject: [Bug server/31554] New: gdbserver --once --multi mishandles run & attach failures Date: Mon, 25 Mar 2024 18:19:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31554 Bug ID: 31554 Summary: gdbserver --once --multi mishandles run & attach failures Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: server Assignee: unassigned at sourceware dot org Reporter: pedro at palves dot net Target Milestone: --- "gdbserver --once --multi" mishandles run or attach failures. GDBserver exits/disconnects on run/attach failure, but it should not. From --help: --multi Start server without a specific program, and only quit when explicitly commanded. --once Exit after the first connection has closed. E.g., for "run": On GDB side: ... (gdb) tar extended-remote :9999 ... Remote debugging using :9999 (gdb) r Starting program: Running ".../gdb.base/run-fail-twice/run-fail-twice.nox" on the remote target failed (gdb) On GDBserver side: $ gdbserver --once --multi :9999 Remote debugging from host 127.0.0.1, port 34344 bash: line 1: .../gdb.base/run-fail-twice/run-fail-twice.nox: Permissi= on denied bash: line 1: exec: .../gdb.base/run-fail-twice/run-fail-twice.nox: ca= nnot execute: Permission denied gdbserver: During startup program exited with code 126. $ # gdbserver exited This gdbserver exit is wrong, as we've connected with extended-remote/--mul= ti. Here's an example for "attach": On GDB side: ... (gdb) tar extended-remote :9999 ... Remote debugging using :19999 (gdb) attach 1 Attaching to process 1 Attaching to process 1 failed (gdb)=20 On GDBserver side: $ gdbserver --once --multi :9999 Listening on port 9999 Remote debugging from host 127.0.0.1, port 37464 gdbserver: Cannot attach to process 1: Operation not permitted (1) $ # gdbserver exited This gdbserver exit is also wrong, as we've connected with extended-remote/--multi. --=20 You are receiving this mail because: You are on the CC list for the bug.=