From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7723 invoked by alias); 3 Jan 2015 11:20:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7712 invoked by uid 89); 3 Jan 2015 11:20:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_JMF_BR,SPF_PASS autolearn=no version=3.3.2 X-HELO: DUB004-OMC4S33.hotmail.com Received: from dub004-omc4s33.hotmail.com (HELO DUB004-OMC4S33.hotmail.com) (157.55.2.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Sat, 03 Jan 2015 11:20:14 +0000 Received: from DUB118-W29 ([157.55.2.72]) by DUB004-OMC4S33.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Sat, 3 Jan 2015 03:20:10 -0800 X-TMN: [G5ClQoKT3X+zOJM9rWI7MXFqq0YNUsN1] Message-ID: From: Bernd Edlinger To: Mike Stump CC: Jakub Jelinek , "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C Date: Sat, 03 Jan 2015 11:20:00 -0000 In-Reply-To: <3C12133C-DABF-40FA-94F7-9DB785F6E914@comcast.net> References: ,<3C12133C-DABF-40FA-94F7-9DB785F6E914@comcast.net> Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00051.txt.bz2 On Sat, 3 Jan 2015 01:51:34, Mike Strump wrote: > > On Jan 3, 2015, at 1:01 AM, Bernd Edlinger wr= ote: >> the test case g++.dg/tsan/aligned_vs_unaligned_race.C >> still fails sporadically (around 1 out of 100 times). >> That is apparently a race condition in the tsan runtime itself. >> To make the test reproducible pass, I need to add a sleep(1) >> in one of the two threads. >> >> >> Tested really often with: >> make check-gcc-c++ RUNTESTFLAGS=3D"tsan.exp=3D*" >> >> OK for trunk? > > No. sleep can never fix race conditions. The only time sleep can fix a ra= ce condition would be in a hard real time system, and, that in general does= n=92t apply to anything in the gcc test suite. Yes, but all other tsan test cases call sleep(1) too. The sleep does not really "fix" the race condition but it changes the likelihood from 1 / 100 to 1 / 10^20. That is just to avoid noise from sporadic test failures. Bernd. =20=09=09=20=09=20=20=20=09=09=20=20