From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24935 invoked by alias); 29 Oct 2011 14:01:23 -0000 Received: (qmail 24927 invoked by uid 22791); 29 Oct 2011 14:01:22 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Oct 2011 14:01:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9TE10il022320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 29 Oct 2011 10:01:00 -0400 Received: from host1.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9TE0wLK001268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Oct 2011 10:01:00 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9TE0w7W007468; Sat, 29 Oct 2011 16:00:58 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9TE0v9G007467; Sat, 29 Oct 2011 16:00:57 +0200 Date: Sat, 29 Oct 2011 15:09:00 -0000 From: Jan Kratochvil To: Marek Polacek Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [patch] testsuite: MI: racy results in async mode #2 Message-ID: <20111029140057.GA31363@host1.jankratochvil.net> References: <20111027101544.GA5288@host1.jankratochvil.net> <20111028083256.GA8281@host1.jankratochvil.net> <20111029100900.GA5767@host1.jankratochvil.net> <4EABD716.3080000@redhat.com> <4EABED10.2060600@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EABED10.2060600@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-10/txt/msg00803.txt.bz2 On Sat, 29 Oct 2011 14:09:52 +0200, Marek Polacek wrote: > Well I've run $ runtest -a gdb.mi/*.exp with read1 10+ times and didn't find > any race failures. Unfortunately this problem is unrelated to "read1". The problem is GDB will: write: *stopped,reason... write: =breakpoint-deleted,... read: while expect will: read: *stopped,reason... + everything available incl. =breakpoint-deleted write: 222-break-insert break_at_me read: ... now either =breakpoint-deleted is read or local 222-break-insert pty echo In normal cases the first expect's read will read even =breakpoint-deleted. With the read1 hack =breakpoint-deleted is not read in, it is kept in some internal pty buffer. But it is already in that pty buffer so when expect sends 222-break-insert the pty echoes 222-break-insert already _after_ the =breakpoint-deleted string so no reproducibility changes with read1. One can reproduce it by delaying all the writes from GDB. This way everything gets processed on the expect side (incl. pty write + read of its echo) and only afterwars =breakpoint-deleted finally arrives. I have attached this different kind of reproducer to the Bug: http://sourceware.org/bugzilla/show_bug.cgi?id=12649#c6 Thanks, Jan