From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>, Chet Ramey <chet.ramey@case.edu>
Subject: Re: [patch] Fix testsuite annotate-quit race (PR 544)
Date: Fri, 21 Mar 2008 20:45:00 -0000 [thread overview]
Message-ID: <20080321204506.GA5033@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20080319081056.GA32510@host0.dyn.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On Wed, 19 Mar 2008 09:10:56 +0100, Jan Kratochvil wrote:
> On Wed, 19 Mar 2008 00:17:38 +0100, Daniel Jacobowitz wrote:
> > On Tue, Mar 18, 2008 at 11:54:36PM +0100, Jan Kratochvil wrote:
> > > Hi,
> > >
> > > PR 544 des gdb.cp/annota2.exp and gdb.cp/annota3.exp sometimes FAIL with:
> > > FAIL: gdb.cp/annota3.exp: annotate-quit (pattern 1)
> ...
> > Isn't this a bug in GDB, not a bug in the test?
>
> You are right it is probably better to fix it in readline.
The patch was approved by the readline maintainer:
On Fri, 21 Mar 2008 19:37:31 +0100, Chet Ramey wrote:
> I will add something like your block_sigint/release_sigint changes around
> the guts of rl_redisplay. That's the right thing to do anyway. It will
> probably not come out as a patch for readline-5.2; you can use your
> current patch (though the names will change to _rl_block_sigint and
> _rl_release_sigint -- fair warning).
It could be probably also coded only in GDB by modifying the function pointer
RL_REDISPLAY_FUNCTION instead to a custom wrapper calling RL_REDISPLAY but it
would need the SIGINT blocking/handling done in GDB.
OK to commit as a readline fork before readline-6 is here?
Regards,
Jan
[-- Attachment #2: readline-display-blockint-v2.patch --]
[-- Type: text/plain, Size: 2043 bytes --]
2008-03-21 Jan Kratochvil <jan.kratochvil@redhat.com>
PR gdb/544
* display.c (rl_redisplay): Wrap the function by the calls to
BLOCK_SIGINT and RELEASE_SIGINT.
* rltty.c (block_sigint, release_sigint): Make the functions global.
* rltty.h (block_sigint, release_sigint): New prototypes.
--- ./readline/display.c 5 May 2006 18:26:12 -0000 1.11
+++ ./readline/display.c 19 Mar 2008 05:10:16 -0000
@@ -463,6 +463,10 @@ rl_redisplay ()
if (!readline_echoing_p)
return;
+ /* Signals are blocked through this function as the global data structures
+ could get corrupted upon modifications from an invoked signal handler. */
+ block_sigint ();
+
if (!rl_display_prompt)
rl_display_prompt = "";
@@ -1139,6 +1143,8 @@ rl_redisplay ()
else
visible_wrap_offset = wrap_offset;
}
+
+ release_sigint ();
}
/* PWP: update_line() is based on finding the middle difference of each
--- ./readline/rltty.c 5 May 2006 18:26:12 -0000 1.9
+++ ./readline/rltty.c 19 Mar 2008 05:10:16 -0000
@@ -52,8 +52,8 @@ extern int errno;
rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
-static void block_sigint PARAMS((void));
-static void release_sigint PARAMS((void));
+void block_sigint PARAMS((void));
+void release_sigint PARAMS((void));
static void set_winsize PARAMS((int));
@@ -75,7 +75,7 @@ static int sigint_blocked;
/* Cause SIGINT to not be delivered until the corresponding call to
release_sigint(). */
-static void
+void
block_sigint ()
{
if (sigint_blocked)
@@ -100,7 +100,7 @@ block_sigint ()
}
/* Allow SIGINT to be delivered. */
-static void
+void
release_sigint ()
{
if (sigint_blocked == 0)
--- ./readline/rltty.h 5 May 2006 18:26:12 -0000 1.5
+++ ./readline/rltty.h 19 Mar 2008 05:10:16 -0000
@@ -79,4 +79,7 @@ typedef struct _rl_tty_chars {
unsigned char t_status;
} _RL_TTY_CHARS;
+extern void block_sigint PARAMS((void));
+extern void release_sigint PARAMS((void));
+
#endif /* _RLTTY_H_ */
next prev parent reply other threads:[~2008-03-21 20:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 22:55 Jan Kratochvil
2008-03-18 23:18 ` Daniel Jacobowitz
2008-03-19 8:11 ` Jan Kratochvil
2008-03-19 8:46 ` Nick Roberts
2008-03-19 9:31 ` Jan Kratochvil
2008-03-19 9:56 ` Nick Roberts
2008-03-19 10:13 ` Jan Kratochvil
2008-03-21 20:45 ` Jan Kratochvil [this message]
2008-03-21 21:04 ` Daniel Jacobowitz
2008-03-21 21:45 ` Daniel Jacobowitz
2008-03-23 11:01 ` Nick Roberts
2008-03-23 16:30 ` Daniel Jacobowitz
2008-03-23 16:44 ` Jan Kratochvil
2008-03-23 17:30 ` Daniel Jacobowitz
2008-03-24 0:07 ` Nick Roberts
2008-03-24 2:58 ` Daniel Jacobowitz
2008-03-24 7:42 ` Jan Kratochvil
2008-03-24 12:00 ` Daniel Jacobowitz
2008-03-24 13:03 ` Jan Kratochvil
2008-03-24 13:27 ` Daniel Jacobowitz
2008-03-25 1:02 ` Chet Ramey
2008-03-25 2:53 ` Daniel Jacobowitz
2008-03-25 15:56 ` Chet Ramey
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=20080321204506.GA5033@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=chet.ramey@case.edu \
--cc=drow@false.org \
--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