This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/gdbserver] Unexpected EOF read from socket after inferior exits.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]