From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2695 invoked by alias); 18 Mar 2008 22:55:17 -0000 Received: (qmail 2687 invoked by uid 22791); 18 Mar 2008 22:55:16 -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; Tue, 18 Mar 2008 22:54:45 +0000 Received: from host0.dyn.jankratochvil.net ([192.168.76.151]) by router.kulicky.cz (8.13.8/8.13.8) with ESMTP id m2IMscYa024050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 18 Mar 2008 23:54:40 +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 m2IMsb0V027564 for ; Tue, 18 Mar 2008 23:54:37 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.2/8.14.2/Submit) id m2IMsabT027563 for gdb-patches@sourceware.org; Tue, 18 Mar 2008 23:54:36 +0100 Date: Tue, 18 Mar 2008 22:55:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Fix testsuite annotate-quit race (PR 544) Message-ID: <20080318225436.GA27374@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline 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/msg00262.txt.bz2 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 718 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) It gets reliably reproducible for me (Fedora 8 x86_64) if GDB gets straced: mv gdb gdb-orig wget -O gdb http://cvs.jankratochvil.net/viewcvs/nethome/src/gdb-wrap?rev=HEAD The problem is that if usually CTRL-C is hit during poll(2) and everything is fine. But if CTRL-C is hit inside readline processing its RL_SIGNAL_HANDLER gets called which calls RL_FREE_LINE_STATE and $gdb_prompt gets displayed twice and GDB_EXPECT or GDB_EXPECT_LIST are not patient enough to see later ^Z^Zerror-begin+Quit+^Z^Zquit. Unaware how to easily detect a failure without timing out. Regards, Jan --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-cvs-annota23-quit.patch" Content-length: 1584 2008-03-18 Jan Kratochvil PR 544 * gdb.cp/annota2.exp, gdb.cp/annota3.exp: Fix a race while recognizing `annotate-quit'. --- ./gdb/testsuite/gdb.cp/annota2.exp 28 Feb 2008 16:24:25 -0000 1.10 +++ ./gdb/testsuite/gdb.cp/annota2.exp 18 Mar 2008 22:41:28 -0000 @@ -205,14 +205,13 @@ gdb_expect { # test: # annotate-quit # -# This test sometimes fails, but not reproducibly. See gdb/544. +# We may get "$gdb_prompt$" earlier as it may get printed several times during +# CTRL-C if we catch its output early enough. # send_gdb "\003" gdb_expect { -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ { pass "annotate-quit" } - -re "$gdb_prompt$" { kfail "gdb/544" "annotate-quit" } - -re ".*$gdb_prompt$" { fail "annotate-quit" } timeout { fail "annotate-quit (timeout)" } } --- ./gdb/testsuite/gdb.cp/annota3.exp 1 Jan 2008 22:53:19 -0000 1.11 +++ ./gdb/testsuite/gdb.cp/annota3.exp 18 Mar 2008 22:41:28 -0000 @@ -208,13 +208,14 @@ gdb_expect { # test: # annotate-quit # -# This test sometimes fails, but not reproducibly. See gdb/544. +# We may get "$gdb_prompt$" earlier as it may get printed several times during +# CTRL-C if we catch its output early enough. # send_gdb "\003" -gdb_expect_list "annotate-quit" "$gdb_prompt$" { - "\r\n\032\032error-begin\r\n" - "Quit\r\n" - "\r\n\032\032quit\r\n" +gdb_expect { + -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ + { pass "annotate-quit" } + timeout { fail "annotate-quit (timeout)" } } # --1yeeQ81UyVL57Vl7--