From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22301 invoked by alias); 10 Dec 2012 15:56:08 -0000 Received: (qmail 22170 invoked by uid 48); 10 Dec 2012 15:55:51 -0000 From: "Joost.VandeVondele at mat dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/55561] TSAN crashes for Fortran Date: Mon, 10 Dec 2012 15:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01003.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55561 --- Comment #13 from Joost VandeVondele 2012-12-10 15:55:50 UTC --- (In reply to comment #12) > That's great that gcc tsan works for Fortran/OpenMP out of the box! I'm afraid it yields false positives. Something like this is supposed to be OK OMP-wise (and gives the right result in 10000 repetitions) but produces warnings. > cat test.f90 INTEGER, PARAMETER :: N=10 INTEGER :: data(N) !$OMP PARALLEL DO DO j=1,N data(j)=j ENDDO !$OMP PARALLEL DO DO j=N,1,-1 data(j)=data(j)-j ENDDO IF (ANY(data.NE.0)) CALL abort() END > gfortran -fsanitize=thread -O1 -g -fopenmp -fPIC -pie test.f90 ; ./a.out ================== WARNING: ThreadSanitizer: data race (pid=18871) > However, most likely Fortran/OpenMP will require some special handling to > produce better reports and catch more bugs (ThreadSanitizer reasons about > synchronization on pthread level, and not on OpenMP level). We won't have spare > cycles for that in near future. > I am working on ThreadSanitizer tasking API, I would appreciate if you review > it and comment on whether it will fit Fortran/OpenMP model (the work is > currently in very early "what if" stage). I'm sure there are knowledgeable people reading the gcc list... posting this text there seems like a good idea.