|
From: <sv...@va...> - 2010-05-29 18:42:23
|
Author: bart
Date: 2010-05-29 19:42:14 +0100 (Sat, 29 May 2010)
New Revision: 11138
Log:
Added a regression test.
Added:
trunk/drd/tests/pth_uninitialized_cond.c
trunk/drd/tests/pth_uninitialized_cond.stderr.exp
trunk/drd/tests/pth_uninitialized_cond.vgtest
Modified:
trunk/drd/tests/
trunk/drd/tests/Makefile.am
Property changes on: trunk/drd/tests
___________________________________________________________________
Name: svn:ignore
- *.dSYM
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
annotate_barrier
annotate_hb_err
annotate_hb_race
annotate_ignore_rw
annotate_ignore_write
annotate_publish_hg
annotate_rwlock
annotate_smart_pointer
annotate_static
atomic_var
bar_bad
bar_trivial
boost_thread
bug-235681
circular_buffer
custom_alloc
drd_bitmap_test
fp_race
hg01_all_ok
hg02_deadlock
hg03_inherit
hg04_race
hg05_race2
hg06_readshared
hold_lock
linuxthreads_det
Makefile
Makefile.in
matinv
memory_allocation
monitor_example
new_delete
omp_matinv
omp_prime
omp_printf
pth_barrier
pth_barrier_race
pth_barrier_reinit
pth_broadcast
pth_cancel_locked
pth_cleanup_handler
pth_cond_race
pth_create_chain
pth_create_glibc_2_0
pth_detached
pth_detached_sem
pth_inconsistent_cond_wait
pth_mutex_reinit
pth_process_shared_mutex
pth_spinlock
qt4_atomic
qt4_mutex
qt4_rwlock
qt4_semaphore
recursive_mutex
rwlock_race
rwlock_test
rwlock_type_checking
sem_as_mutex
sem_open
sigalrm
tc01_simple_race
tc02_simple_tls
tc03_re_excl
tc04_free_lock
tc05_simple_race
tc06_two_races
tc07_hbl1
tc08_hbl2
tc09_bad_unlock
tc10_rec_lock
tc11_XCHG
tc12_rwl_trivial
tc13_laog1
tc15_laog_lockdel
tc16_byterace
tc17_sembar
tc18_semabuse
tc19_shadowmem
tc20_verifywrap
tc21_pthonce
tc22_exit_w_lock
tc23_bogus_condwait
tc24_nonzero_sem
thread_name
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
+ *.dSYM
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
annotate_barrier
annotate_hb_err
annotate_hb_race
annotate_ignore_rw
annotate_ignore_write
annotate_publish_hg
annotate_rwlock
annotate_smart_pointer
annotate_static
atomic_var
bar_bad
bar_trivial
boost_thread
bug-235681
circular_buffer
custom_alloc
drd_bitmap_test
fp_race
hg01_all_ok
hg02_deadlock
hg03_inherit
hg04_race
hg05_race2
hg06_readshared
hold_lock
linuxthreads_det
Makefile
Makefile.in
matinv
memory_allocation
monitor_example
new_delete
omp_matinv
omp_prime
omp_printf
pth_barrier
pth_barrier_race
pth_barrier_reinit
pth_broadcast
pth_cancel_locked
pth_cleanup_handler
pth_cond_race
pth_create_chain
pth_create_glibc_2_0
pth_detached
pth_detached_sem
pth_inconsistent_cond_wait
pth_mutex_reinit
pth_process_shared_mutex
pth_spinlock
pth_uninitialized_cond
qt4_atomic
qt4_mutex
qt4_rwlock
qt4_semaphore
recursive_mutex
rwlock_race
rwlock_test
rwlock_type_checking
sem_as_mutex
sem_open
sigalrm
tc01_simple_race
tc02_simple_tls
tc03_re_excl
tc04_free_lock
tc05_simple_race
tc06_two_races
tc07_hbl1
tc08_hbl2
tc09_bad_unlock
tc10_rec_lock
tc11_XCHG
tc12_rwl_trivial
tc13_laog1
tc15_laog_lockdel
tc16_byterace
tc17_sembar
tc18_semabuse
tc19_shadowmem
tc20_verifywrap
tc21_pthonce
tc22_exit_w_lock
tc23_bogus_condwait
tc24_nonzero_sem
thread_name
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
Modified: trunk/drd/tests/Makefile.am
===================================================================
--- trunk/drd/tests/Makefile.am 2010-05-29 06:44:28 UTC (rev 11137)
+++ trunk/drd/tests/Makefile.am 2010-05-29 18:42:14 UTC (rev 11138)
@@ -159,6 +159,8 @@
pth_process_shared_mutex.vgtest \
pth_spinlock.stderr.exp \
pth_spinlock.vgtest \
+ pth_uninitialized_cond.stderr.exp \
+ pth_uninitialized_cond.vgtest \
qt4_atomic.stderr.exp \
qt4_atomic.vgtest \
qt4_mutex.stderr.exp \
@@ -280,6 +282,7 @@
pth_inconsistent_cond_wait \
pth_mutex_reinit \
pth_process_shared_mutex \
+ pth_uninitialized_cond \
recursive_mutex \
rwlock_race \
rwlock_test \
Added: trunk/drd/tests/pth_uninitialized_cond.c
===================================================================
--- trunk/drd/tests/pth_uninitialized_cond.c (rev 0)
+++ trunk/drd/tests/pth_uninitialized_cond.c 2010-05-29 18:42:14 UTC (rev 11138)
@@ -0,0 +1,28 @@
+/* Test program to verify whether DRD only complains about uninitialized
+ * condition variables for dynamically allocated memory.
+ */
+
+
+#include <pthread.h>
+#include <stdio.h>
+
+
+static pthread_cond_t s_cond1 = PTHREAD_COND_INITIALIZER;
+static pthread_cond_t s_cond2 = PTHREAD_COND_INITIALIZER;
+
+
+int main(int argc, char** argv)
+{
+ fprintf(stderr, "Statically initialized condition variable.\n");
+
+ pthread_cond_signal(&s_cond1);
+
+ fprintf(stderr, "Uninitialized condition variable.\n");
+
+ *((char*)&s_cond2 + sizeof(s_cond2) - 1) ^= 1;
+ pthread_cond_signal(&s_cond2);
+
+ fprintf(stderr, "Done.\n");
+
+ return 0;
+}
Added: trunk/drd/tests/pth_uninitialized_cond.stderr.exp
===================================================================
--- trunk/drd/tests/pth_uninitialized_cond.stderr.exp (rev 0)
+++ trunk/drd/tests/pth_uninitialized_cond.stderr.exp 2010-05-29 18:42:14 UTC (rev 11138)
@@ -0,0 +1,10 @@
+
+Statically initialized condition variable.
+Uninitialized condition variable.
+condition variable has not been initialized: cond 0x........
+ at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+ by 0x........: main (pth_uninitialized_cond.c:?)
+
+Done.
+
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Added: trunk/drd/tests/pth_uninitialized_cond.vgtest
===================================================================
--- trunk/drd/tests/pth_uninitialized_cond.vgtest (rev 0)
+++ trunk/drd/tests/pth_uninitialized_cond.vgtest 2010-05-29 18:42:14 UTC (rev 11138)
@@ -0,0 +1,3 @@
+prereq: test -e pth_uninitialized_cond && ./supported_libpthread
+vgopts: --read-var-info=yes --check-stack-var=yes
+prog: pth_uninitialized_cond
|