From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4445 invoked by alias); 25 Dec 2012 19:30:49 -0000 Received: (qmail 4230 invoked by uid 48); 25 Dec 2012 19:30:19 -0000 From: "Joost.VandeVondele at mat dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/55561] TSAN: Fortran/OMP yields false positives Date: Tue, 25 Dec 2012 19:30: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/msg02309.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55561 --- Comment #15 from Joost VandeVondele 2012-12-25 19:30:15 UTC --- (In reply to comment #13) > (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. The obvious solution to this seems to be that also the OMP runtime (libgomp) must be compiled with -fsanitize=thread. If I do that, it appears to work. That's cool, I will try to do some more testing. A reasonable approach could be to build two versions of libgomp. One standard one, and one sanitized one (libgomp_tsan ?). -fsanitize=thread -fopenmp could link the second version automatically. Just for those trying this out... I used the following to build&install a sanitized libgomp (based on Jakub's comments in PR55374 and a hack of mine (-L...)) after an initial normal build cd /data/vjoost/gnu/gcc_trunk/obj/x86_64-unknown-linux-gnu/libgomp/ make clean make CFLAGS="-std=gnu99 -g -O2 -fsanitize=thread" FCFLAGS="-g -O2 -fsanitize=thread" LDFLAGS="-L/data/vjoost/gnu/gcc_trunk/obj/x86_64-unknown-linux-gnu/libsanitizer/tsan/.libs/ -B/data/vjoost/gnu/gcc_trunk/obj/x86_64-unknown-linux-gnu/libsanitizer/tsan/.libs/ -Wl,-rpath,/data/vjoost/gnu/gcc_trunk/obj/x86_64-unknown-linux-gnu/libsanitizer/tsan/.libs/ -fsanitize=thread" cd /data/vjoost/gnu/gcc_trunk/obj/ make install compilation as gfortran -fopenmp -fsanitize=thread -pie -fPIC test.f90