------- Comment #2 from bart dot vanassche at gmail dot com  2009-06-07 06:14 
-------
(In reply to comment #1)
> >==21970==    at 0x71A35FD: gomp_iter_dynamic_next (iter.c:190)
> 
> Is a bogus warning as that is thread specific data:
>   struct gomp_thread *thr = gomp_thread ();
>   struct gomp_work_share *ws = thr->ts.work_share;

Are you sure that *thr is only modified by a single thread ? The full DRD
output for this specific race shows that the data in *thr was modified by
thread 4 before thread 2 read that data, and that there was no proper
synchronization between the two accesses of *thr:

==14553== Thread 2:
==14553== Conflicting load by thread 2/2 at 0x07b41234 size 4
==14553==    at 0x71A35FD: gomp_iter_dynamic_next (iter.c:190)
==14553==    by 0x449AE7: PixelIterateMonoModify.omp_fn.3
(pixel_iterator.c:230)
==14553==    by 0x71A6977: gomp_thread_start (team.c:115)
==14553==    by 0x4C287BB: vgDrd_thread_wrapper (drd_pthread_intercepts.c:224)
==14553==    by 0x73B306F: start_thread (in /lib64/libpthread-2.9.so)
==14553==    by 0x769B10C: clone (in /lib64/libc-2.9.so)
==14553== Address 0x7b41234 is at offset 452 from 0x7b41070. Allocation
context:
==14553==    at 0x4C249E9: malloc (vg_replace_malloc.c:193)
==14553==    by 0x71A2068: gomp_malloc (alloc.c:36)
==14553==    by 0x71A6FFC: gomp_new_team (team.c:143)
==14553==    by 0x71A5B2B: GOMP_parallel_start (parallel.c:108)
==14553==    by 0x449D71: PixelIterateMonoModify (pixel_iterator.c:230)
==14553==    by 0x431DAF: SetImage (image.c:4527)
==14553==    by 0x520198: ReadXCImage (xc.c:118)
==14553==    by 0x40B4FF: ReadImage (constitute.c:8478)
==14553==    by 0x40A006: main (drawtest.c:380)
==14553== Other segment start (thread 4/4)
==14553==    at 0x4C25A56: pthread_mutex_lock (drd_pthread_intercepts.c:489)
==14553==    by 0x71A7266: gomp_work_share_start (mutex.h:44)
==14553==    by 0x71A466A: GOMP_loop_dynamic_start (loop.c:120)
==14553==    by 0x449AE7: PixelIterateMonoModify.omp_fn.3
(pixel_iterator.c:230)
==14553==    by 0x71A6977: gomp_thread_start (team.c:115)
==14553==    by 0x4C287BB: vgDrd_thread_wrapper (drd_pthread_intercepts.c:224)
==14553==    by 0x73B306F: start_thread (in /lib64/libpthread-2.9.so)
==14553==    by 0x769B10C: clone (in /lib64/libc-2.9.so)
==14553== Other segment end (thread 4/4)
==14553==    at 0x4C25D91: pthread_mutex_unlock (drd_pthread_intercepts.c:535)
==14553==    by 0x71A4748: GOMP_loop_dynamic_start (mutex.h:49)
==14553==    by 0x449AE7: PixelIterateMonoModify.omp_fn.3
(pixel_iterator.c:230)
==14553==    by 0x71A6977: gomp_thread_start (team.c:115)
==14553==    by 0x4C287BB: vgDrd_thread_wrapper (drd_pthread_intercepts.c:224)
==14553==    by 0x73B306F: start_thread (in /lib64/libpthread-2.9.so)
==14553==    by 0x769B10C: clone (in /lib64/libc-2.9.so)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40362

Reply via email to