public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] GDBserver: Fix ignored Ctrl-C after reconnection
Date: Thu, 16 Nov 2017 16:44:00 -0000	[thread overview]
Message-ID: <e849ea896bcdc3da8caff02eb6dc91dc85dd8a7e@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT e849ea896bcdc3da8caff02eb6dc91dc85dd8a7e ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: e849ea896bcdc3da8caff02eb6dc91dc85dd8a7e

GDBserver: Fix ignored Ctrl-C after reconnection

This fixes the issue reported by Dmitry Antipov <dantipov@nvidia.com>
here:
  https://sourceware.org/ml/gdb/2017-10/msg00048.html

The problem is that GDBserver stops listening to Ctrl-C/interrupt
requests if you disconnect and reconnect back.

Dmitry wrote:

~~~
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.
~~~

The fix here is not remove the SIGIO handler in the first place, thus
going back to the original before-first-connection state.

(I haven't gone back to try it, but I think this was a regression
caused by commit 8b2073398477 ("[GDBserver] Block and unblock SIGIO"),
which was what made remote_close remove the signal handler.)

New test included.

gdb/gdbserver/ChangeLog:
2017-11-16  Pedro Alves  <palves@redhat.com>

	* remote-utils.c (remote_close): Block SIGIO signals instead of
	uninstalling the SIGIO handler.

gdb/testsuite/ChangeLog:
2017-11-16  Pedro Alves  <palves@redhat.com>

	* gdb.server/reconnect-ctrl-c.c: New file.
	* gdb.server/reconnect-ctrl-c.exp: New file.


             reply	other threads:[~2017-11-16 16:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 16:44 sergiodj+buildbot [this message]
2017-11-16 16:44 ` Failures on Fedora-x86_64-native-gdbserver-m32, branch master sergiodj+buildbot
2017-11-16 16:56 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2017-11-16 17:06 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2017-11-16 17:09 ` Failures on Fedora-i686, " sergiodj+buildbot
2017-11-16 17:21 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-16 17:32 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2017-11-16 17:48 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2017-11-16 19:04 ` Failures on Ubuntu-AArch64-native-gdbserver-m64, " sergiodj+buildbot
2017-11-16 19:36 ` Failures on Ubuntu-AArch64-m64, " sergiodj+buildbot
2017-11-16 21:38 ` Failures on Ubuntu-AArch32-m32, " sergiodj+buildbot
2017-11-16 22:02 ` Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-16 22:39 ` Failures on Ubuntu-AArch32-native-gdbserver-m32, " sergiodj+buildbot

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=e849ea896bcdc3da8caff02eb6dc91dc85dd8a7e@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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).