https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79455

            Bug ID: 79455
           Summary: c-c++-common/tsan/race_on_mutex.c fails on powerpcle
                    starting with r244854 (where it was activated)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

------------------------------------------------------------------------
r244854 | jakub | 2017-01-24 02:19:37 -0600 (Tue, 24 Jan 2017) | 2 lines

        * configure.tgt: Enable tsan and lsan on powerpc64{,le}-*-linux*.


When run on powerpcle the output is the same as on x86 except for one section,
the one with memset.

On x86 this part is:
  Previous write of size 1 at 0x000000601300 by thread T1:
    #0 pthread_mutex_init
/home/seurer/gcc/gcc-test/libsanitizer/tsan/tsan_interceptors.cc:1117
(libtsan.so.0+0x00000002c1ee)
    #1 Thread1
/home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:12
(race_on_mutex.exe+0x000000400bf8)

And on power it is:
  Previous write of size 8 at 0x000010011600 by thread T1:
    #0 memset
/home/seurer/gcc/gcc-test/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:558
(libtsan.so.0+0x0000000360f4)
    #1 pthread_mutex_init <null> (libpthread.so.0+0x00000000b61c)
    #2 Thread1
/home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c:12
(race_on_mutex.exe+0x000010000cb4)

It fails when run as a test because it doesn't quite match the expected pattern

/* { 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) .*" } */

>From poking around in the test case and the tsan code it looks like the test is
detecting what it should and the difference in output is mostly "cosmetic".

Reply via email to