Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Chet Ramey <chet.ramey@case.edu>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: bug-readline@gnu.org, gdb-patches@sourceware.org,
	       Sterling Augustine <saugustine@google.com>,
	chet.ramey@case.edu
Subject: Re: [Bug-readline] [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.]
Date: Thu, 30 Jun 2011 14:38:00 -0000	[thread overview]
Message-ID: <4E0C8A5D.7000807@case.edu> (raw)
In-Reply-To: <20110629203457.GA28353@host1.jankratochvil.net>

On 6/29/11 4:34 PM, Jan Kratochvil wrote:
> On Wed, 29 Jun 2011 15:54:11 +0200, Chet Ramey wrote:
>> If you feel that you need to make this change for the current version of
>> gdb, go ahead.
> 
> OK.  It is not a complete fix but hopefully the one people hit the most.
> I have also seen unreproducible crash(es) on a completion CTRL-C myself.
> 
> 
>> The big problem is to allow operations that read through the file system
>> (like completion) to be interrupted without running unsafe functions from
>> a signal handler.
> 
> I do not see the problem, readline already does not use SA_RESTART and the
> application also gets SIGINT passed by _rl_handle_signal so it aborts the
> completion reading on its own, as GDB does by the QUIT macro.
> 
> 
>> It does the user no good to keep setting the "I got SIGINT" flag if he's
>> trying to complete files on a dead or otherwise unreachable file server.
> 
> The syscall should get EINTR without SA_RESTART.  But I admit I may not see
> the problem now.

I have seen cases where the user hits ^C while readline or a filename
completion function is attempting to traverse a file system on a dead
NFS server, the signal handler gets hit, but the system call doesn't
get interrupted.  I haven't seen those cases in a while, though.

Let's try this.  Instead of introducing a leak in free(), remove the
references to _rl_interrupt_immediately in complete.c.  Those are the
only two places where the interrupt handler is called synchronously.
I have a couple more changes to make if that doesn't provide the
necessary responsiveness.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/


  reply	other threads:[~2011-06-30 14:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-11  0:19 [PATCH] Make interrupting tab-completion safe Sterling Augustine
2011-06-12 12:12 ` Jan Kratochvil
2011-06-13 17:45   ` Sterling Augustine
2011-06-26 22:22     ` [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.] Jan Kratochvil
2011-06-27 16:03       ` Joel Brobecker
2011-06-29 21:49         ` Jan Kratochvil
2011-06-29 13:54       ` [Bug-readline] " Chet Ramey
2011-06-29 20:35         ` Jan Kratochvil
2011-06-30 14:38           ` Chet Ramey [this message]
2011-07-06 16:03             ` Jan Kratochvil
2011-07-06 16:07               ` Chet Ramey
2011-07-06 17:42                 ` Jan Kratochvil
2011-07-07 13:40                   ` Chet Ramey
2011-07-08 16:03                     ` Chet Ramey
2011-10-19 20:30                       ` Jan Kratochvil
2011-10-19 17:02                     ` Jan Kratochvil
2011-10-19 17:51                       ` Pedro Alves
2011-10-19 18:50                       ` Chet Ramey
2011-07-11 18:53     ` [PATCH] Make interrupting tab-completion safe Sterling Augustine
2011-07-11 18:54       ` Jan Kratochvil
     [not found]         ` <CAEG7qUxFvEoJ-E2YsoFPL-tKoK4kD3-pKn-h31uUeXQoDD2Gaw@mail.gmail.com>
2011-07-12 15:59           ` [dwarf2_mark_helper patch] " Jan Kratochvil
2011-07-12 17:48             ` Sterling Augustine
2011-07-12 18:56             ` Jan Kratochvil
2011-07-12 21:18             ` [commit] " Jan Kratochvil
2011-07-12 21:42               ` Tom Tromey
2011-07-12 22:51                 ` Jan Kratochvil

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=4E0C8A5D.7000807@case.edu \
    --to=chet.ramey@case.edu \
    --cc=bug-readline@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=saugustine@google.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