From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30237 invoked by alias); 7 Jan 2015 00:33:06 -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 30227 invoked by uid 89); 7 Jan 2015 00:33:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: resqmta-po-01v.sys.comcast.net Received: from resqmta-po-01v.sys.comcast.net (HELO resqmta-po-01v.sys.comcast.net) (96.114.154.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 07 Jan 2015 00:33:04 +0000 Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-01v.sys.comcast.net with comcast id coZ21p0025BUCh401oZ2CC; Wed, 07 Jan 2015 00:33:02 +0000 Received: from [IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d] ([IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d]) by resomta-po-16v.sys.comcast.net with comcast id coZ01p0052ztT3H01oZ0Nk; Wed, 07 Jan 2015 00:33:01 +0000 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C From: Mike Stump In-Reply-To: Date: Wed, 07 Jan 2015 00:33:00 -0000 Cc: Jakub Jelinek , "H.J. Lu" , "gcc-patches@gcc.gnu.org" , Dmitry Vyukov Content-Transfer-Encoding: quoted-printable Message-Id: References: ,<623A5348-6FC9-4F7B-A9BC-B2B098AF7D37@comcast.net>,<20150104191658.GK1667@tucnak.redhat.com>,,<8E43F8AA-96BA-47A3-A886-C058459B4108@comcast.net>,,,,,,<20150106091633.GF1667@tucnak.redhat.com>,, To: Bernd Edlinger X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00283.txt.bz2 On Jan 6, 2015, at 3:22 PM, Bernd Edlinger wrot= e: > Yes, I think too that it can't fail under these conditions. If you mean your version=85 A lot has been written on how to to make racy = code non-racy=85 I=92d refer you to the literature on all the various solu= tions people have found to date. I don=92t think I=92ve ever seen anyone c= laim that affinity can be used to solve race conditions like this. Do you = have a pointer? > If we prepare the test in this way it does not really contain any race co= ndition. >=20 > (*p4).val++; > step (1); >=20 > happens first, and then: >=20 > step (2); > Global[1]++; >=20 > but we consider the test passed, when we see a diagnostic? If tsan doesn=92t work in the face of a race, then trivially, the code to t= est it cannot have a race. The difference is letting tsan know there is a = race, versus hiding the fact there is no race from it, so that it still thi= nks there is a race. For test cases to diagnose a race, those cases must h= ave the code that ensures there is not a race, hidden from view. > As far as I can see, there is no interceptor for sched_yield, so using th= at in the step function is OK. Sounds good. I=92m running a test suite run now with my attribute patch. I=92ll ask the= tsan people if it can go in, if it passes.