From: Julian Seward Date: Mon, 10 Nov 2008 02:01:17 +0000 (+0000) Subject: Use a couple of reader-writer-lock tests from drd. X-Git-Tag: svn/VALGRIND_3_4_0~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4759767c7914e3c9d786b859d8f5f27c5f6ab6e;p=thirdparty%2Fvalgrind.git Use a couple of reader-writer-lock tests from drd. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8757 --- diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 6ef954ddf9..310b966324 100644 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -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 index 0000000000..c1852799e8 --- /dev/null +++ b/helgrind/tests/rwlock_race.stderr.exp-glibc25-amd64 @@ -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 index 0000000000..e69de29bb2 diff --git a/helgrind/tests/rwlock_race.vgtest b/helgrind/tests/rwlock_race.vgtest new file mode 100644 index 0000000000..00a15e7998 --- /dev/null +++ b/helgrind/tests/rwlock_race.vgtest @@ -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 index 0000000000..a7089bb434 --- /dev/null +++ b/helgrind/tests/rwlock_test.stderr.exp-glibc25-amd64 @@ -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 index 0000000000..e69de29bb2 diff --git a/helgrind/tests/rwlock_test.vgtest b/helgrind/tests/rwlock_test.vgtest new file mode 100644 index 0000000000..6ce0263266 --- /dev/null +++ b/helgrind/tests/rwlock_test.vgtest @@ -0,0 +1 @@ +prog: rwlock_test