Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Fix testsuite annotate-quit race (PR 544)
@ 2008-03-18 22:55 Jan Kratochvil
  2008-03-18 23:18 ` Daniel Jacobowitz
  0 siblings, 1 reply; 23+ messages in thread
From: Jan Kratochvil @ 2008-03-18 22:55 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

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

[-- Attachment #2: gdb-cvs-annota23-quit.patch --]
[-- Type: text/plain, Size: 1584 bytes --]

2008-03-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	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)" }
 }
 
 #

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-03-25 15:56 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-18 22:55 [patch] Fix testsuite annotate-quit race (PR 544) 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox