]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use a couple of reader-writer-lock tests from drd.
authorJulian Seward <jseward@acm.org>
Mon, 10 Nov 2008 02:01:17 +0000 (02:01 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 10 Nov 2008 02:01:17 +0000 (02:01 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8757

helgrind/tests/Makefile.am
helgrind/tests/rwlock_race.stderr.exp-glibc25-amd64 [new file with mode: 0644]
helgrind/tests/rwlock_race.stdout.exp [new file with mode: 0644]
helgrind/tests/rwlock_race.vgtest [new file with mode: 0644]
helgrind/tests/rwlock_test.stderr.exp-glibc25-amd64 [new file with mode: 0644]
helgrind/tests/rwlock_test.stdout.exp [new file with mode: 0644]
helgrind/tests/rwlock_test.vgtest [new file with mode: 0644]

index 6ef954ddf91a11d09254d89bdb8d1e94da0e4a48..310b96632408aae83cb3defb3f13dfb2a9207025 100644 (file)
@@ -21,6 +21,10 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
                hg05_race2.stderr.exp-glibc25-x86 \
        hg06_readshared.vgtest hg06_readshared.stdout.exp \
                hg06_readshared.stderr.exp-glibc25-amd64 \
+       rwlock_race.vgtest rwlock_race.stdout.exp \
+               rwlock_race.stderr.exp-glibc25-amd64 \
+       rwlock_test.vgtest rwlock_test.stdout.exp \
+               rwlock_test.stderr.exp-glibc25-amd64 \
        tc01_simple_race.vgtest tc01_simple_race.stdout.exp \
                tc01_simple_race.stderr.exp-glibc25-amd64 \
                tc01_simple_race.stderr.exp-glibc25-x86 \
@@ -95,6 +99,8 @@ check_PROGRAMS = \
        hg04_race \
        hg05_race2 \
        hg06_readshared \
+       rwlock_race \
+       rwlock_test \
        tc01_simple_race \
        tc02_simple_tls \
        tc03_re_excl \
@@ -126,5 +132,8 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \
 
 # are these necessary?
 AM_CFLAGS      = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI)
-
 LDADD          = -lpthread
+
+# only needed because of referencing sources in drd/tests
+rwlock_race_SOURCES    = ../../drd/tests/rwlock_race.c
+rwlock_test_SOURCES    = ../../drd/tests/rwlock_test.c
diff --git a/helgrind/tests/rwlock_race.stderr.exp-glibc25-amd64 b/helgrind/tests/rwlock_race.stderr.exp-glibc25-amd64
new file mode 100644 (file)
index 0000000..c185279
--- /dev/null
@@ -0,0 +1,30 @@
+
+Thread #3 was created
+   at 0x........: clone (in /...libc...)
+   by 0x........: ...
+   by 0x........: pthread_create@GLIBC_ (in /lib/libpthread...)
+   by 0x........: pthread_create@* (hg_intercepts.c:...)
+   by 0x........: main (rwlock_race.c:48)
+
+Thread #2 was created
+   at 0x........: clone (in /...libc...)
+   by 0x........: ...
+   by 0x........: pthread_create@GLIBC_ (in /lib/libpthread...)
+   by 0x........: pthread_create@* (hg_intercepts.c:...)
+   by 0x........: main (rwlock_race.c:47)
+
+Possible data race during write of size 4 at 0x........ by thread #3
+   at 0x........: thread_func (rwlock_race.c:29)
+   by 0x........: mythread_wrapper (hg_intercepts.c:...)
+   by 0x........: ...
+   by 0x........: ...
+ This conflicts with a previous access by thread #2
+   at 0x........: thread_func (rwlock_race.c:29)
+   by 0x........: mythread_wrapper (hg_intercepts.c:...)
+   by 0x........: ...
+   by 0x........: ...
+ Location 0x........ is 0 bytes inside local var "s_racy"
+ declared at rwlock_race.c:18, in frame #0 of thread 3
+Result: 2
+
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
diff --git a/helgrind/tests/rwlock_race.stdout.exp b/helgrind/tests/rwlock_race.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/helgrind/tests/rwlock_race.vgtest b/helgrind/tests/rwlock_race.vgtest
new file mode 100644 (file)
index 0000000..00a15e7
--- /dev/null
@@ -0,0 +1 @@
+prog: rwlock_race
diff --git a/helgrind/tests/rwlock_test.stderr.exp-glibc25-amd64 b/helgrind/tests/rwlock_test.stderr.exp-glibc25-amd64
new file mode 100644 (file)
index 0000000..a7089bb
--- /dev/null
@@ -0,0 +1,4 @@
+
+Finished.
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/helgrind/tests/rwlock_test.stdout.exp b/helgrind/tests/rwlock_test.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/helgrind/tests/rwlock_test.vgtest b/helgrind/tests/rwlock_test.vgtest
new file mode 100644 (file)
index 0000000..6ce0263
--- /dev/null
@@ -0,0 +1 @@
+prog: rwlock_test