Helgrind reports "Possible data race" on most simple c++ code, with openmp -



Helgrind reports "Possible data race" on most simple c++ code, with openmp -

i checking programme thread errors, , have reproduced helgrind error getting using simple code:

int main() { int num = 24; #pragma omp parallel firstprivate(num) (int i= 0; <num; ++i) { int test = 0; } }

compiled g++-4.7 -fopenmp -g test.cpp -o test

which generates 300 lines of errors "possible info race". lack of understanding here? doing wrong?

here sample of error log:

1 ==11990== helgrind, thread error detector 2 ==11990== copyright (c) 2007-2013, , gnu gpl'd, openworks llp et al. 3 ==11990== using valgrind-3.9.0 , libvex; rerun -h copyright info 4 ==11990== command: /home/windenergy/test 5 ==11990== parent pid: 10832 6 ==11990== 7 8 parse_type_die: confused by: 9 <2><197>: dw_tag_typedef 10 dw_at_type : <1f4> 11 12 --11990-- warning: serious error when reading debug info 13 --11990-- when reading debug info /home/windenergy/test: 14 --11990-- parse_type_die: confused above die 15 ==11990== ---thread-announcement------------------------------------------ 16 ==11990== 17 ==11990== thread #1 program's root thread 18 ==11990== 19 ==11990== ---thread-announcement------------------------------------------ 20 ==11990== 21 ==11990== thread #24 created 22 ==11990== @ 0x5ace05e: clone (in /lib64/libc-2.11.3.so) 23 ==11990== 0x57dc990: do_clone (in /lib64/libpthread-2.11.3.so) 24 ==11990== 0x57dcf77: pthread_create@@glibc_2.2.5 (in /lib64/libpthread-2.11.3.so) 25 ==11990== 0x4c2db78: pthread_create_wrk (hg_intercepts.c:269) 26 ==11990== 0x4c2dc89: pthread_create@* (hg_intercepts.c:300) 27 ==11990== 0x53ba56d: ??? (in /usr/lib64/libgomp.so.1.0.0) 28 ==11990== 0x400816: main (test.cpp:4) 29 ==11990== 30 ==11990== ---------------------------------------------------------------- 31 ==11990== 32 ==11990== possible info race during write of size 4 @ 0x5f750c0 thread #1 33 ==11990== locks held: none 34 ==11990== @ 0x53bb85b: ??? (in /usr/lib64/libgomp.so.1.0.0) 35 ==11990== 0x53ba5b0: ??? (in /usr/lib64/libgomp.so.1.0.0) 36 ==11990== 0x400816: main (test.cpp:4) 37 ==11990== 38 ==11990== conflicts previous read of size 4 thread #24 39 ==11990== locks held: none 40 ==11990== @ 0x53bb8c6: ??? (in /usr/lib64/libgomp.so.1.0.0) 41 ==11990== 0x53ba0b8: ??? (in /usr/lib64/libgomp.so.1.0.0) 42 ==11990== 0x4c2dd12: mythread_wrapper (hg_intercepts.c:233) 43 ==11990== 0x57dd7f5: start_thread (in /lib64/libpthread-2.11.3.so) 44 ==11990== 0x5ace09c: clone (in /lib64/libc-2.11.3.so) 45 ==11990== 46 ==11990== address 0x5f750c0 128 bytes within block of size 192 alloc'd 47 ==11990== @ 0x4c2819e: malloc (vg_replace_malloc.c:291) 48 ==11990== 0x53b6038: ??? (in /usr/lib64/libgomp.so.1.0.0) 49 ==11990== 0x53ba7df: ??? (in /usr/lib64/libgomp.so.1.0.0) 50 ==11990== 0x400816: main (test.cpp:4) 51 ==11990== 52 ==11990== ---------------------------------------------------------------- 53 ==11990== 54 ==11990== possible info race during write of size 4 @ 0x5f75084 thread #1 55 ==11990== locks held: none 56 ==11990== @ 0x53bb869: ??? (in /usr/lib64/libgomp.so.1.0.0) 57 ==11990== 0x53ba5b0: ??? (in /usr/lib64/libgomp.so.1.0.0) 58 ==11990== 0x400816: main (test.cpp:4) 59 ==11990== 60 ==11990== conflicts previous read of size 4 thread #24 61 ==11990== locks held: none 62 ==11990== @ 0x53bb8c0: ??? (in /usr/lib64/libgomp.so.1.0.0) 63 ==11990== 0x53ba0b8: ??? (in /usr/lib64/libgomp.so.1.0.0) 64 ==11990== 0x4c2dd12: mythread_wrapper (hg_intercepts.c:233) 65 ==11990== 0x57dd7f5: start_thread (in /lib64/libpthread-2.11.3.so) 66 ==11990== 0x5ace09c: clone (in /lib64/libc-2.11.3.so) 67 ==11990== 68 ==11990== address 0x5f75084 68 bytes within block of size 192 alloc'd 69 ==11990== @ 0x4c2819e: malloc (vg_replace_malloc.c:291) 70 ==11990== 0x53b6038: ??? (in /usr/lib64/libgomp.so.1.0.0) 71 ==11990== 0x53ba7df: ??? (in /usr/lib64/libgomp.so.1.0.0) 72 ==11990== 0x400816: main (test.cpp:4) 73 ==11990==

c++ openmp valgrind

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -