This is the mail archive of the
mailing list for the GDB project.
Re: [Bug-readline] [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Chet Ramey <chet dot ramey at case dot edu>
- Cc: bug-readline at gnu dot org, Sterling Augustine <saugustine at google dot com>, gdb-patches at sourceware dot org
- Date: Wed, 19 Oct 2011 20:50:17 +0200
- Subject: Re: [Bug-readline] [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.]
- References: <BANLkTik1Z5GoCjNP9enPJeLThVk=g9Aj5ZF6zeDULburd2wfirstname.lastname@example.org> <20110626222146.GA4410@host1.jankratochvil.net> <4E0B2E83.email@example.com> <20110629203457.GA28353@host1.jankratochvil.net> <4E0C8A5D.firstname.lastname@example.org> <20110706154621.GA17142@host1.jankratochvil.net> <110706155826.AA07325.SM@caleb.INS.CWRU.Edu> <20110706164400.GA31447@host1.jankratochvil.net> <4E15A220.email@example.com> <4E17138D.firstname.lastname@example.org>
On Fri, 08 Jul 2011 16:26:21 +0200, Chet Ramey wrote:
> The most straightforward solution would be to move the signal setup into
> rl_callback_read_char, so readline's signal handlers are in place only
> when readline has control. It's still important that the application
> call rl_callback_handler_remove to restore the original signal handlers.
Why to keep the signal handler installed after rl_callback_read_char returns
to its caller?
The application (GDB) can do some rl_stuff_char(3) if it sees SIGINT and call
rl_callback_read_char() then. This way all the SIGINT-hooked operations do
not have to be executed from the signal handler.
But you may have solved it some way as you wrote now, thanks.