From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25108 invoked by alias); 19 Mar 2008 08:11:34 -0000 Received: (qmail 25096 invoked by uid 22791); 19 Mar 2008 08:11:33 -0000 X-Spam-Check-By: sourceware.org Received: from router.kulicky.cz (HELO router.kulicky.cz) (213.180.48.211) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Mar 2008 08:11:05 +0000 Received: from host0.dyn.jankratochvil.net ([192.168.76.151]) by router.kulicky.cz (8.13.8/8.13.8) with ESMTP id m2J8B0ZQ005754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 Mar 2008 09:11:01 +0100 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.2/8.14.1) with ESMTP id m2J8Awkm000810; Wed, 19 Mar 2008 09:10:58 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.2/8.14.2/Submit) id m2J8AuGK000809; Wed, 19 Mar 2008 09:10:56 +0100 Date: Wed, 19 Mar 2008 08:11:00 -0000 From: Jan Kratochvil To: bug-readline@gnu.org Cc: gdb-patches@sourceware.org, Daniel Jacobowitz Subject: Re: [patch] Fix testsuite annotate-quit race (PR 544) Message-ID: <20080319081056.GA32510@host0.dyn.jankratochvil.net> References: <20080318225436.GA27374@host0.dyn.jankratochvil.net> <20080318231738.GA22432@caradoc.them.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline In-Reply-To: <20080318231738.GA22432@caradoc.them.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Status: Clean X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00270.txt.bz2 --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1254 Hi, original post: http://sourceware.org/ml/gdb-patches/2008-03/msg00262.html 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. There are two excessive GDB prompts displayed as seen in strace: write(1, "\n\32\32pre-prompt\n(gdb) \n\32\32prompt\n", 30) = 30 --- SIGINT (Interrupt) @ 0 (0) --- write(1, "\n\32\32pre-prompt\n(gdb) \n\32\32prompt\n\n\32\32pre-prompt\n(gdb) \n\32\32prompt\n", 60) = 60 One can put `sleep (1)' at the end of _RL_OUTPUT_SOME_CHARS and type p 1 to abort the prompt printing. Before the patch: (gdb) p 1 $1 = 1 Quit) (gdb) (gdb) _ After the patch: [bash]jkratoch@host0.dyn.jankratochvil.net:/home/jkratoch/redhat/sources/readline# ../gdb/gdb -nx -silent(gdb) p 1 $1 = 1 (gdb) Quit (gdb) _ There are no testsuite regressions on Fedora 8 x86_64. The problem reproduced the same on readline-5.2. There will be needed a GDB patch to close PR 544. Regards, Jan --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="readline-display-blockint.patch" Content-length: 1735 --- 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_ */ --YZ5djTAD1cGYuMQK--