public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "emil.styrke at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/55561] TSAN: provide a TSAN instrumented libgomp
Date: Tue, 21 Jan 2014 12:44:00 -0000	[thread overview]
Message-ID: <bug-55561-4-YKliz5aY1S@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55561-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55561

Emil Styrke <emil.styrke at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emil.styrke at gmail dot com

--- Comment #42 from Emil Styrke <emil.styrke at gmail dot com> ---
Created attachment 31905
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31905&action=edit
Patch idea

(In reply to Joost VandeVondele from comment #40)
> I'm updating the summary for this bug. It is my impression that tsan & omp
> now work well together, but in order for this to be useful, a tsan
> instrumented libgomp needs to be linked in. In my opinion, it would be great
> if gcc would build to versions of the runtime library (one standard, one
> tsan instrumented) and link the tsan instrumented libgomp as needed.
> 
> As a side effect, it will provide good checking for the libgomp library. 
> 
> I also believe this is a more sustainable approach than writing wrappers for
> all omp functionality.

I have made a try to create a patch for this, just to get the ball rolling. 
However, my autotools knowledge is a bit thin and my experience with the GCC
codebase even thinner, so I didn't get all the way.

The idea is to create a tsan-instrumented libgomp as libgomp_tsan.so and change
the libgomp.spec to select that library instead if -fsanitize=thread is used.

Issues I didn't manage to sort out:
 * Correctly detecting if tsan support is available (as evident by the
commented-out logic in the patch).
 * The vpath magic for finding the files in config/ breaks for the new target
because explicit targets are created for each source file.  I hacked around
this 
 by hard-coding the paths for Linux, but obviously this is ugly.
 * It seems the multilib support broke with this patch (I get the resulting
library and spec file in lib/ instead of lib32/ and lib64/), but maybe I just
handled the build scripts wrong...
 * There are no test cases...

Anyway, after manually fixing up the install it seems to work alright.  If this
looks like a reasonable way forward, I'd be happy to improve the patch after
feedback or leave this embryo in the hands of someone more knowledgeable.


  parent reply	other threads:[~2014-01-21 12:44 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02  8:16 [Bug sanitizer/55561] New: TSAN crashes for Fortran Joost.VandeVondele at mat dot ethz.ch
2012-12-02  9:21 ` [Bug sanitizer/55561] " dvyukov at google dot com
2012-12-02  9:30 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-02  9:36 ` dvyukov at google dot com
2012-12-02 10:28 ` kcc at gcc dot gnu.org
2012-12-02 21:11 ` jakub at gcc dot gnu.org
2012-12-03  7:42 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-10 12:44 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-10 12:47 ` pinskia at gcc dot gnu.org
2012-12-10 12:53 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-10 12:57 ` dvyukov at google dot com
2012-12-10 12:59 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-10 15:07 ` dvyukov at google dot com
2012-12-10 15:56 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-11  9:48 ` [Bug sanitizer/55561] TSAN: Fortran/OMP yields false positives Joost.VandeVondele at mat dot ethz.ch
2012-12-25 19:30 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-25 20:23 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-26 19:35 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-29  9:33 ` dvyukov at google dot com
2012-12-29  9:38 ` dvyukov at google dot com
2012-12-29 10:13 ` dvyukov at google dot com
2012-12-29 10:21 ` dvyukov at google dot com
2012-12-30  9:03 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-30  9:58 ` dvyukov at google dot com
2012-12-30 10:11 ` dvyukov at google dot com
2012-12-30 14:53 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-30 17:07 ` dvyukov at google dot com
2012-12-30 19:57 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-01 17:14 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-02  9:09 ` dvyukov at google dot com
2013-01-02  9:44 ` jakub at gcc dot gnu.org
2013-01-02 10:28 ` dvyukov at google dot com
2013-01-07 21:35 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-08  9:17 ` dvyukov at google dot com
2013-01-10 11:27 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-10 11:37 ` jakub at gcc dot gnu.org
2013-01-31  7:43 ` amodra at gmail dot com
2013-01-31 14:29 ` jakub at gcc dot gnu.org
2013-01-31 16:57 ` jakub at gcc dot gnu.org
2013-02-01 20:00 ` dvyukov at google dot com
2013-03-29  8:11 ` [Bug sanitizer/55561] TSAN: provide a TSAN instrumented libgomp Joost.VandeVondele at mat dot ethz.ch
2013-06-03 13:21 ` dvyukov at google dot com
2014-01-21 12:44 ` emil.styrke at gmail dot com [this message]
2014-01-22  8:14 ` Joost.VandeVondele at mat dot ethz.ch
2014-05-08 19:49 ` roland at rschulz dot eu
2014-05-09  5:38 ` Joost.VandeVondele at mat dot ethz.ch
2014-05-09 10:26 ` dvyukov at google dot com
2014-05-14 19:17 ` Joost.VandeVondele at mat dot ethz.ch
2014-05-14 19:25 ` dvyukov at google dot com
2014-07-09  6:07 ` roland at rschulz dot eu
2014-07-09  7:12 ` jakub at gcc dot gnu.org
2014-07-09  7:17 ` Joost.VandeVondele at mat dot ethz.ch
2024-02-29 17:27 ` egallager at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55561-4-YKliz5aY1S@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).