/helgrind/tests/bar_bad
/helgrind/tests/bar_trivial
/helgrind/tests/bug322621
+/helgrind/tests/bug327548
/helgrind/tests/bug392331
/helgrind/tests/cond_init_destroy
/helgrind/tests/cond_timedwait_invalid
are not entered into bugzilla tend to get forgotten about or ignored.
170510 Don't warn about ioctl of size 0 without direction hint
+327548 false positive while destroying mutex
351857 confusing error message about valid command line option
392331 Spurious lock not held error from inside pthread_cond_timedwait
400793 pthread_rwlock_timedwrlock false positive
if (mutex != NULL) {
static const pthread_mutex_t mutex_init = PTHREAD_MUTEX_INITIALIZER;
+ VALGRIND_HG_DISABLE_CHECKING(mutex, sizeof(*mutex));
mutex_is_init = my_memcmp(mutex, &mutex_init, sizeof(*mutex)) == 0;
+ VALGRIND_HG_ENABLE_CHECKING(mutex, sizeof(*mutex));
} else {
mutex_is_init = 0;
}
if (cond != NULL) {
const pthread_cond_t cond_init = PTHREAD_COND_INITIALIZER;
+ VALGRIND_HG_DISABLE_CHECKING(cond, sizeof(*cond));
cond_is_init = my_memcmp(cond, &cond_init, sizeof(*cond)) == 0;
+ VALGRIND_HG_ENABLE_CHECKING(cond, sizeof(*cond));
} else {
cond_is_init = 0;
}
annotate_smart_pointer.vgtest annotate_smart_pointer.stdout.exp \
annotate_smart_pointer.stderr.exp \
bug322621.vgtest bug322621.stderr.exp \
+ bug327548.vgtest bug327548.stderr.exp \
bug392331.vgtest bug392331.stdout.exp bug392331.stderr.exp \
bug392331_supp.vgtest bug392331_supp.stdout.exp bug392331_supp.stderr.exp \
bug392331.supp \
# should be conditionally compiled like tc20_verifywrap is.
check_PROGRAMS = \
annotate_hbefore \
+ bug327548 \
cond_init_destroy \
cond_timedwait_invalid \
cond_timedwait_test \
--- /dev/null
+#include <pthread.h>
+#include <stdio.h>
+#include <semaphore.h>
+
+sem_t sem;
+pthread_cond_t cond;
+pthread_mutex_t mutex;
+int finished;
+
+void *f(void *foo) {
+ while(1)
+ {
+ /* Wait for main() to have built mutex/cond */
+ sem_wait(&sem);
+
+ pthread_mutex_lock(&mutex);
+ finished = 1;
+ pthread_cond_signal(&cond);
+ pthread_mutex_unlock(&mutex);
+ }
+ return NULL;
+}
+
+int main(void) {
+ pthread_t t;
+ sem_init(&sem, 0, 0);
+ int count = 1000;
+
+ pthread_create(&t, NULL, f, NULL);
+
+ while (count--)
+ {
+ pthread_mutex_init(&mutex, NULL);
+ pthread_cond_init(&cond, NULL);
+
+ pthread_mutex_lock(&mutex);
+ /* Tell thread there is a new item to process */
+ sem_post(&sem);
+ while (!finished)
+ pthread_cond_wait(&cond, &mutex);
+ pthread_mutex_unlock(&mutex);
+
+ finished = 0;
+
+ pthread_cond_destroy(&cond);
+ pthread_mutex_destroy(&mutex);
+ }
+
+ return 0;
+}
--- /dev/null
+vgopts: -q
+prog: bug327548