public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kcc at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/61095] tsan is broken in gcc trunk, works in 4.9
Date: Wed, 07 May 2014 12:03:00 -0000	[thread overview]
Message-ID: <bug-61095-4-UdyOU1495K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61095-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
I suspect a miscompile,
at least the following patch to the libsanitizer sources fixes the problem:

--- tsan_rtl.cc (revision 210145)
+++ tsan_rtl.cc (working copy)
@@ -584,7 +584,8 @@
   if (kGoMode || size < 64*1024) {
     u64 *p = (u64*)MemToShadow(addr);
     CHECK(IsShadowMem((uptr)p));
-    CHECK(IsShadowMem((uptr)(p + size * kShadowCnt / kShadowCell - 1)));
+    volatile uptr xxx = (uptr)(p + size * kShadowCnt / kShadowCell - 1);
+    CHECK(IsShadowMem(xxx));
     // FIXME: may overwrite a part outside the region
     for (uptr i = 0; i < size / kShadowCell * kShadowCnt;) {
       p[i++] = val;


Note the "volatile". W/o volatile tsan still crashes.


  reply	other threads:[~2014-05-07 12:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 11:16 [Bug sanitizer/61095] New: " kcc at gcc dot gnu.org
2014-05-07 12:03 ` kcc at gcc dot gnu.org [this message]
2014-05-07 12:50 ` [Bug sanitizer/61095] [4.10 Regression] " rguenth at gcc dot gnu.org
2014-05-07 12:55 ` [Bug sanitizer/61095] miscompile: " kcc at gcc dot gnu.org
2014-05-07 13:04 ` [Bug sanitizer/61095] [4.10 Regression] " kcc at gcc dot gnu.org
2014-05-07 13:25 ` rguenth at gcc dot gnu.org
2014-05-07 13:27 ` rguenth at gcc dot gnu.org
2014-05-07 13:27 ` jakub at gcc dot gnu.org
2014-05-07 13:29 ` rguenth at gcc dot gnu.org
2014-05-07 16:28 ` rsandifo at gcc dot gnu.org
2014-05-07 18:01 ` rsandifo at gcc dot gnu.org
2014-05-08  4:35 ` kcc at gcc dot gnu.org
2014-05-08  4:39 ` kcc at gcc dot gnu.org
2014-05-08  7:19 ` kcc at gcc dot gnu.org
2014-05-08  7:34 ` rsandifo at gcc dot gnu.org
2014-05-08  8:01 ` rsandifo at gcc dot gnu.org
2014-05-08 19:29 ` rsandifo 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-61095-4-UdyOU1495K@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).