public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/2 V2] Fix a fail in gdb.base/interrupt-noterm.exp
Date: Tue, 26 Jan 2016 09:59:00 -0000	[thread overview]
Message-ID: <1453802339-20401-1-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <86powqqa57.fsf@gmail.com>

Hi,
In my test, I see the following fail intermittently,

 interrupt
 (gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt
 [Inferior 1 (process 13407) exited normally]

 Child exited with status 0
 FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT (timeout)

because interrupt character isn't processed by GDBserver in time due to
two different problems:

 1. GDBserver may receive vCont;c and '\003' together, and read them
    into the buffer.  GDBserver will wait for the inferior but there
    won't be SIGIO because GDBserver has already read '\003' into the
    buffer.

 2. GDBserver may receive vCont;c only.  GDBserver will resume the
    inferior and wait for it.  If '\003' arrives at the moment between
    GDBserver received vCont;c and install SIGIO handler, GDBserver
    can't receive SIGIO.

these two problems above cause GDB wait for the inferior and leave the
interrupt there, so the test is timeout.

Two patches in the series fix these two problems separately.  Patch 1
fixes the problem 1 by checking the buffer *after* reading in each
packet.  Patch 2 fixes the problem 2 by block/unblock SIGIO rather than
install/uninstall signal handler.

These two patches are tested on {x86_64,arm,aarch64}-linux.  No
regression.

*** BLURB HERE ***

Yao Qi (2):
  [GDBserver] Check input interrupt after reading in a packet
  [GDBserver] Block and unblock SIGIO

 gdb/gdbserver/remote-utils.c | 60 ++++++++++++++++++++++++++++----------------
 1 file changed, 39 insertions(+), 21 deletions(-)

-- 
1.9.1

  parent reply	other threads:[~2016-01-26  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 16:29 [PATCH] Fix " Yao Qi
2016-01-22 16:47 ` Pedro Alves
2016-01-22 17:14   ` Yao Qi
2016-01-22 17:35     ` Pedro Alves
2016-01-22 18:30       ` Pedro Alves
2016-01-25  9:30       ` Yao Qi
2016-01-25 10:43         ` Pedro Alves
2016-01-26  9:59         ` Yao Qi [this message]
2016-01-26  9:59           ` [PATCH 2/2] [GDBserver] Block and unblock SIGIO Yao Qi
2016-01-26 12:01             ` Pedro Alves
2016-01-26 13:55               ` Yao Qi
2016-01-26  9:59           ` [PATCH 1/2] [GDBserver] Check input interrupt after reading in a packet Yao Qi
2016-01-26 11:42             ` Pedro Alves
2016-01-26 13:53               ` Yao Qi

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=1453802339-20401-1-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.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).