This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/gdbserver] Unexpected EOF read from socket after inferior exits.
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 6 Jul 2010 18:30:10 -0400
- Subject: Re: [RFA/gdbserver] Unexpected EOF read from socket after inferior exits.
- References: <1278451801-10588-1-git-send-email-brobecker@adacore.com>
On Tue, Jul 06, 2010 at 02:30:01PM -0700, Joel Brobecker wrote:
> Going back to the terminal where GDBserver is running, we see the following
> output:
>
> Child exited with status 0
> readchar: Got EOF
> Remote side has terminated connection. GDBserver will reopen the connection.
> Listening on port 4444
>
> The problem is that we're missing a call to mourn_inferior. As a result,
> after we've handled the vCont packet, we fail to notice that there are
> no process left to debug (target_running() returns true), and thus try
> to continue reading from the remote socket. However, since GDB just
> disconnected after having received the "exit with status 0" reply to the
> vCont request, the read triggers the EOF exception.
I agree that the current state is buggy; when I traced the calls
around, Linux + async is the only combination that ever calls mourn.
Your patch looks right to me, by analogy with the async case.
--
Daniel Jacobowitz
CodeSourcery