From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15007 invoked by alias); 20 Dec 2013 20:09:25 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 14980 invoked by uid 48); 20 Dec 2013 20:09:24 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug server/16359] New: gdbserver needs to handle gdb going away more robustly Date: Fri, 20 Dec 2013 20:09:00 -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: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: NEW 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q4/txt/msg00588.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16359 Bug ID: 16359 Summary: gdbserver needs to handle gdb going away more robustly Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: server Assignee: unassigned at sourceware dot org Reporter: dje at google dot com gdbserver --multi, target extended-remote, amd64-linux If you kill -9 gdb (as a proxy for gdb being terminated for unexpected reasons), gdbserver will arrive here: static void input_interrupt (int unused) { fd_set readset; struct timeval immediate = { 0, 0 }; /* Protect against spurious interrupts. This has been observed to be a problem under NetBSD 1.4 and 1.5. */ FD_ZERO (&readset); FD_SET (remote_desc, &readset); if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0) { int cc; char c = 0; cc = read_prim (&c, 1); if (cc != 1 || c != '\003' || current_inferior == NULL) { fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", cc, c, c); return; } (*the_target->request_interrupt) (); } } and print: input_interrupt, count = 0 c = 0 ('^@') Subsequent connection attempts from gdb do not succeed. gdbserver could handle this more robustly by detecting EOF and treating it like any other disconnect (detaching from inferior and going back to waiting for a connection). -- You are receiving this mail because: You are on the CC list for the bug.