You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(10) |
2
(8) |
3
(17) |
4
(28) |
5
(22) |
6
(8) |
|
7
(8) |
8
(22) |
9
(12) |
10
(17) |
11
(14) |
12
(15) |
13
(6) |
|
14
(9) |
15
(9) |
16
(16) |
17
(13) |
18
(18) |
19
(7) |
20
(5) |
|
21
(6) |
22
(5) |
23
(11) |
24
(5) |
25
(11) |
26
(7) |
27
(15) |
|
28
(11) |
29
(12) |
30
(12) |
31
(15) |
|
|
|
|
From: Christoph B. <bar...@or...> - 2007-10-27 18:02:54
|
Am Samstag, 27. Oktober 2007 schrieb Julian Seward: > > thanks for your work on a helgrind replacement. Such a tool is a great > > help for us. > > Thanks for the feedback and test program. What version of glibc do > your test machines have? Both machines are opensuse 10.2 i386: GNU C Library stable release version 2.5 (20061011), by Roland McGrath et al. x86_64: GNU C Library stable release version 2.5 (20061011), by Roland McGrath et al. > > 1. The concurrent writes on line 72 are not protected by a mutex > > (uncommented above and below). Thrcheck does not flag this error on my > > i386 and x86_64 machines. > > This appears to be scheduling-sensitive. For both i386 and x86_64 (Core 2 > Duo) I get an error here maybe for every 1 run in 4: You are right. After running the test program several times I also see the error here. > > 3. The x86_64 version only shows that one thread is started. Threads 3 -- > > 9 are not shown. > > I presume you mean you only get one message of the form > > Thread #3 was created > at 0x586748E: clone (in /lib64/libc-2.5.so) > by 0x4E2F305: do_clone (in /lib64/libpthread-2.5.so) > by 0x4E2F7C5: pthread_create@@GLIBC_2.2.5 (in > /lib64/libpthread-2.5.so) by 0x4C23864: pthread_create@* > (tc_intercepts.c:190) > > These message are not printed when a thread starts - that would be > impractical for a program with many threads. They are printed on demand > so as to make later error messages make sense. Specifically, if it > produces a race message containing this: > > Possible data race during [...] > Old state: shared-readonly by threads #3, #6 > New state: shared-modified by threads #3, #6 > > then it will first print out a "Thread #3 was created at" message, and a > "Thread #6 was created at" message, so you can make sense of the race > message. Ok, now I understand that the number of messages varies between different runs. Is there some documentation on the algorithm that thrcheck uses? Greetings Christoph |
|
From: Julian S. <js...@ac...> - 2007-10-27 17:26:51
|
> thanks for your work on a helgrind replacement. Such a tool is a great help
> for us.
Thanks for the feedback and test program. What version of glibc do
your test machines have?
> 1. The concurrent writes on line 72 are not protected by a mutex
> (uncommented above and below). Thrcheck does not flag this error on my i386
> and x86_64 machines.
This appears to be scheduling-sensitive. For both i386 and x86_64 (Core 2
Duo) I get an error here maybe for every 1 run in 4:
Created counter at address: 0x62e9b20
[...]
Possible data race during write of size 4 at 0x62E9B20
at 0x401315: Loop::run() (bartothread.cpp:72)
by 0x400F7B: start (bartothread.cpp:44)
by 0x4C25DEB: mythread_wrapper (tc_intercepts.c:170)
by 0x4E2F09D: start_thread (in /lib64/libpthread-2.5.so)
by 0x58674CC: clone (in /lib64/libc-2.5.so)
Old state: shared-readonly by threads #3, #4
New state: shared-modified by threads #3, #4
Reason: this thread, #3, holds no consistent locks
Location 0x62E9B20 has never been protected by any lock
Unfortunate that the error-detection is scheduling-sensitive. Given the
use of pthread_cond_* that is difficult to avoid.
> 2. There is no race-condition for the writes in line 92. However the i386
> version of thrcheck flags an error here.
Yes .. also the x86_64 version flags an error. I'll look into it.
> 3. The x86_64 version only shows that one thread is started. Threads 3 -- 9
> are not shown.
I presume you mean you only get one message of the form
Thread #3 was created
at 0x586748E: clone (in /lib64/libc-2.5.so)
by 0x4E2F305: do_clone (in /lib64/libpthread-2.5.so)
by 0x4E2F7C5: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.5.so)
by 0x4C23864: pthread_create@* (tc_intercepts.c:190)
These message are not printed when a thread starts - that would be
impractical for a program with many threads. They are printed on demand
so as to make later error messages make sense. Specifically, if it
produces a race message containing this:
Possible data race during [...]
Old state: shared-readonly by threads #3, #6
New state: shared-modified by threads #3, #6
then it will first print out a "Thread #3 was created at" message, and a
"Thread #6 was created at" message, so you can make sense of the race message.
> 4. The i386 version flags a possible race condition in line 41. In my
> opinion there is none.
I agree. You should ignore all race errors reported inside any
pthread_* function and inside ld.so. I tried to suppress them, but clearly
there is more work to do there.
J
|
|
From: Christoph B. <bar...@or...> - 2007-10-27 12:20:29
|
Hi, thanks for your work on a helgrind replacement. Such a tool is a great help for us. I have tested thrcheck from revision 7044 with the attached program. Here are some problems I found: 1. The concurrent writes on line 72 are not protected by a mutex (uncommented above and below). Thrcheck does not flag this error on my i386 and x86_64 machines. 2. There is no race-condition for the writes in line 92. However the i386 version of thrcheck flags an error here. 3. The x86_64 version only shows that one thread is started. Threads 3 -- 9 are not shown. 4. The i386 version flags a possible race condition in line 41. In my opinion there is none. Greetings Christoph |
|
From: Tom H. <th...@cy...> - 2007-10-27 02:31:08
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-10-27 03:15:02 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 260 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2007-10-27 02:24:52
|
Author: sewardj Date: 2007-10-27 03:24:52 +0100 (Sat, 27 Oct 2007) New Revision: 7044 Log: Followup to r7043: rename all the .stderr.exp files for this tool to be .stderr.exp-glibc25-amd64. Added: branches/THRCHECK/thrcheck/tests/hg01_all_ok.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/hg06_readshared.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc02_simple_tls.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc03_re_excl.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc04_free_lock.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc07_hbl1.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc08_hbl2.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc09_bad_unlock.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc11_XCHG.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp-glibc25-amd64 branches/THRCHECK/thrcheck/tests/tc19_shadowmem.stderr.exp-glibc25-amd64 Removed: branches/THRCHECK/thrcheck/tests/hg01_all_ok.stderr.exp branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp branches/THRCHECK/thrcheck/tests/hg06_readshared.stderr.exp branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp branches/THRCHECK/thrcheck/tests/tc02_simple_tls.stderr.exp branches/THRCHECK/thrcheck/tests/tc03_re_excl.stderr.exp branches/THRCHECK/thrcheck/tests/tc04_free_lock.stderr.exp branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp branches/THRCHECK/thrcheck/tests/tc07_hbl1.stderr.exp branches/THRCHECK/thrcheck/tests/tc08_hbl2.stderr.exp branches/THRCHECK/thrcheck/tests/tc09_bad_unlock.stderr.exp branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp branches/THRCHECK/thrcheck/tests/tc11_XCHG.stderr.exp branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp branches/THRCHECK/thrcheck/tests/tc19_shadowmem.stderr.exp Modified: branches/THRCHECK/thrcheck/tests/Makefile.am [... diff too large to include ...] |
|
From: Tom H. <th...@cy...> - 2007-10-27 02:23:52
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-10-27 03:05:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-27 02:23:34
|
Nightly build on dellow ( x86_64, Fedora 7 ) started at 2007-10-27 03:10:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) |
|
From: <sv...@va...> - 2007-10-27 02:23:10
|
Author: sewardj
Date: 2007-10-27 03:23:10 +0100 (Sat, 27 Oct 2007)
New Revision: 7043
Log:
Allow a test to have any number of .stderr.exp* files, so long as at
least one is found. In fact the comments in the code that claimed
that .stderr.exp[0-9] are the only ones allowed were misleading;
.stderr.exp* has always been allowed. The only functional change here
is to mandate that at least one such file exists; prior to the change
the script mandated that at least a .stderr.exp (with no other suffix)
file existed.
Purpose is to allow collections of .stderr.exp files with suffixes
arranged in some meaningful way, eg, foo.stderr.exp-glibc25-amd64.
This might help in making testsuites more maintainable when there
have to be multiple .stderr.exp files. Naming them merely as
.stderr.exp1, .stderr.exp2, etc, makes it impossible to remember
what the differences between the files actually is.
Modified:
branches/THRCHECK/tests/vg_regtest.in
Modified: branches/THRCHECK/tests/vg_regtest.in
===================================================================
--- branches/THRCHECK/tests/vg_regtest.in 2007-10-27 02:00:42 UTC (rev 7042)
+++ branches/THRCHECK/tests/vg_regtest.in 2007-10-27 02:23:10 UTC (rev 7043)
@@ -63,7 +63,8 @@
#
# Expected stdout (filtered) is kept in <test>.stdout.exp[0-9]* (can be more
# than one expected output). It can be missing if it would be empty. Expected
-# stderr (filtered) is kept in <test>.stderr.exp[0-9]*.
+# stderr (filtered) is kept in <test>.stderr.exp*. There must be at least
+# one stderr.exp* file.
#
# The prerequisite command, if present, must return 0 otherwise the test is
# skipped. The post-test command, if present, must return 0 and its stdout
@@ -326,9 +327,9 @@
# Filter stderr
mysystem("$stderr_filter < $name.stderr.out > $tmp");
rename($tmp, "$name.stderr.out");
- # Find all the .stderr.exp files. $name.stderr.exp must exist.
+ # Find all the .stderr.exp files. At least one must exist.
my @stderr_exps = <$name.stderr.exp*>;
- (-r "$name.stderr.exp") or die "Could not read `$name.stderr.exp'\n";
+ (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
do_diffs($fullname, $name, "stderr", \@stderr_exps);
# Maybe do post-test check
|
|
From: Tom H. <th...@cy...> - 2007-10-27 02:10:57
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-10-27 03:00:02 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 295 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2007-10-27 02:00:40
|
Author: sewardj Date: 2007-10-27 03:00:42 +0100 (Sat, 27 Oct 2007) New Revision: 7042 Log: Normalise the @@GLIBC_version bits of symbols more aggressively. Modified: branches/THRCHECK/thrcheck/tests/filter_stderr branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp branches/THRCHECK/thrcheck/tests/tc09_bad_unlock.stderr.exp branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp branches/THRCHECK/thrcheck/tests/tc19_shadowmem.stderr.exp [... diff too large to include ...] |
|
From: <sv...@va...> - 2007-10-27 00:22:04
|
Author: sewardj
Date: 2007-10-27 01:22:03 +0100 (Sat, 27 Oct 2007)
New Revision: 7041
Log:
Update expected outputs.
Modified:
branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp
branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp
branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp
branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp
branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp
branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp
branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp
branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp
branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp
branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp
branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp
branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp
Modified: branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/hg02_deadlock.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -6,11 +6,23 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (hg02_deadlock.c:36)
-Thread #3: Lock acquisition order is inconsistent with previously observed ordering
+Thread #3: lock order "0x........ before 0x........" violated
at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
by 0x........: t2 (hg02_deadlock.c:20)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
by 0x........: ...
+ Required order was established by acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: t1 (hg02_deadlock.c:9)
+ by 0x........: mythread_wrapper (tc_intercepts.c:...)
+ by 0x........: ...
+ by 0x........: ...
+ followed by a later acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: t1 (hg02_deadlock.c:10)
+ by 0x........: mythread_wrapper (tc_intercepts.c:...)
+ by 0x........: ...
+ by 0x........: ...
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/hg03_inherit.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -8,7 +8,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (hg03_inherit.c:46)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: t2 (hg03_inherit.c:28)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
Modified: branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/hg04_race.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -13,7 +13,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (hg04_race.c:21)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: th (hg04_race.c:10)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
Modified: branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/hg05_race2.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -13,7 +13,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (hg05_race2.c:29)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: th (hg05_race2.c:17)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
Modified: branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc01_simple_race.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -8,7 +8,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (tc01_simple_race.c:22)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: main (tc01_simple_race.c:28)
Old state: shared-readonly by threads #1, #2
New state: shared-modified by threads #1, #2
Modified: branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc05_simple_race.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -8,7 +8,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (tc05_simple_race.c:27)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: main (tc05_simple_race.c:33)
Old state: shared-readonly by threads #1, #2
New state: shared-modified by threads #1, #2
Modified: branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc06_two_races.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -8,14 +8,14 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (tc06_two_races.c:26)
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: main (tc06_two_races.c:31)
Old state: shared-readonly by threads #1, #2
New state: shared-modified by threads #1, #2
Reason: this thread, #1, holds no consistent locks
Location 0x........ has never been protected by any lock
-Possible data race during write to 0x........
+Possible data race during write of size 4 at 0x........
at 0x........: main (tc06_two_races.c:35)
Old state: shared-readonly by threads #1, #2
New state: shared-modified by threads #1, #2
Modified: branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc13_laog1.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -1,8 +1,14 @@
Thread #1 is the program's root thread
-Thread #1: Lock acquisition order is inconsistent with previously observed ordering
+Thread #1: lock order "0x........ before 0x........" violated
at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
by 0x........: main (tc13_laog1.c:24)
+ Required order was established by acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: main (tc13_laog1.c:17)
+ followed by a later acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: main (tc13_laog1.c:18)
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc14_laog_dinphils.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -6,11 +6,23 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (tc14_laog_dinphils.c:34)
-Thread #6: Lock acquisition order is inconsistent with previously observed ordering
+Thread #6: lock order "0x........ before 0x........" violated
at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
by 0x........: dine (tc14_laog_dinphils.c:19)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
by 0x........: ...
+ Required order was established by acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: dine (tc14_laog_dinphils.c:18)
+ by 0x........: mythread_wrapper (tc_intercepts.c:...)
+ by 0x........: ...
+ by 0x........: ...
+ followed by a later acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: dine (tc14_laog_dinphils.c:19)
+ by 0x........: mythread_wrapper (tc_intercepts.c:...)
+ by 0x........: ...
+ by 0x........: ...
ERROR SUMMARY: 1000 errors from 1 contexts (suppressed: 0 from 0)
Modified: branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc15_laog_lockdel.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -3,9 +3,15 @@
Try order 2 -> 1. This gives an error.
Thread #1 is the program's root thread
-Thread #1: Lock acquisition order is inconsistent with previously observed ordering
+Thread #1: lock order "0x........ before 0x........" violated
at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
by 0x........: main (tc15_laog_lockdel.c:36)
+ Required order was established by acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: main (tc15_laog_lockdel.c:27)
+ followed by a later acquisition of lock at 0x........
+ at 0x........: pthread_mutex_lock (tc_intercepts.c:...)
+ by 0x........: main (tc15_laog_lockdel.c:28)
Free 2 and re-allocate it. This gives it a new identity,
so a second locking sequence 2 -> 1 should now be OK.
done
Modified: branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -8,7 +8,7 @@
by 0x........: pthread_create@* (tc_intercepts.c:...)
by 0x........: main (tc16_byterace.c:22)
-Possible data race during write to 0x........
+Possible data race during write of size 1 at 0x........
at 0x........: main (tc16_byterace.c:34)
Old state: shared-readonly by threads #1, #2
New state: shared-modified by threads #1, #2
Modified: branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp 2007-10-27 00:09:25 UTC (rev 7040)
+++ branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp 2007-10-27 00:22:03 UTC (rev 7041)
@@ -5,32 +5,32 @@
by 0x........: ...
by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
by 0x........: pthread_create@* (tc_intercepts.c:...)
- by 0x........: main (tc17_sembar.c:164)
+ by 0x........: main (tc17_sembar.c:195)
Thread #3 was created
at 0x........: clone (in /...libc...)
by 0x........: ...
by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
by 0x........: pthread_create@* (tc_intercepts.c:...)
- by 0x........: main (tc17_sembar.c:164)
+ by 0x........: main (tc17_sembar.c:195)
Thread #4 was created
at 0x........: clone (in /...libc...)
by 0x........: ...
by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
by 0x........: pthread_create@* (tc_intercepts.c:...)
- by 0x........: main (tc17_sembar.c:164)
+ by 0x........: main (tc17_sembar.c:195)
Thread #5 was created
at 0x........: clone (in /...libc...)
by 0x........: ...
by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
by 0x........: pthread_create@* (tc_intercepts.c:...)
- by 0x........: main (tc17_sembar.c:164)
+ by 0x........: main (tc17_sembar.c:195)
Possible data race during read of size 4 at 0x........
at 0x........: gomp_barrier_wait (tc17_sembar.c:122)
- by 0x........: child (tc17_sembar.c:140)
+ by 0x........: child (tc17_sembar.c:161)
by 0x........: mythread_wrapper (tc_intercepts.c:...)
by 0x........: ...
by 0x........: ...
@@ -40,7 +40,7 @@
Last consistently used lock for 0x........ was first observed
at 0x........: pthread_mutex_init (tc_intercepts.c:...)
by 0x........: gomp_barrier_init (tc17_sembar.c:46)
- by 0x........: main (tc17_sembar.c:161)
-done
+ by 0x........: main (tc17_sembar.c:192)
+done, result is 88, should be 88
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
|
|
From: <js...@ac...> - 2007-10-27 00:16:43
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-10-27 02:00:01 CEST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 228 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2007-10-27 00:09:25
|
Author: sewardj
Date: 2007-10-27 01:09:25 +0100 (Sat, 27 Oct 2007)
New Revision: 7040
Log:
Update.
Modified:
branches/THRCHECK/glibc-2.X-thrcheck.supp
Modified: branches/THRCHECK/glibc-2.X-thrcheck.supp
===================================================================
--- branches/THRCHECK/glibc-2.X-thrcheck.supp 2007-10-27 00:08:54 UTC (rev 7039)
+++ branches/THRCHECK/glibc-2.X-thrcheck.supp 2007-10-27 00:09:25 UTC (rev 7040)
@@ -70,45 +70,81 @@
fun:pthread_join
}
-#z###--- IO_file ---###
-#z{
-#z thrcheck-glibc2X-IOfile-1
-#z Thrcheck:Race
-#z fun:_IO_file_xsputn*
-#z fun:vfprintf
-#z fun:*printf
-#z}
-#z{
-#z thrcheck-glibc2X-IOfile-2
-#z Thrcheck:Race
-#z fun:_IO_file_overflow*
-#z fun:_IO_file_xsputn*
-#z fun:*printf
-#z}
-#z{
-#z thrcheck-glibc2X-IOfile-3
-#z Thrcheck:Race
-#z fun:new_do_write
-#z fun:_IO_do_write*
-#z fun:_IO_file_xsputn*
-#z fun:*printf
-#z}
-#z{
-#z thrcheck-glibc2X-IOfile-4
-#z Thrcheck:Race
-#z fun:new_do_write
-#z fun:_IO_file_xsputn*
-#z fun:*printf
-#z}
-#z{
-#z thrcheck-glibc2X-IOfile-5
-#z Thrcheck:Race
-#z fun:new_do_write
-#z fun:_IO_do_write*
-#z fun:_IO_file_overflow*
-#z fun:_IO_file_xsputn*
-#z}
-#z
+###--- IO_file ---###
+# I'm pretty sure these are because Thrcheck cannot see
+# glibc's acquisition/releasing of locks for stdio.
+{
+ thrcheck-glibc2X-IOfile-1
+ Thrcheck:Race
+ fun:_IO_file_xsputn*
+ fun:*vfprintf
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-2
+ Thrcheck:Race
+ fun:vfprintf
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-3
+ Thrcheck:Race
+ fun:mempcpy
+ fun:vfprintf
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-4
+ Thrcheck:Race
+ fun:buffered_vfprintf
+ fun:vfprintf
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-5
+ Thrcheck:Race
+ fun:new_do_write
+ fun:_IO_do_write*
+ fun:_IO_file_xsputn*
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-6
+ Thrcheck:Race
+ fun:mempcpy
+ fun:_IO_file_xsputn*
+ fun:*printf
+}
+{
+ thrcheck-glibc2X-IOfile-7
+ Thrcheck:Race
+ fun:new_do_write
+ fun:_IO_do_write*
+ fun:_IO_file_overflow*
+ fun:_IO_file_xsputn*
+}
+{
+ thrcheck-glibc2X-IOfile-8
+ Thrcheck:Race
+ fun:_IO_file_overflow*
+ fun:_IO_file_xsputn*
+ fun:*fprintf
+}
+{
+ thrcheck-glibc2X-IOfile-9
+ Thrcheck:Race
+ fun:new_do_write
+ fun:_IO_file_xsputn*
+ fun:*vfprintf
+}
+{
+ thrcheck-glibc2X-IOfile-10
+ Thrcheck:Race
+ fun:__lll_mutex_unlock_wake
+ fun:*printf
+}
+
+
#z###--- thread creation ---###
#z{
#z thrcheck-glibc2X-creation-1
@@ -256,6 +292,14 @@
fun:pthread_cond_timedwait@@GLIBC_*
}
+###--- pthread_rwlock_*lock ---###
+# ditto
+{
+ thrcheck-glibc2X-pthrwlock{rd,wr,un}lock-1
+ Thrcheck:Race
+ fun:pthread_rwlock_*lock
+}
+
###--- libpthread internal stuff ---###
{
thrcheck-glibc2X-libpthread-1
|
|
From: <sv...@va...> - 2007-10-27 00:08:51
|
Author: sewardj Date: 2007-10-27 01:08:54 +0100 (Sat, 27 Oct 2007) New Revision: 7039 Log: Build with -fomit-frame-pointer on x86. Modified: branches/THRCHECK/thrcheck/Makefile.am Modified: branches/THRCHECK/thrcheck/Makefile.am =================================================================== --- branches/THRCHECK/thrcheck/Makefile.am 2007-10-27 00:08:12 UTC (rev 7038) +++ branches/THRCHECK/thrcheck/Makefile.am 2007-10-27 00:08:54 UTC (rev 7039) @@ -23,7 +23,8 @@ VGPRELOAD_THRCHECK_SOURCES_COMMON = tc_intercepts.c vgpreload_thrcheck_x86_linux_so_SOURCES = $(VGPRELOAD_THRCHECK_SOURCES_COMMON) -vgpreload_thrcheck_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) +vgpreload_thrcheck_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) \ + -fno-omit-frame-pointer vgpreload_thrcheck_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) vgpreload_thrcheck_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) vgpreload_thrcheck_x86_linux_so_LDFLAGS = \ @@ -74,7 +75,7 @@ thrcheck_x86_linux_SOURCES = $(THRCHECK_SOURCES_COMMON) thrcheck_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -thrcheck_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) +thrcheck_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -fomit-frame-pointer thrcheck_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) thrcheck_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) thrcheck_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) @@ -119,10 +120,3 @@ tcinclude_HEADERS = thrcheck.h noinst_HEADERS = tc_wordfm.h tc_wordset.h - -tc_intercepts.o: CFLAGS += -fno-omit-frame-pointer - -# later -# tc_main.o: CFLAGS += -fomit-frame-pointer -# tc_wordfm.o: CFLAGS += -fomit-frame-pointer -# tc_wordset.o: CFLAGS += -fomit-frame-pointer |
|
From: <sv...@va...> - 2007-10-27 00:08:13
|
Author: sewardj
Date: 2007-10-27 01:08:12 +0100 (Sat, 27 Oct 2007)
New Revision: 7038
Log:
This should have been included in r7035.
Modified:
branches/THRCHECK/thrcheck/thrcheck.h
Modified: branches/THRCHECK/thrcheck/thrcheck.h
===================================================================
--- branches/THRCHECK/thrcheck/thrcheck.h 2007-10-26 14:58:54 UTC (rev 7037)
+++ branches/THRCHECK/thrcheck/thrcheck.h 2007-10-27 00:08:12 UTC (rev 7038)
@@ -90,7 +90,8 @@
_VG_USERREQ__TC_PTHREAD_RWLOCK_UNLOCK_POST, // pth_rwlk_t*
_VG_USERREQ__TC_POSIX_SEMPOST_PRE, // sem_t*
_VG_USERREQ__TC_POSIX_SEMWAIT_POST, // sem_t*
- _VG_USERREQ__TC_POSIX_SEM_ZAPSTACK // sem_t*
+ _VG_USERREQ__TC_POSIX_SEM_ZAPSTACK, // sem_t*
+ _VG_USERREQ__TC_GET_MY_SEGMENT // -> Segment*
} Vg_TCheckClientRequest;
/* Clean memory state. This makes Thrcheck forget everything it knew
|
|
From: <sv...@va...> - 2007-10-26 14:58:56
|
Author: sewardj Date: 2007-10-26 15:58:54 +0100 (Fri, 26 Oct 2007) New Revision: 7037 Log: Add a (fairly extensive) test that shadow memory actually works reasonably correctly at all sizes and (mis)alignments. Added: branches/THRCHECK/thrcheck/tests/tc19_shadowmem.c branches/THRCHECK/thrcheck/tests/tc19_shadowmem.stderr.exp branches/THRCHECK/thrcheck/tests/tc19_shadowmem.stdout.exp branches/THRCHECK/thrcheck/tests/tc19_shadowmem.vgtest Modified: branches/THRCHECK/thrcheck/tests/Makefile.am [... diff too large to include ...] |
|
From: <sv...@va...> - 2007-10-26 10:45:03
|
Author: sewardj
Date: 2007-10-26 11:44:38 +0100 (Fri, 26 Oct 2007)
New Revision: 7036
Log:
Change this test so it actually tests happens-before tracking through
the barrier functions. Also add references to discussions on thread
safeness (or lack of) in gcc's generated code. Finally a spelling fix
from Reuben Thomas.
Modified:
branches/THRCHECK/thrcheck/tests/tc17_sembar.c
Modified: branches/THRCHECK/thrcheck/tests/tc17_sembar.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc17_sembar.c 2007-10-25 23:12:48 UTC (rev 7035)
+++ branches/THRCHECK/thrcheck/tests/tc17_sembar.c 2007-10-26 10:44:38 UTC (rev 7036)
@@ -103,7 +103,7 @@
sem_wait (&bar->sem2); // 2 down
}
pthread_mutex_unlock (&bar->mutex1);
- /* Resultat professionnel! First we made this thread have an
+ /* «Résultats professionnels!» First we made this thread have an
obvious (Thrcheck-visible) dependency on all other threads
calling gomp_barrier_wait. Then, we released them all again,
so they all have a (visible) dependency on this thread.
@@ -133,46 +133,80 @@
are arriving at the barrier and by mutex2 whilst they are leaving,
but not consistently by either of them. Oh well. */
-gomp_barrier_t bar;
+static gomp_barrier_t bar;
+/* What's with the volatile here? It stops gcc compiling
+ "if (myid == 4) { unprotected = 99; }" and
+ "if (myid == 3) { unprotected = 88; }" into a conditional
+ load followed by a store. The cmov/store sequence reads and
+ writes memory in all threads and cause Thrcheck to (correctly)
+ report a race, the underlying cause of which is that gcc is
+ generating non threadsafe code.
+
+ (The lack of) thread safe code generation by gcc is currently a
+ hot topic. See the following discussions:
+ http://gcc.gnu.org/ml/gcc/2007-10/msg00266.html
+ http://lkml.org/lkml/2007/10/24/673
+ and this is interesting background:
+ www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf
+*/
+volatile static long unprotected = 0;
+
void* child ( void* argV )
{
+ long myid = (long)argV;
+ // assert(myid >= 2 && myid <= 5);
+
+ /* First, we all wait to get to this point. */
gomp_barrier_wait( &bar );
+
+ /* Now, thread #4 writes to 'unprotected' and so becomes its
+ owner. */
+ if (myid == 4) {
+ unprotected = 99;
+ }
+
+ /* Now we all wait again. */
gomp_barrier_wait( &bar );
+
+ /* This time, thread #3 writes to 'unprotected'. If all goes well,
+ Thrcheck sees the dependency through the barrier back to thread
+ #4 before it, and so thread #3 becomes the exclusive owner of
+ 'unprotected'. */
+ if (myid == 3) {
+ unprotected = 88;
+ }
+
+ /* And just to be on the safe side ... */
gomp_barrier_wait( &bar );
- gomp_barrier_wait( &bar );
- gomp_barrier_wait( &bar );
- gomp_barrier_wait( &bar );
- gomp_barrier_wait( &bar );
- gomp_barrier_wait( &bar );
return NULL;
}
-#define NNN 4
int main (int argc, char *argv[])
{
- int j;
long i; int res;
- pthread_t thr[NNN];
+ pthread_t thr[4];
fprintf(stderr, "starting\n");
- for (j = 0; j < 1; j++) {
- gomp_barrier_init( &bar, NNN );
+ gomp_barrier_init( &bar, 4 );
- for (i = 0; i < NNN; i++) {
- res = pthread_create( &thr[i], NULL, child, (void*)i );
+ for (i = 0; i < 4; i++) {
+ res = pthread_create( &thr[i], NULL, child, (void*)(i+2) );
assert(!res);
}
- for (i = 0; i < NNN; i++) {
+ for (i = 0; i < 4; i++) {
res = pthread_join( thr[i], NULL );
assert(!res);
}
gomp_barrier_destroy( &bar );
- }
- fprintf(stderr, "done\n");
+ /* And finally here, the root thread can get exclusive ownership
+ back from thread #4, because #4 has exited by this point and so
+ we have a dependency edge back to the write it did. */
+ fprintf(stderr, "done, result is %ld, should be 88\n", unprotected);
+
return 0;
}
|
|
From: Tom H. <th...@cy...> - 2007-10-26 02:31:25
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-10-26 03:15:02 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 260 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-26 02:24:09
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-10-26 03:05:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-26 02:23:29
|
Nightly build on dellow ( x86_64, Fedora 7 ) started at 2007-10-26 03:10:03 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri Oct 26 03:16:52 2007 --- new.short Fri Oct 26 03:23:33 2007 *************** *** 8,10 **** ! == 293 tests, 4 stderr failures, 3 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) *************** *** 15,17 **** none/tests/mremap2 (stdout) - none/tests/pth_detached (stdout) --- 15,16 ---- |
|
From: Tom H. <th...@cy...> - 2007-10-26 02:15:46
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-10-26 03:00:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 295 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <js...@ac...> - 2007-10-26 00:17:57
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-10-26 02:00:01 CEST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 228 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2007-10-25 23:12:50
|
Author: sewardj
Date: 2007-10-26 00:12:48 +0100 (Fri, 26 Oct 2007)
New Revision: 7035
Log:
* enhanced VCG output for happens-before graph
* fix assertion failure shown up by tc18_semabuse.c
Modified:
branches/THRCHECK/thrcheck/tc_main.c
Modified: branches/THRCHECK/thrcheck/tc_main.c
===================================================================
--- branches/THRCHECK/thrcheck/tc_main.c 2007-10-25 17:39:42 UTC (rev 7034)
+++ branches/THRCHECK/thrcheck/tc_main.c 2007-10-25 23:12:48 UTC (rev 7035)
@@ -117,8 +117,9 @@
// 2 = as 1 + segments at condition variable signal/broadcast/wait too
static Int clo_happens_before = 2; /* default setting */
-/* Generate .vcg output of the happens-before graph? */
-static Bool clo_gen_vcg = False;
+/* Generate .vcg output of the happens-before graph?
+ 0: no 1: yes, without VTSs 2: yes, with VTSs */
+static Int clo_gen_vcg = 0;
/* When comparing race errors for equality, should the race address be
taken into account? For users, no, but for verification purposes
@@ -2118,10 +2119,14 @@
VG_(printf)("Thr# %d", seg->thr->errmsg_index);
}
- show_VTS( vtsstr, sizeof(vtsstr)-1, seg->vts );
- vtsstr[sizeof(vtsstr)-1] = 0;
+ if (clo_gen_vcg >= 2) {
+ show_VTS( vtsstr, sizeof(vtsstr)-1, seg->vts );
+ vtsstr[sizeof(vtsstr)-1] = 0;
+ VG_(printf)("\\n%s", vtsstr);
+ }
- VG_(printf)("\\n%s\" }\n", vtsstr);
+ VG_(printf)("\" }\n", vtsstr);
+
if (seg->prev)
VG_(printf)(PFX "edge: { sourcename: \"%p\" targetname: \"%p\""
"color: black }\n", seg->prev, seg );
@@ -5863,9 +5868,13 @@
} else {
/* Hmm. How can a wait on 'cond' succeed if nobody signalled
it? If this happened it would surely be a bug in the
- threads library. */
- // FIXME
- tl_assert(0);
+ threads library. Or one of those fabled "spurious
+ wakeups". */
+ record_error_Misc( thr, "Bug in libpthread: pthread_cond_wait "
+ "succeeded on"
+ " without prior pthread_cond_post");
+ tl_assert(new_seg->prev->vts);
+ new_seg->vts = tick_VTS( new_seg->thr, new_seg->prev->vts );
}
}
}
@@ -6179,6 +6188,8 @@
threads library. */
record_error_Misc( thr, "Bug in libpthread: sem_wait succeeded on"
" semaphore without prior sem_post");
+ tl_assert(new_seg->prev->vts);
+ new_seg->vts = tick_VTS( new_seg->thr, new_seg->prev->vts );
}
}
}
@@ -7169,6 +7180,20 @@
evh__TC_POSIX_SEM_ZAPSTACK( tid, (void*)args[1] );
break;
+ case _VG_USERREQ__TC_GET_MY_SEGMENT: { // -> Segment*
+ Thread* thr;
+ SegmentID segid;
+ Segment* seg;
+ thr = map_threads_maybe_lookup( tid );
+ tl_assert(thr); /* cannot fail */
+ segid = thr->csegid;
+ tl_assert(is_sane_SegmentID(segid));
+ seg = map_segments_lookup( segid );
+ tl_assert(seg);
+ *ret = (UWord)seg;
+ break;
+ }
+
default:
/* Unhandled Thrcheck client request! */
tl_assert2(0, "unhandled Thrcheck client request!");
@@ -7954,9 +7979,11 @@
clo_happens_before = 2;
else if (VG_CLO_STREQ(arg, "--gen-vcg=no"))
- clo_gen_vcg = False;
+ clo_gen_vcg = 0;
else if (VG_CLO_STREQ(arg, "--gen-vcg=yes"))
- clo_gen_vcg = True;
+ clo_gen_vcg = 1;
+ else if (VG_CLO_STREQ(arg, "--gen-vcg=yes-w-vts"))
+ clo_gen_vcg = 2;
else if (VG_CLO_STREQ(arg, "--cmp-race-err-addrs=no"))
clo_cmp_race_err_addrs = False;
@@ -7981,7 +8008,7 @@
static void tc_print_debug_usage ( void )
{
VG_(replacement_malloc_print_debug_usage)();
- VG_(printf)(" --gen-vcg=no|yes show happens-before graph "
+ VG_(printf)(" --gen-vcg=no|yes|yes-w-vts show happens-before graph "
"in .vcg format [no]\n");
VG_(printf)(" --cmp-race-err-addrs=no|yes are data addresses in "
"race errors significant? [no]\n");
@@ -7998,7 +8025,7 @@
if (sanity_flags)
all__sanity_check("SK_(fini)");
- if (clo_gen_vcg)
+ if (clo_gen_vcg > 0)
segments__generate_vcg();
if (VG_(clo_verbosity) >= 2) {
|
|
From: <sv...@va...> - 2007-10-25 17:39:41
|
Author: sewardj
Date: 2007-10-25 18:39:42 +0100 (Thu, 25 Oct 2007)
New Revision: 7034
Log:
Add a (pretty lame) test re doing stupid things with semaphores.
Added:
branches/THRCHECK/thrcheck/tests/tc18_semabuse.c
branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp
branches/THRCHECK/thrcheck/tests/tc18_semabuse.stdout.exp
branches/THRCHECK/thrcheck/tests/tc18_semabuse.vgtest
Modified:
branches/THRCHECK/thrcheck/tests/Makefile.am
Modified: branches/THRCHECK/thrcheck/tests/Makefile.am
===================================================================
--- branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-25 16:59:14 UTC (rev 7033)
+++ branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-25 17:39:42 UTC (rev 7034)
@@ -42,7 +42,9 @@
tc16_byterace.vgtest tc16_byterace.stderr.exp \
tc16_byterace.stdout.exp \
tc17_sembar.vgtest tc17_sembar.stderr.exp \
- tc17_sembar.stdout.exp
+ tc17_sembar.stdout.exp \
+ tc18_semabuse.vgtest tc18_semabuse.stderr.exp \
+ tc18_semabuse.stdout.exp
check_PROGRAMS = \
hg01_all_ok \
@@ -67,7 +69,8 @@
tc14_laog_dinphils \
tc15_laog_lockdel \
tc16_byterace \
- tc17_sembar
+ tc17_sembar \
+ tc18_semabuse
# is this necessary?
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI)
Added: branches/THRCHECK/thrcheck/tests/tc18_semabuse.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc18_semabuse.c (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc18_semabuse.c 2007-10-25 17:39:42 UTC (rev 7034)
@@ -0,0 +1,42 @@
+
+/* Do stupid things with semaphores, and check that Thrcheck doesn't
+ fall over and does report errors appropriately. If nothing else
+ this just checks that the relevant functions are getting
+ intercepted. */
+
+/* This is pretty lame, because making the sem_ functions fail is
+ difficult. Not sure it's really worth having. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <string.h>
+
+int main ( void )
+{
+ int r;
+ sem_t s1;
+
+ /* Do sem_init with huge initial count */
+ r= sem_init(&s1, 0, ~0);
+
+ /* initialise properly */
+ r= sem_init(&s1, 0, 0);
+
+ /* in glibc, sem_destroy is a no-op; making it fail is
+ impossible. */
+
+ /* Do 'wait' on a bogus semaphore. This should fail, but on glibc
+ it succeeds. */
+ memset(&s1, 0x55, sizeof(s1));
+ r= sem_wait(&s1); /* assert(r != 0); */
+
+ /* this really ought to fail, but it doesn't. */
+ r= sem_post(&s1); assert(!r);
+
+ sem_destroy(&s1);
+
+ return 0;
+}
Added: branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc18_semabuse.stderr.exp 2007-10-25 17:39:42 UTC (rev 7034)
@@ -0,0 +1,14 @@
+
+Thread #1 is the program's root thread
+
+Thread #1's call to sem_init failed
+ with error code 22 (EINVAL: Invalid argument)
+ at 0x........: sem_init@* (tc_intercepts.c:...)
+ by 0x........: main (tc18_semabuse.c:23)
+
+Thread #1: Bug in libpthread: sem_wait succeeded on semaphore without prior sem_post
+ at 0x........: sem_wait_WRK (tc_intercepts.c:...)
+ by 0x........: sem_wait (tc_intercepts.c:...)
+ by 0x........: main (tc18_semabuse.c:34)
+
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Added: branches/THRCHECK/thrcheck/tests/tc18_semabuse.stdout.exp
===================================================================
Added: branches/THRCHECK/thrcheck/tests/tc18_semabuse.vgtest
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc18_semabuse.vgtest (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc18_semabuse.vgtest 2007-10-25 17:39:42 UTC (rev 7034)
@@ -0,0 +1 @@
+prog: tc18_semabuse
|
|
From: <sv...@va...> - 2007-10-25 16:59:13
|
Author: sewardj
Date: 2007-10-25 17:59:14 +0100 (Thu, 25 Oct 2007)
New Revision: 7033
Log:
Test semaphore handling, by using them to build a barrier.
Added:
branches/THRCHECK/thrcheck/tests/tc17_sembar.c
branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp
branches/THRCHECK/thrcheck/tests/tc17_sembar.stdout.exp
branches/THRCHECK/thrcheck/tests/tc17_sembar.vgtest
Modified:
branches/THRCHECK/thrcheck/tests/Makefile.am
Modified: branches/THRCHECK/thrcheck/tests/Makefile.am
===================================================================
--- branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-25 16:09:46 UTC (rev 7032)
+++ branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-25 16:59:14 UTC (rev 7033)
@@ -1,6 +1,4 @@
-# FIXME: this is completely bogus (a copy of Helgrind's one)
-
# For AM_FLAG_M3264_PRI
include $(top_srcdir)/Makefile.flags.am
@@ -42,7 +40,9 @@
tc15_laog_lockdel.vgtest tc15_laog_lockdel.stderr.exp \
tc15_laog_lockdel.stdout.exp \
tc16_byterace.vgtest tc16_byterace.stderr.exp \
- tc16_byterace.stdout.exp
+ tc16_byterace.stdout.exp \
+ tc17_sembar.vgtest tc17_sembar.stderr.exp \
+ tc17_sembar.stdout.exp
check_PROGRAMS = \
hg01_all_ok \
@@ -66,7 +66,8 @@
tc13_laog1 \
tc14_laog_dinphils \
tc15_laog_lockdel \
- tc16_byterace
+ tc16_byterace \
+ tc17_sembar
# is this necessary?
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI)
Added: branches/THRCHECK/thrcheck/tests/tc17_sembar.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc17_sembar.c (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc17_sembar.c 2007-10-25 16:59:14 UTC (rev 7033)
@@ -0,0 +1,178 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <pthread.h>
+#include <semaphore.h>
+
+/* This is really a test of semaphore handling
+ (sem_{init,destroy,post,wait}). Using semaphores a barrier
+ function is created. Thrcheck does understand the barrier
+ semantics implied by the barrier, as pieced together from
+ happens-before relationships obtained from the component
+ semaphores. However, it does falsely report one race. Ah well. */
+
+/* This code is derived from
+ gcc-4.3-20071012/libgomp/config/posix/bar.c, which is
+
+ Copyright (C) 2005 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rt...@re...>.
+
+ and available under version 2.1 or later of the GNU Lesser General
+ Public License.
+
+ Relative to the libgomp sources, the gomp_barrier_t type here has
+ an extra semaphore field, xxx. This is not functionally useful,
+ but it is used to create enough extra inter-thread dependencies
+ that the barrier-like behaviour of gomp_barrier_t is evident to
+ Thrcheck. There is no other purpose for the .xxx field. */
+
+typedef struct
+{
+ pthread_mutex_t mutex1;
+ pthread_mutex_t mutex2;
+ sem_t sem1;
+ sem_t sem2;
+ unsigned total;
+ unsigned arrived;
+ sem_t xxx;
+} gomp_barrier_t;
+
+typedef long bool;
+
+void
+gomp_barrier_init (gomp_barrier_t *bar, unsigned count)
+{
+ pthread_mutex_init (&bar->mutex1, NULL);
+ pthread_mutex_init (&bar->mutex2, NULL);
+ sem_init (&bar->sem1, 0, 0);
+ sem_init (&bar->sem2, 0, 0);
+ sem_init (&bar->xxx, 0, 0);
+ bar->total = count;
+ bar->arrived = 0;
+}
+
+void
+gomp_barrier_destroy (gomp_barrier_t *bar)
+{
+ /* Before destroying, make sure all threads have left the barrier. */
+ pthread_mutex_lock (&bar->mutex1);
+ pthread_mutex_unlock (&bar->mutex1);
+
+ pthread_mutex_destroy (&bar->mutex1);
+ pthread_mutex_destroy (&bar->mutex2);
+ sem_destroy (&bar->sem1);
+ sem_destroy (&bar->sem2);
+ sem_destroy(&bar->xxx);
+}
+
+void
+gomp_barrier_reinit (gomp_barrier_t *bar, unsigned count)
+{
+ pthread_mutex_lock (&bar->mutex1);
+ bar->total = count;
+ pthread_mutex_unlock (&bar->mutex1);
+}
+
+void
+gomp_barrier_wait (gomp_barrier_t *bar)
+{
+ unsigned int n;
+ pthread_mutex_lock (&bar->mutex1);
+
+ ++bar->arrived;
+
+ if (bar->arrived == bar->total)
+ {
+ bar->arrived--;
+ n = bar->arrived;
+ if (n > 0)
+ {
+ { unsigned int i;
+ for (i = 0; i < n; i++)
+ sem_wait(&bar->xxx); // acquire an obvious dependency from
+ // all other threads arriving at the barrier
+ }
+ // 1 up n times, 2 down once
+ // now let all the other threads past the barrier, giving them
+ // an obvious dependency with this thread.
+ do
+ sem_post (&bar->sem1); // 1 up
+ while (--n != 0);
+ // and wait till the last thread has left
+ sem_wait (&bar->sem2); // 2 down
+ }
+ pthread_mutex_unlock (&bar->mutex1);
+ /* Resultat professionnel! First we made this thread have an
+ obvious (Thrcheck-visible) dependency on all other threads
+ calling gomp_barrier_wait. Then, we released them all again,
+ so they all have a (visible) dependency on this thread.
+ Transitively, the result is that all threads leaving the
+ barrier have a a Thrcheck-visible dependency on all threads
+ arriving at the barrier. As required. */
+ }
+ else
+ {
+ pthread_mutex_unlock (&bar->mutex1);
+ sem_post(&bar->xxx);
+ // first N-1 threads wind up waiting here
+ sem_wait (&bar->sem1); // 1 down
+
+ pthread_mutex_lock (&bar->mutex2);
+ n = --bar->arrived; /* XXX see below */
+ pthread_mutex_unlock (&bar->mutex2);
+
+ if (n == 0)
+ sem_post (&bar->sem2); // 2 up
+ }
+}
+
+
+/* re XXX, thrcheck reports a race at this point. It doesn't
+ understand that bar->arrived is protected by mutex1 whilst threads
+ are arriving at the barrier and by mutex2 whilst they are leaving,
+ but not consistently by either of them. Oh well. */
+
+gomp_barrier_t bar;
+
+void* child ( void* argV )
+{
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ gomp_barrier_wait( &bar );
+ return NULL;
+}
+
+#define NNN 4
+
+int main (int argc, char *argv[])
+{
+ int j;
+ long i; int res;
+ pthread_t thr[NNN];
+ fprintf(stderr, "starting\n");
+
+ for (j = 0; j < 1; j++) {
+ gomp_barrier_init( &bar, NNN );
+
+ for (i = 0; i < NNN; i++) {
+ res = pthread_create( &thr[i], NULL, child, (void*)i );
+ assert(!res);
+ }
+
+ for (i = 0; i < NNN; i++) {
+ res = pthread_join( thr[i], NULL );
+ assert(!res);
+ }
+
+ gomp_barrier_destroy( &bar );
+ }
+ fprintf(stderr, "done\n");
+
+ return 0;
+}
Added: branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc17_sembar.stderr.exp 2007-10-25 16:59:14 UTC (rev 7033)
@@ -0,0 +1,46 @@
+
+starting
+Thread #2 was created
+ at 0x........: clone (in /...libc...)
+ by 0x........: ...
+ by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
+ by 0x........: pthread_create@* (tc_intercepts.c:...)
+ by 0x........: main (tc17_sembar.c:164)
+
+Thread #3 was created
+ at 0x........: clone (in /...libc...)
+ by 0x........: ...
+ by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
+ by 0x........: pthread_create@* (tc_intercepts.c:...)
+ by 0x........: main (tc17_sembar.c:164)
+
+Thread #4 was created
+ at 0x........: clone (in /...libc...)
+ by 0x........: ...
+ by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
+ by 0x........: pthread_create@* (tc_intercepts.c:...)
+ by 0x........: main (tc17_sembar.c:164)
+
+Thread #5 was created
+ at 0x........: clone (in /...libc...)
+ by 0x........: ...
+ by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
+ by 0x........: pthread_create@* (tc_intercepts.c:...)
+ by 0x........: main (tc17_sembar.c:164)
+
+Possible data race during read of size 4 at 0x........
+ at 0x........: gomp_barrier_wait (tc17_sembar.c:122)
+ by 0x........: child (tc17_sembar.c:140)
+ by 0x........: mythread_wrapper (tc_intercepts.c:...)
+ by 0x........: ...
+ by 0x........: ...
+ Old state: shared-modified by threads #2, #3, #4, #5
+ New state: shared-modified by threads #2, #3, #4, #5
+ Reason: this thread, #2, holds no consistent locks
+ Last consistently used lock for 0x........ was first observed
+ at 0x........: pthread_mutex_init (tc_intercepts.c:...)
+ by 0x........: gomp_barrier_init (tc17_sembar.c:46)
+ by 0x........: main (tc17_sembar.c:161)
+done
+
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Added: branches/THRCHECK/thrcheck/tests/tc17_sembar.stdout.exp
===================================================================
Added: branches/THRCHECK/thrcheck/tests/tc17_sembar.vgtest
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc17_sembar.vgtest (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc17_sembar.vgtest 2007-10-25 16:59:14 UTC (rev 7033)
@@ -0,0 +1 @@
+prog: tc17_sembar
|