Discussion:
Valgrind: r16304 - in /trunk/helgrind/tests: Makefile.am pth_destroy_cond.stderr.exp2
(too old to reply)
s***@valgrind.org
2017-04-13 16:33:07 UTC
Permalink
Raw Message
Author: petarj
Date: Thu Apr 13 17:33:06 2017
New Revision: 16304

Log:
add additional stderr.exp file for helgrind/tests/pth_destroy_cond

On some platforms, Helgrind detects valid additional data race over "cond".
Thread one is at pthread_cond_wait(&cond, &mutex).
Thread two is at pthread_cond_destroy(&cond).

This fixes helgrind/tests/pth_destroy_cond on different platforms.

Contributed by Aleksandra Karadzic.

Added:
trunk/helgrind/tests/pth_destroy_cond.stderr.exp2
Modified:
trunk/helgrind/tests/Makefile.am

Modified: trunk/helgrind/tests/Makefile.am
==============================================================================
--- trunk/helgrind/tests/Makefile.am (original)
+++ trunk/helgrind/tests/Makefile.am Thu Apr 13 17:33:06 2017
@@ -46,7 +46,8 @@
pth_barrier2.vgtest pth_barrier2.stdout.exp pth_barrier2.stderr.exp \
pth_barrier3.vgtest pth_barrier3.stdout.exp pth_barrier3.stderr.exp \
pth_destroy_cond.vgtest \
- pth_destroy_cond.stdout.exp pth_destroy_cond.stderr.exp \
+ pth_destroy_cond.stdout.exp \
+ pth_destroy_cond.stderr.exp pth_destroy_cond.stderr.exp2 \
pth_cond_destroy_busy.vgtest pth_cond_destroy_busy.stderr.exp \
pth_cond_destroy_busy.stderr.exp-ppc64 \
pth_cond_destroy_busy.stderr.exp-solaris \

Added: trunk/helgrind/tests/pth_destroy_cond.stderr.exp2
==============================================================================
--- trunk/helgrind/tests/pth_destroy_cond.stderr.exp2 (added)
+++ trunk/helgrind/tests/pth_destroy_cond.stderr.exp2 Thu Apr 13 17:33:06 2017
@@ -0,0 +1,44 @@
+---Thread-Announcement------------------------------------------
+
+Thread #x was created
+ ...
+ by 0x........: pthread_create@* (hg_intercepts.c:...)
+ by 0x........: main (pth_destroy_cond.c:29)
+
+---Thread-Announcement------------------------------------------
+
+Thread #x is the program's root thread
+
+----------------------------------------------------------------
+
+ Lock at 0x........ was first observed
+ at 0x........: pthread_mutex_init (hg_intercepts.c:...)
+ by 0x........: main (pth_destroy_cond.c:25)
+ Address 0x........ is 0 bytes inside data symbol "mutex"
+
+Possible data race during read of size 1 at 0x........ by thread #x
+Locks held: 1, at address 0x........
+ at 0x........: my_memcmp (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: ThreadFunction (pth_destroy_cond.c:18)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+ ...
+
+This conflicts with a previous write of size 4 by thread #x
+Locks held: none
+ ...
+ by 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
+ by 0x........: main (pth_destroy_cond.c:31)
+ Address 0x........ is 4 bytes inside data symbol "cond"
+
+----------------------------------------------------------------
+
+Thread #x: pthread_cond_destroy: destruction of condition variable being waited upon
+ at 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: ThreadFunction (pth_destroy_cond.c:18)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+ ...
+

Loading...