public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/gdbserver] Unexpected EOF read from socket after inferior exits.
Date: Tue, 06 Jul 2010 22:30:00 -0000	[thread overview]
Message-ID: <20100706223007.GA15723@caradoc.them.org> (raw)
In-Reply-To: <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

  reply	other threads:[~2010-07-06 22:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06 21:30 Joel Brobecker
2010-07-06 22:30 ` Daniel Jacobowitz [this message]
2010-07-07 16:10   ` Joel Brobecker
2010-07-20 21:14 ` Thomas Schwinge
2010-07-21 20:49   ` Thomas Schwinge
2010-08-11 12:16   ` Thomas Schwinge
2010-08-11 13:22     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100706223007.GA15723@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).