|
From: <sv...@va...> - 2009-07-23 17:22:22
|
Author: bart
Date: 2009-07-23 18:22:11 +0100 (Thu, 23 Jul 2009)
New Revision: 10561
Log:
Reverted r10523 and r10540: since sem_init() is not yet supported on Darwin, revert the attempts to compensate for the different return values on Darwin.
Modified:
trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
trunk/helgrind/tests/tc23_bogus_condwait.c
trunk/helgrind/tests/tc23_bogus_condwait.stderr.exp
trunk/helgrind/tests/tc24_nonzero_sem.c
Modified: trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
===================================================================
--- trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc 2009-07-23 16:31:39 UTC (rev 10560)
+++ trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc 2009-07-23 17:22:11 UTC (rev 10561)
@@ -1,16 +1,16 @@
The object at address 0x........ is not a mutex.
at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ by 0x........: main (tc23_bogus_condwait.c:69)
The object at address 0x........ is not a mutex.
at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ by 0x........: main (tc23_bogus_condwait.c:69)
Process terminating with default action of signal 7 (SIGBUS)
Invalid address alignment at address 0x........
at 0x........: (within libpthread-?.?.so)
- by 0x........: pthread_cond_wait@@GLIBC_2.3.2(within libpthread-?.?.so)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ by 0x........: pthread_cond_wait@@@GLIBC_2.3.2(within libpthread-?.?.so)
+ by 0x........: main (tc23_bogus_condwait.c:69)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Modified: trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
===================================================================
--- trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 2009-07-23 16:31:39 UTC (rev 10560)
+++ trunk/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 2009-07-23 17:22:11 UTC (rev 10561)
@@ -1,96 +1,96 @@
The object at address 0x........ is not a mutex.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:69)
The object at address 0x........ is not a mutex.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:69)
Thread 3:
Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
at 0x........: pthread_cond_signal@* (drd_pthread_intercepts.c:?)
- by 0x........: rescue_me (tc23_bogus_condwait.c:26)
+ by 0x........: rescue_me (tc23_bogus_condwait.c:20)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
cond 0x........ was first observed at:
at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:62)
+ by 0x........: main (tc23_bogus_condwait.c:56)
Thread 1:
Mutex not locked: mutex 0x........, recursion count 0, owner 0.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:78)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:72)
mutex 0x........ was first observed at:
at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:57)
+ by 0x........: main (tc23_bogus_condwait.c:51)
Thread 3:
Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
at 0x........: pthread_cond_signal@* (drd_pthread_intercepts.c:?)
- by 0x........: rescue_me (tc23_bogus_condwait.c:30)
+ by 0x........: rescue_me (tc23_bogus_condwait.c:24)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
cond 0x........ was first observed at:
at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:62)
+ by 0x........: main (tc23_bogus_condwait.c:56)
mutex 0x........ was first observed at:
at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:57)
+ by 0x........: main (tc23_bogus_condwait.c:51)
Thread 1:
The object at address 0x........ is not a mutex.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:81)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:75)
rwlock 0x........ was first observed at:
at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:63)
+ by 0x........: main (tc23_bogus_condwait.c:57)
The object at address 0x........ is not a mutex.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:81)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:75)
rwlock 0x........ was first observed at:
at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:63)
+ by 0x........: main (tc23_bogus_condwait.c:57)
Thread 3:
Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
at 0x........: pthread_cond_signal@* (drd_pthread_intercepts.c:?)
- by 0x........: rescue_me (tc23_bogus_condwait.c:34)
+ by 0x........: rescue_me (tc23_bogus_condwait.c:28)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
cond 0x........ was first observed at:
at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:62)
+ by 0x........: main (tc23_bogus_condwait.c:56)
rwlock 0x........ was first observed at:
at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:63)
+ by 0x........: main (tc23_bogus_condwait.c:57)
Thread 1:
Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 2.
- at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:84)
+ at 0x........: pthread_cond_wait@* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc23_bogus_condwait.c:78)
mutex 0x........ was first observed at:
at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:59)
+ by 0x........: main (tc23_bogus_condwait.c:53)
Thread 3:
Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
at 0x........: pthread_cond_signal@* (drd_pthread_intercepts.c:?)
- by 0x........: rescue_me (tc23_bogus_condwait.c:38)
+ by 0x........: rescue_me (tc23_bogus_condwait.c:32)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
cond 0x........ was first observed at:
at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:62)
+ by 0x........: main (tc23_bogus_condwait.c:56)
mutex 0x........ was first observed at:
at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:59)
+ by 0x........: main (tc23_bogus_condwait.c:53)
The impossible happened: mutex 0x........ is locked simultaneously by two threads (recursion count 1, owners 2 and 1) !
Thread 2:
Mutex not locked by calling thread: mutex 0x........, recursion count 2, owner 1.
at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
- by 0x........: grab_the_lock (tc23_bogus_condwait.c:48)
+ by 0x........: grab_the_lock (tc23_bogus_condwait.c:42)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
mutex 0x........ was first observed at:
at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
- by 0x........: main (tc23_bogus_condwait.c:59)
+ by 0x........: main (tc23_bogus_condwait.c:53)
ERROR SUMMARY: 11 errors from 11 contexts (suppressed: 0 from 0)
Modified: trunk/helgrind/tests/tc23_bogus_condwait.c
===================================================================
--- trunk/helgrind/tests/tc23_bogus_condwait.c 2009-07-23 16:31:39 UTC (rev 10560)
+++ trunk/helgrind/tests/tc23_bogus_condwait.c 2009-07-23 17:22:11 UTC (rev 10561)
@@ -7,12 +7,6 @@
#include <unistd.h>
#include <semaphore.h>
-#ifdef __APPLE__
-#define OS_IS_DARWIN 1
-#else
-#define OS_IS_DARWIN 0
-#endif
-
pthread_mutex_t mx[4];
pthread_cond_t cv;
pthread_rwlock_t rwl;
@@ -62,7 +56,7 @@
r= pthread_cond_init(&cv, NULL); assert(!r);
r= pthread_rwlock_init(&rwl, NULL); assert(!r);
- r= sem_init( &quit_now, 0,0 ); assert(OS_IS_DARWIN || !r);
+ r= sem_init( &quit_now, 0,0 ); assert(!r);
r= pthread_create( &grabber, NULL, grab_the_lock, NULL ); assert(!r);
sleep(1); /* let the grabber get there first */
@@ -83,8 +77,8 @@
/* mx is held by someone else. */
r= pthread_cond_wait(&cv, &mx[2] );
- r= sem_post( &quit_now ); assert(OS_IS_DARWIN || !r);
- r= sem_post( &quit_now ); assert(OS_IS_DARWIN || !r);
+ r= sem_post( &quit_now ); assert(!r);
+ r= sem_post( &quit_now ); assert(!r);
r= pthread_join( my_rescuer, NULL ); assert(!r);
r= pthread_join( grabber, NULL ); assert(!r);
Modified: trunk/helgrind/tests/tc23_bogus_condwait.stderr.exp
===================================================================
--- trunk/helgrind/tests/tc23_bogus_condwait.stderr.exp 2009-07-23 16:31:39 UTC (rev 10560)
+++ trunk/helgrind/tests/tc23_bogus_condwait.stderr.exp 2009-07-23 17:22:11 UTC (rev 10561)
@@ -3,18 +3,18 @@
Thread #x: pthread_cond_{timed}wait called with invalid mutex
at 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
- by 0x........: main (tc23_bogus_condwait.c:75)
+ by 0x........: main (tc23_bogus_condwait.c:69)
Thread #x: pthread_cond_{timed}wait called with un-held mutex
at 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
- by 0x........: main (tc23_bogus_condwait.c:78)
+ by 0x........: main (tc23_bogus_condwait.c:72)
Thread #x: pthread_cond_{timed}wait called with mutex of type pthread_rwlock_t*
at 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
- by 0x........: main (tc23_bogus_condwait.c:81)
+ by 0x........: main (tc23_bogus_condwait.c:75)
Thread #x: pthread_cond_{timed}wait called with mutex held by a different thread
at 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
- by 0x........: main (tc23_bogus_condwait.c:84)
+ by 0x........: main (tc23_bogus_condwait.c:78)
ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Modified: trunk/helgrind/tests/tc24_nonzero_sem.c
===================================================================
--- trunk/helgrind/tests/tc24_nonzero_sem.c 2009-07-23 16:31:39 UTC (rev 10560)
+++ trunk/helgrind/tests/tc24_nonzero_sem.c 2009-07-23 17:22:11 UTC (rev 10561)
@@ -8,19 +8,13 @@
#include <semaphore.h>
#include <assert.h>
-#ifdef __APPLE__
-#define OS_IS_DARWIN 1
-#else
-#define OS_IS_DARWIN 0
-#endif
-
#define N_THREADS 3
void* child_fn ( void* semV )
{
int r;
sem_t* sem = (sem_t*)semV;
- r= sem_wait(sem); assert(OS_IS_DARWIN || !r);
+ r= sem_wait(sem); assert(!r);
return NULL;
}
@@ -30,7 +24,7 @@
sem_t sem;
pthread_t child[N_THREADS];
- r= sem_init(&sem, 0, N_THREADS); assert(OS_IS_DARWIN || !r);
+ r= sem_init(&sem, 0, N_THREADS); assert(!r);
for (i = 0; i < N_THREADS; i++) {
r= pthread_create( &child[i], NULL, child_fn, (void*)&sem );
|