Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Dmitry Antipov <dantipov@nvidia.com>
Cc: GDB Development <gdb@sourceware.org>
Subject: Re: "The target is not responding to interrupt requests" after re-attach
Date: Thu, 19 Oct 2017 13:21:00 -0000	[thread overview]
Message-ID: <9e42ef0d-65be-fc1f-fc9e-c47610b86acb@redhat.com> (raw)
In-Reply-To: <fd91217d-4d53-1a9d-c957-1dec38a6a737@nvidia.com>


On 10/19/2017 12:57 PM, Dmitry Antipov wrote:
> On 10/19/2017 02:39 PM, Pedro Alves wrote:
> 
>> No good reason.  Sounds like you found a bug.
> 
> Currently gdbserver installs SIGIO handler just once, in
> initialize_async_io ()
> called from captured_main (), and this handler is removed when remote_desc
> is closed in remote_close (). Next, when a new instance of remote_desc is
> fetched from accept () and has '\003' arrived, input_interrupt () is never
> called because it is not registered as SIGIO handler.
> 
> Probably the fix is to (re)install SIGIO handler each time when a new
> async-served descriptor gets hooked into an event loop, for example,
> in enable_async_notification ().

Thanks much for tracking that down.

We could instead not uninstall the handler in remote_close, but
block the signal instead, putting us back in the original
state?   Like:

 @@ -403,10 +403,7 @@ remote_close (void)
  {
    delete_file_handler (remote_desc);

 -#ifndef USE_WIN32API
 -  /* Remove SIGIO handler.  */
 -  signal (SIGIO, SIG_IGN);
 -#endif
 +  disable_async_io ();

I wrote a gdb testsuite/gdb.server/ test exposing this, and
sent a patch to the patches list, after running that through
the testsuite:
  https://sourceware.org/ml/gdb-patches/2017-10/msg00606.html

Thanks,
Pedro Alves


      reply	other threads:[~2017-10-19 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 14:04 Dmitry Antipov
2017-10-19 11:39 ` Pedro Alves
2017-10-19 11:57   ` Dmitry Antipov
2017-10-19 13:21     ` Pedro Alves [this message]

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=9e42ef0d-65be-fc1f-fc9e-c47610b86acb@redhat.com \
    --to=palves@redhat.com \
    --cc=dantipov@nvidia.com \
    --cc=gdb@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