public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix fail in gdb.base/interrupt-noterm.exp
Date: Mon, 25 Jan 2016 10:43:00 -0000	[thread overview]
Message-ID: <56A5FC48.70608@redhat.com> (raw)
In-Reply-To: <86powqqa57.fsf@gmail.com>

On 01/25/2016 09:30 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> If 1. is followed by 3., then the \\003 is always read by gdb
> 
> s/ready by/sent by/ ?

I meant, s/by gdb/by gdbserver/.

>>
>> It still seems to me like a gdbserver bug.
>>
>> I think that after calling enable_async_io, we need to check whether
>> input is already pending from GDB, and if so, process it immediately -- we
>> know the only input coming from GDB at this point is a \\003.  IOW, I think
>> we need to call input_interrupt after calling enable_async_io.  input_interrupt
>> already uses select before reading, so it handles the case of there
>> being no input available without blocking.
>>
>> However, we need to be careful, because a SIGIO can race with calling
>> input_interrupt from mainline code...
> 
> What you mean here is that we can call input_interrupt after calling
> enable_async_io, but meanwhile, \\0003 arrives, and input_interrupt is
> invoked as a SIGIO handler, so there is a race.  Is it correct?

That's correct.

> 
> I agree your next email about the approach of block/unblock SIGIO is
> better.  I'll give a fix that way.
> 

Great, thanks!

-- 
Pedro Alves

  reply	other threads:[~2016-01-25 10:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 16:29 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 [this message]
2016-01-26  9:59         ` [PATCH 0/2 V2] Fix a " Yao Qi
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=56A5FC48.70608@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    /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).