Fix valgrind-3.11.0-pthread_barrier.patch to apply with older patch.

This commit is contained in:
Mark Wielaard 2016-01-22 12:12:42 +01:00
parent 2a70855887
commit b8858a0102

View File

@ -58,26 +58,53 @@ index 75f121f..3581b08 100644
-ERROR SUMMARY: 7 errors from 6 contexts (suppressed: 0 from 0) -ERROR SUMMARY: 7 errors from 6 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 5 errors from 4 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 5 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/bar_bad.stderr.exp b/drd/tests/bar_bad.stderr.exp-nohang diff --git a/drd/tests/bar_bad.stderr.exp-nohang b/drd/tests/bar_bad.stderr.exp-nohang
similarity index 79% new file mode 100644
copy from drd/tests/bar_bad.stderr.exp index 0000000..44f9651
copy to drd/tests/bar_bad.stderr.exp-nohang --- /dev/null
index 75f121f..44f9651 100644
--- a/drd/tests/bar_bad.stderr.exp
+++ b/drd/tests/bar_bad.stderr.exp-nohang +++ b/drd/tests/bar_bad.stderr.exp-nohang
@@ -38,12 +38,5 @@ Not a barrier @@ -0,0 +1,42 @@
at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?) +
by 0x........: main (bar_bad.c:?) +
+initialise a barrier with zero count
-Destruction of barrier that is being waited upon: barrier 0x........ +pthread_barrier_init: 'count' argument is zero: barrier 0x........
- at 0x........: free (vg_replace_malloc.c:...) + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
- by 0x........: main (bar_bad.c:?) + by 0x........: main (bar_bad.c:?)
-barrier 0x........ was first observed at: +
- at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) +
- by 0x........: main (bar_bad.c:?) +initialise a barrier twice
- +Barrier reinitialization: barrier 0x........
+ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
-ERROR SUMMARY: 7 errors from 6 contexts (suppressed: 0 from 0) + by 0x........: main (bar_bad.c:?)
+barrier 0x........ was first observed at:
+ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+
+
+initialise a barrier which has threads waiting on it
+Barrier reinitialization: barrier 0x........
+ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+barrier 0x........ was first observed at:
+ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+
+
+destroy a barrier that has waiting threads
+Destruction of a barrier with active waiters: barrier 0x........
+ at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+barrier 0x........ was first observed at:
+ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+
+
+destroy a barrier that was never initialised
+Not a barrier
+ at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?)
+ by 0x........: main (bar_bad.c:?)
+
+
+ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/bar_bad_xml.stderr.exp b/drd/tests/bar_bad_xml.stderr.exp diff --git a/drd/tests/bar_bad_xml.stderr.exp b/drd/tests/bar_bad_xml.stderr.exp
index acb9656..8539f75 100644 index acb9656..8539f75 100644
@ -177,78 +204,276 @@ index acb9656..8539f75 100644
</errorcounts> </errorcounts>
<suppcounts>...</suppcounts> <suppcounts>...</suppcounts>
diff --git a/drd/tests/bar_bad_xml.stderr.exp b/drd/tests/bar_bad_xml.stderr.exp-nohang diff --git a/drd/tests/bar_bad_xml.stderr.exp-nohang b/drd/tests/bar_bad_xml.stderr.exp-nohang
similarity index 82% new file mode 100644
copy from drd/tests/bar_bad_xml.stderr.exp index 0000000..a47cd60
copy to drd/tests/bar_bad_xml.stderr.exp-nohang --- /dev/null
index acb9656..a47cd60 100644
--- a/drd/tests/bar_bad_xml.stderr.exp
+++ b/drd/tests/bar_bad_xml.stderr.exp-nohang +++ b/drd/tests/bar_bad_xml.stderr.exp-nohang
@@ -229,53 +229,6 @@ destroy a barrier that was never initialised @@ -0,0 +1,264 @@
</stack> +<?xml version="1.0"?>
</error> +
+<valgrindoutput>
-<error> +
- <unique>0x........</unique> +<protocolversion>4</protocolversion>
- <tid>...</tid> +<protocoltool>drd</protocoltool>
- <kind>BarrierErr</kind> +
- <what>Destruction of barrier that is being waited upon: barrier 0x........</what> +<preamble>
- <stack> + <line>...</line>
- <frame> + <line>...</line>
- <ip>0x........</ip> + <line>...</line>
- <obj>...</obj> + <line>...</line>
- <fn>free</fn> +</preamble>
- <dir>...</dir> +
- <file>vg_replace_malloc.c</file> +<pid>...</pid>
- <line>...</line> +<ppid>...</ppid>
- </frame> +<tool>drd</tool>
- <frame> +
- <ip>0x........</ip> +<args>
- <obj>...</obj> + <vargv>...</vargv>
- <fn>main</fn> + <argv>
- <dir>...</dir> + <exe>./../../helgrind/tests/bar_bad</exe>
- <file>bar_bad.c</file> + </argv>
- <line>...</line> +</args>
- </frame> +
- </stack> +<status>
- <first_observed_at> + <state>RUNNING</state>
- <what>barrier</what> + <time>...</time>
- <address>0x........</address> +</status>
- <stack> +
- <frame> +
- <ip>0x........</ip> +initialise a barrier with zero count
- <obj>...</obj> +<error>
- <fn>pthread_barrier_init</fn> + <unique>0x........</unique>
- <dir>...</dir> + <tid>...</tid>
- <file>drd_pthread_intercepts.c</file> + <kind>BarrierErr</kind>
- <line>...</line> + <what>pthread_barrier_init: 'count' argument is zero: barrier 0x........</what>
- </frame> + <stack>
- <frame> + <frame>
- <ip>0x........</ip> + <ip>0x........</ip>
- <obj>...</obj> + <obj>...</obj>
- <fn>main</fn> + <fn>pthread_barrier_init</fn>
- <dir>...</dir> + <dir>...</dir>
- <file>bar_bad.c</file> + <file>drd_pthread_intercepts.c</file>
- <line>...</line> + <line>...</line>
- </frame> + </frame>
- </stack> + <frame>
- </first_observed_at> + <ip>0x........</ip>
-</error> + <obj>...</obj>
- + <fn>main</fn>
+ <dir>...</dir>
<status> + <file>bar_bad.c</file>
<state>FINISHED</state> + <line>...</line>
@@ -303,10 +256,6 @@ destroy a barrier that was never initialised + </frame>
<count>...</count> + </stack>
<unique>0x........</unique> +</error>
</pair> +
- <pair> +
- <count>...</count> +initialise a barrier twice
- <unique>0x........</unique> +<error>
- </pair> + <unique>0x........</unique>
</errorcounts> + <tid>...</tid>
+ <kind>BarrierErr</kind>
<suppcounts>...</suppcounts> + <what>Barrier reinitialization: barrier 0x........</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_init</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <first_observed_at>
+ <what>barrier</what>
+ <address>0x........</address>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_init</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </first_observed_at>
+</error>
+
+
+initialise a barrier which has threads waiting on it
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>BarrierErr</kind>
+ <what>Barrier reinitialization: barrier 0x........</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_init</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <first_observed_at>
+ <what>barrier</what>
+ <address>0x........</address>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_init</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </first_observed_at>
+</error>
+
+
+destroy a barrier that has waiting threads
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>BarrierErr</kind>
+ <what>Destruction of a barrier with active waiters: barrier 0x........</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_destroy</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <first_observed_at>
+ <what>barrier</what>
+ <address>0x........</address>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_init</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </first_observed_at>
+</error>
+
+
+destroy a barrier that was never initialised
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>GenericErr</kind>
+ <what>Not a barrier</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>pthread_barrier_destroy</fn>
+ <dir>...</dir>
+ <file>drd_pthread_intercepts.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>bar_bad.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+</error>
+
+
+<status>
+ <state>FINISHED</state>
+ <time>...</time>
+</status>
+
+<errorcounts>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+</errorcounts>
+
+<suppcounts>...</suppcounts>
+
+</valgrindoutput>
+
diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
index 8a0d6e6..df82169 100644 index 8a0d6e6..df82169 100644
--- a/helgrind/tests/Makefile.am --- a/helgrind/tests/Makefile.am
@ -427,60 +652,59 @@ index 74af4fa..d0901b2 100644
- by 0x........: main (bar_bad.c:80) - by 0x........: main (bar_bad.c:80)
+ by 0x........: main (bar_bad.c:96) + by 0x........: main (bar_bad.c:96)
diff --git a/helgrind/tests/bar_bad.stderr.exp b/helgrind/tests/bar_bad.stderr.exp-destroy-hang diff --git a/helgrind/tests/bar_bad.stderr.exp-destroy-hang b/helgrind/tests/bar_bad.stderr.exp-destroy-hang
similarity index 72% new file mode 100644
copy from helgrind/tests/bar_bad.stderr.exp index 0000000..ddf5624
copy to helgrind/tests/bar_bad.stderr.exp-destroy-hang --- /dev/null
index 74af4fa..ddf5624 100644
--- a/helgrind/tests/bar_bad.stderr.exp
+++ b/helgrind/tests/bar_bad.stderr.exp-destroy-hang +++ b/helgrind/tests/bar_bad.stderr.exp-destroy-hang
@@ -8,14 +8,14 @@ Thread #x is the program's root thread @@ -0,0 +1,72 @@
+
Thread #x: pthread_barrier_init: 'count' argument is zero +initialise a barrier with zero count
at 0x........: pthread_barrier_init (hg_intercepts.c:...) +---Thread-Announcement------------------------------------------
- by 0x........: main (bar_bad.c:39) +
+Thread #x is the program's root thread
+
+----------------------------------------------------------------
+
+Thread #x: pthread_barrier_init: 'count' argument is zero
+ at 0x........: pthread_barrier_init (hg_intercepts.c:...)
+ by 0x........: main (bar_bad.c:43) + by 0x........: main (bar_bad.c:43)
+
---------------------------------------------------------------- +----------------------------------------------------------------
+
Thread #x's call to pthread_barrier_init failed +Thread #x's call to pthread_barrier_init failed
with error code 22 (EINVAL: Invalid argument) + with error code 22 (EINVAL: Invalid argument)
at 0x........: pthread_barrier_init (hg_intercepts.c:...) + at 0x........: pthread_barrier_init (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:39)
+ by 0x........: main (bar_bad.c:43) + by 0x........: main (bar_bad.c:43)
+
+
initialise a barrier twice +initialise a barrier twice
@@ -23,7 +23,7 @@ initialise a barrier twice +----------------------------------------------------------------
+
Thread #x: pthread_barrier_init: barrier is already initialised +Thread #x: pthread_barrier_init: barrier is already initialised
at 0x........: pthread_barrier_init (hg_intercepts.c:...) + at 0x........: pthread_barrier_init (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:45)
+ by 0x........: main (bar_bad.c:49) + by 0x........: main (bar_bad.c:49)
+
+
initialise a barrier which has threads waiting on it +initialise a barrier which has threads waiting on it
@@ -31,13 +31,13 @@ initialise a barrier which has threads waiting on it +----------------------------------------------------------------
+
Thread #x: pthread_barrier_init: barrier is already initialised +Thread #x: pthread_barrier_init: barrier is already initialised
at 0x........: pthread_barrier_init (hg_intercepts.c:...) + at 0x........: pthread_barrier_init (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:57)
+ by 0x........: main (bar_bad.c:64) + by 0x........: main (bar_bad.c:64)
+
---------------------------------------------------------------- +----------------------------------------------------------------
+
Thread #x: pthread_barrier_init: threads are waiting at barrier +Thread #x: pthread_barrier_init: threads are waiting at barrier
at 0x........: pthread_barrier_init (hg_intercepts.c:...) + at 0x........: pthread_barrier_init (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:57)
+ by 0x........: main (bar_bad.c:64) + by 0x........: main (bar_bad.c:64)
+
+
destroy a barrier that has waiting threads +destroy a barrier that has waiting threads
@@ -45,14 +45,22 @@ destroy a barrier that has waiting threads +----------------------------------------------------------------
+
Thread #x: pthread_barrier_destroy: threads are waiting at barrier +Thread #x: pthread_barrier_destroy: threads are waiting at barrier
at 0x........: pthread_barrier_destroy (hg_intercepts.c:...) + at 0x........: pthread_barrier_destroy (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:69)
+ by 0x........: main (bar_bad.c:82) + by 0x........: main (bar_bad.c:82)
+ +
+---Thread-Announcement------------------------------------------ +---Thread-Announcement------------------------------------------
@ -489,25 +713,20 @@ index 74af4fa..ddf5624 100644
+ ... + ...
+ by 0x........: pthread_create@* (hg_intercepts.c:...) + by 0x........: pthread_create@* (hg_intercepts.c:...)
+ by 0x........: main (bar_bad.c:76) + by 0x........: main (bar_bad.c:76)
+
---------------------------------------------------------------- +----------------------------------------------------------------
+
-Thread #x's call to pthread_barrier_destroy failed
- with error code 16 (EBUSY: Device or resource busy)
- at 0x........: pthread_barrier_destroy (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:69)
+Thread #x: pthread_barrier_wait: barrier is uninitialised +Thread #x: pthread_barrier_wait: barrier is uninitialised
+ at 0x........: pthread_barrier_wait (hg_intercepts.c:...) + at 0x........: pthread_barrier_wait (hg_intercepts.c:...)
+ by 0x........: sleep1 (bar_bad.c:22) + by 0x........: sleep1 (bar_bad.c:22)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...) + by 0x........: mythread_wrapper (hg_intercepts.c:...)
+ ... + ...
+
+
destroy a barrier that was never initialised +destroy a barrier that was never initialised
@@ -60,5 +68,5 @@ destroy a barrier that was never initialised +----------------------------------------------------------------
+
Thread #x: pthread_barrier_destroy: barrier was never initialised +Thread #x: pthread_barrier_destroy: barrier was never initialised
at 0x........: pthread_barrier_destroy (hg_intercepts.c:...) + at 0x........: pthread_barrier_destroy (hg_intercepts.c:...)
- by 0x........: main (bar_bad.c:80)
+ by 0x........: main (bar_bad.c:96) + by 0x........: main (bar_bad.c:96)
+