public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
@ 2015-01-03  9:01 Bernd Edlinger
  2015-01-03  9:51 ` Mike Stump
  0 siblings, 1 reply; 49+ messages in thread
From: Bernd Edlinger @ 2015-01-03  9:01 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

Hi,


the test case g++.dg/tsan/aligned_vs_unaligned_race.C
still fails sporadically (around 1 out of 100 times).
That is apparently a race condition in the tsan runtime itself.
To make the test reproducible pass, I need to add a sleep(1)
in one of the two threads.


Tested really often with:
make check-gcc-c++ RUNTESTFLAGS="tsan.exp=*"

OK for trunk?


Thanks
Bernd.
 		 	   		  

[-- Attachment #2: patch-tsan-race.diff --]
[-- Type: application/octet-stream, Size: 610 bytes --]

2015-01-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * g++.dg/tsan/aligned_vs_unaligned_race.C: Fixed race condition.

Index: gcc/testsuite/g++.dg/tsan/aligned_vs_unaligned_race.C
===================================================================
--- gcc/testsuite/g++.dg/tsan/aligned_vs_unaligned_race.C	(revision 219154)
+++ gcc/testsuite/g++.dg/tsan/aligned_vs_unaligned_race.C	(working copy)
@@ -2,10 +2,12 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <unistd.h>
 
 uint64_t Global[2];
 
 void *Thread1(void *x) {
+  sleep(1);
   Global[1]++;
   return NULL;
 }

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-01-21  8:52 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-03  9:01 [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C Bernd Edlinger
2015-01-03  9:51 ` Mike Stump
2015-01-03 11:20   ` Bernd Edlinger
2015-01-04 17:00     ` Bernd Edlinger
2015-01-04 19:07       ` Mike Stump
2015-01-04 19:17         ` Jakub Jelinek
2015-01-04 19:44           ` Bernd Edlinger
2015-01-04 22:19             ` Mike Stump
2015-01-05  8:49               ` Bernd Edlinger
2015-01-05 20:58                 ` Mike Stump
2015-01-05 22:02                   ` Mike Stump
2015-01-06  1:07                     ` Bernd Edlinger
2015-01-06  9:08                       ` Bernd Edlinger
2015-01-06  9:16                         ` Jakub Jelinek
2015-01-06  9:38                           ` Bernd Edlinger
2015-01-06 17:45                           ` Bernd Edlinger
2015-01-06 19:48                             ` Mike Stump
2015-01-06 23:22                               ` Bernd Edlinger
2015-01-07  0:33                                 ` Mike Stump
2015-01-07  7:17                                   ` Bernd Edlinger
2015-01-07  8:23                                     ` Jakub Jelinek
2015-01-07 14:55                                       ` Bernd Edlinger
2015-01-07 15:04                                         ` Jakub Jelinek
2015-01-07 16:58                                       ` Mike Stump
2015-01-07 17:00                                         ` Jakub Jelinek
2015-01-07 18:21                                           ` Bernd Edlinger
2015-01-07 18:32                                             ` Jakub Jelinek
2015-01-07 22:44                                               ` Bernd Edlinger
2015-01-08 19:24                                                 ` Mike Stump
2015-01-08 19:29                                                   ` Jakub Jelinek
2015-01-08 21:07                                                     ` Mike Stump
2015-01-08 21:27                                                       ` Jakub Jelinek
2015-01-08 22:06                                                         ` Mike Stump
2015-01-08 22:23                                                           ` Bernd Edlinger
2015-01-09 15:36                                                         ` Bernd Edlinger
2015-01-09 15:37                                                           ` Jakub Jelinek
2015-01-19  8:53                                                             ` Dmitry Vyukov
2015-01-19 15:16                                                               ` Mike Stump
2015-01-21  8:52                                                                 ` Dmitry Vyukov
2015-01-21  9:02                                                                   ` Jakub Jelinek
2015-01-21  9:07                                                                     ` Dmitry Vyukov
2015-01-08 19:10                                       ` Mike Stump
2015-01-07 16:36                                     ` Mike Stump
2015-01-06 21:29                       ` Mike Stump
2015-01-04 19:05     ` Mike Stump
2015-01-04 19:15       ` Jakub Jelinek
2015-01-04 21:48       ` Bernd Edlinger
2015-01-04 21:58         ` Mike Stump
2015-01-04 22:20           ` Bernd Edlinger

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).