public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix test-case on ppc64le (PR testsuite/79455).
@ 2017-04-24 15:25 Martin Liška
  2017-04-24 15:28 ` Martin Liška
       [not found] ` <20170424151939.GP1809@tucnak>
  0 siblings, 2 replies; 8+ messages in thread
From: Martin Liška @ 2017-04-24 15:25 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, wschmidt, kelvin

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

Hi.

Test-case mentioned in the PR looks as follows on ppc64le:

WARNING: ThreadSanitizer: data race (pid=45910)
  Atomic read of size 1 at 0x000010020200 by thread T2:
    #0 pthread_mutex_lock ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3608 (libtsan.so.0+0x000000044724)

    #1 Thread2(void*) /home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:22 (race_on_mutex.exe+0x000010001110)

  Previous write of size 8 at 0x000010020200 by thread T1:
    #0 memset ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:558 (libtsan.so.0+0x000000036194)
    #1 __pthread_mutex_init <null> (libpthread.so.0+0x00000000adcc)
    #2 Thread1(void*) /home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:12 (race_on_mutex.exe+0x000010000fe4)

compared to what's on x86_64-linux-gnu:

WARNING: ThreadSanitizer: data race (pid=8917)
  Atomic read of size 1 at 0x000000602100 by thread T2:
    #0 pthread_mutex_lock ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3608 (libtsan.so.0+0x00000003bc1f)
    #1 Thread2(void*) /home/marxin/Programming/gcc2/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:22 (race_on_mutex.exe+0x000000400f1c)

  Previous write of size 1 at 0x000000602100 by thread T1:
    #0 pthread_mutex_init ../../../../libsanitizer/tsan/tsan_interceptors.cc:1117 (libtsan.so.0+0x00000002bf5e)
    #1 Thread1(void*) /home/marxin/Programming/gcc2/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:12 (race_on_mutex.exe+0x000000400e99)

Bill suggested to disable memset builtin expansion, but it won't help as the back-trace leads to libpthread.so.
Thus I'm make the scan more verbose.

Tested on both x86_64-linux-gnu and ppc64le-linux-gnu.

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-Fix-test-case-on-ppc64le-PR-testsuite-79455.patch --]
[-- Type: text/x-patch, Size: 1403 bytes --]

From 2a9a475169bc95f147d67df343458fc0f7069512 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 24 Apr 2017 14:59:18 +0200
Subject: [PATCH] Fix test-case on ppc64le (PR testsuite/79455).

gcc/testsuite/ChangeLog:

2017-04-24  Martin Liska  <mliska@suse.cz>

	* c-c++-common/tsan/race_on_mutex.c: Make the scanned pattern
	more generic.
---
 gcc/testsuite/c-c++-common/tsan/race_on_mutex.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
index ae30d053c92..80c193789d7 100644
--- a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
+++ b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
@@ -40,6 +40,6 @@ int main() {
 /* { dg-output "  Atomic read of size 1 at .* by thread T2:(\n|\r\n|\r)" } */
 /* { dg-output "    #0 pthread_mutex_lock.*" } */
 /* { dg-output "    #1 Thread2.* .*(race_on_mutex.c:22|\\?{2}:0) (.*)" } */
-/* { dg-output "  Previous write of size 1 at .* by thread T1:(\n|\r\n|\r)" } */
-/* { dg-output "    #0 pthread_mutex_init .* (.)*" } */
-/* { dg-output "    #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
+/* { dg-output "  Previous write of size . at .* by thread T1:(\n|\r\n|\r)" } */
+/* { dg-output "    #. .*pthread_mutex_init .* (.)*" } */
+/* { dg-output "    #. Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
-- 
2.12.2


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

end of thread, other threads:[~2017-04-27 14:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 15:25 [PATCH] Fix test-case on ppc64le (PR testsuite/79455) Martin Liška
2017-04-24 15:28 ` Martin Liška
     [not found] ` <20170424151939.GP1809@tucnak>
2017-04-25  9:41   ` Martin Liška
2017-04-26 10:19     ` Martin Liška
2017-04-26 10:20       ` Martin Liška
2017-04-26 14:04         ` Bernd Edlinger
2017-04-27 14:43           ` Martin Liška
2017-04-27 14:49             ` Jakub Jelinek

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