]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Reverted r10523 and r10540: since sem_init() is not yet supported on Darwin, revert...
authorBart Van Assche <bvanassche@acm.org>
Thu, 23 Jul 2009 17:22:11 +0000 (17:22 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 23 Jul 2009 17:22:11 +0000 (17:22 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10561

drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
helgrind/tests/tc23_bogus_condwait.c
helgrind/tests/tc23_bogus_condwait.stderr.exp
helgrind/tests/tc24_nonzero_sem.c

index e217b915675f2ac4db80d3de86321c85fad5ce72..0159ba8c4139a378c7c32d6c4fe75b4d50955d66 100644 (file)
@@ -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)
index 2efe5485a90d2fbf2ac8983e7b688fac4952446d..268051de9a35b8cb609d97d108e868addb2cead8 100644 (file)
@@ -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)
index b45ff0ad4d7e67301cdd63299df2e14be6928928..a0fad5d5d757310d1e3be36ff0d948241a395e9f 100644 (file)
@@ -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 @@ int main ( void )
   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 @@ int main ( void )
   /* 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);
index 7a2739fbfee35c1a098aa3139077061a80e5c788..d80ee1a2c4c9d582277f93365e4414938bd4c56c 100644 (file)
@@ -3,18 +3,18 @@ Thread #x is the program's root thread
 
 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)
index c6176a3a79689dae966bf44cada3efdca96b1926..01c23e811aa07e2f28673e0fefa40a1858739415 100644 (file)
@@ -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 @@ int main ( void )
    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 );