On Wed, Mar 5, 2008 at 1:47 AM, Julian Seward <[EMAIL PROTECTED]> wrote:
>
>  > Which  modifications do we need to use Helgrind on  OpenMP.  Is there any
>  > patch to use?
>
>  The attached tarball gives details of how to use GNU OpenMP in gcc-4.2.3.

Hello Julian,

Is it correct that OpenMP uses a lot of POSIX threads barriers ? In
that case I think you better verify the barrier implementation in
Helgrind first. There are false positives reported for the following
test case:

$ ./vg-in-place --tool=helgrind exp-drd/tests/matinv 30 15 1
==23981== Helgrind, a thread error detector.
==23981== Copyright (C) 2007-2008, and GNU GPL'd, by OpenWorks LLP et al.
==23981== Using LibVEX rev 1811, a library for dynamic binary translation.
==23981== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==23981== Using valgrind-3.4.0.SVN, a dynamic binary instrumentation framework.
==23981== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==23981== For more details, rerun with: -v
==23981==
==23981== Thread #2 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Thread #3 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 4 at 0x7FEFFFB58
==23981==    at 0x4E33E5E: pthread_barrier_wait (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #2, #3
==23981==   New state: shared-modified by threads #2, #3
==23981==   Reason:    this thread, #3, holds no consistent locks
==23981==   Location 0x7FEFFFB58 has never been protected by any lock
==23981==   Location 0x7fefffb58 is 8 bytes inside local var "b"
==23981==   declared at matinv.c:230, in frame #4 of thread 1
==23981==
==23981== Thread #4 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Thread #5 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Thread #6 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 4 at 0x7FEFFFB50
==23981==    at 0x4E33E99: pthread_barrier_wait (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #2, #3, #4, #5, #6
and 10 others
==23981==   New state: shared-modified by threads #2, #3, #4, #5, #6
and 10 others
==23981==   Reason:    this thread, #16, holds no consistent locks
==23981==   Location 0x7FEFFFB50 has never been protected by any lock
==23981==   Location 0x7fefffb50 is 0 bytes inside local var "b"
==23981==   declared at matinv.c:230, in frame #4 of thread 1
==23981==
==23981== Thread #16 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 8 at 0x55DFAB0
==23981==    at 0x4010A1: gj_threadfunc (matinv.c:218)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #2, #16
==23981==   New state: shared-modified by threads #2, #16
==23981==   Reason:    this thread, #2, holds no consistent locks
==23981==   Location 0x55DFAB0 has never been protected by any lock
==23981==
==23981== Thread #15 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 8 at 0x55DFAB8
==23981==    at 0x400F3F: gj_threadfunc (matinv.c:196)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #2, #15
==23981==   New state: shared-modified by threads #2, #15
==23981==   Reason:    this thread, #15, holds no consistent locks
==23981==   Location 0x55DFAB8 has never been protected by any lock
==23981==
==23981== Thread #14 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 8 at 0x55E27B8
==23981==    at 0x400F5D: gj_threadfunc (matinv.c:197)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #14, #15
==23981==   New state: shared-modified by threads #14, #15
==23981==   Reason:    this thread, #15, holds no consistent locks
==23981==   Location 0x55E27B8 has never been protected by any lock
==23981==
==23981== Thread #13 was created
==23981==    at 0x535BF4E: clone (in /lib64/libc-2.6.1.so)
==23981==    by 0x4E2F285: do_clone (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x4E2F733: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.6.1.so)
==23981==    by 0x4C25783: [EMAIL PROTECTED] (hg_intercepts.c:213)
==23981==    by 0x401292: gj (matinv.c:246)
==23981==    by 0x40141A: invert_matrix (matinv.c:269)
==23981==    by 0x4016B0: main (matinv.c:322)
==23981==
==23981== Possible data race during write of size 8 at 0x55E25C8
==23981==    at 0x400FF0: gj_threadfunc (matinv.c:205)
==23981==    by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193)
==23981==    by 0x4E2F01F: start_thread (in /lib64/libpthread-2.6.1.so)
==23981==    by 0x535BF8C: clone (in /lib64/libc-2.6.1.so)
==23981==   Old state: shared-readonly by threads #13, #14
==23981==   New state: shared-modified by threads #13, #14
==23981==   Reason:    this thread, #14, holds no consistent locks
==23981==   Location 0x55E25C8 has never been protected by any lock
Error within bounds.
==23981==
==23981== ERROR SUMMARY: 1802 errors from 6 contexts (suppressed: 4 from 2)


Bart.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to