From: Bart Van Assche Date: Thu, 3 Jul 2008 12:29:16 +0000 (+0000) Subject: Fixed order of semaphore call stack and semaphore first observed call stack printing. X-Git-Tag: svn/VALGRIND_3_4_0~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58dc4b71a97752338d861c776c519e29df80369e;p=thirdparty%2Fvalgrind.git Fixed order of semaphore call stack and semaphore first observed call stack printing. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8343 --- diff --git a/exp-drd/drd_error.c b/exp-drd/drd_error.c index 72e781793b..4c60c069f0 100644 --- a/exp-drd/drd_error.c +++ b/exp-drd/drd_error.c @@ -235,8 +235,8 @@ static void drd_tool_error_pp(Error* const e) "%s: semaphore 0x%lx", VG_(get_error_string)(e), sei->semaphore); - first_observed(sei->semaphore); VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(sei->semaphore); break; } case BarrierErr: { diff --git a/exp-drd/tests/tc18_semabuse.stderr.exp b/exp-drd/tests/tc18_semabuse.stderr.exp index bfd3ab889c..82f3fddf0b 100644 --- a/exp-drd/tests/tc18_semabuse.stderr.exp +++ b/exp-drd/tests/tc18_semabuse.stderr.exp @@ -1,16 +1,16 @@ Semaphore reinitialization: semaphore 0x........ + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc18_semabuse.c:26) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc18_semabuse.c:23) - at 0x........: sem_init* (drd_pthread_intercepts.c:?) - by 0x........: main (tc18_semabuse.c:26) Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc18_semabuse.c:34) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc18_semabuse.c:23) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc18_semabuse.c:34) ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/tc20_verifywrap.stderr.exp b/exp-drd/tests/tc20_verifywrap.stderr.exp index ce3fe3d957..1e531a84c8 100644 --- a/exp-drd/tests/tc20_verifywrap.stderr.exp +++ b/exp-drd/tests/tc20_verifywrap.stderr.exp @@ -112,21 +112,21 @@ rwlock 0x........ was first observed at: Semaphore reinitialization: semaphore 0x........ + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:231) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_init* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:231) FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:242) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:242) FIXME: can't figure out how to verify wrap of sem_post diff --git a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 index d4d197661f..a715c838a1 100644 --- a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 +++ b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 @@ -108,21 +108,21 @@ rwlock 0x........ was first observed at: Semaphore reinitialization: semaphore 0x........ + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:231) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_init* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:231) FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:242) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:242) FIXME: can't figure out how to verify wrap of sem_post diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp b/exp-drd/tests/tc20_verifywrap2.stderr.exp index c207a43c80..4feb3de1fa 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp @@ -138,11 +138,11 @@ rwlock 0x........ was first observed at: [1/1] semaphore_init 0x........ Semaphore reinitialization: semaphore 0x........ + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:231) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_init* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:231) FIXME: can't figure out how to verify wrap of sem_destroy @@ -150,11 +150,11 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:242) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:242) [1/1] semaphore_post 0x........ FIXME: can't figure out how to verify wrap of sem_post diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 index d732694563..63c2d2a2a6 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 @@ -132,11 +132,11 @@ rwlock 0x........ was first observed at: [1/1] semaphore_init 0x........ Semaphore reinitialization: semaphore 0x........ + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:231) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_init* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:231) FIXME: can't figure out how to verify wrap of sem_destroy @@ -144,11 +144,11 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:242) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:242) [1/1] semaphore_post 0x........ FIXME: can't figure out how to verify wrap of sem_post diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b index 48fee91fea..9ed459c301 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3-b @@ -37,18 +37,27 @@ make pthread_mutex_lock fail: skipped on glibc < 2.4 The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:116) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:116) [1/1] post_mutex_lock invalid mutex 0x........ rc 0 owner 0 (locking failed) [1/1] pre_mutex_lock invalid mutex 0x........ rc 0 owner 0 The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_timedlock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:121) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:116) [1/1] post_mutex_lock invalid mutex 0x........ rc 0 owner 0 (locking failed) [1/1] mutex_unlock invalid mutex 0x........ rc 0 The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:125) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:116) ---------------- pthread_cond_wait et al ---------------- @@ -59,6 +68,9 @@ The object at address 0x........ is not a mutex. Mutex not locked: mutex 0x........, recursion count 0, owner 0. at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:147) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:145) [1/1] cond_pre_wait cond 0x........ [1/1] cond_post_wait cond 0x........ [1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 0 @@ -81,6 +93,9 @@ FIXME: can't figure out how to verify wrap of pthread_broadcast_signal Reader-writer lock not locked by calling thread: rwlock 0x......... at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:179) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:178) (1) no error on next line (2) no error on next line (3) ERROR on next line @@ -88,10 +103,16 @@ Reader-writer lock not locked by calling thread: rwlock 0x......... Reader-writer lock not locked by calling thread: rwlock 0x......... at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:196) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:186) Reader-writer lock reinitialization: rwlock 0x......... at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:199) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:186) (4) no error on next line (5) no error on next line (6) no error on next line @@ -101,6 +122,9 @@ Reader-writer lock reinitialization: rwlock 0x......... Reader-writer lock not locked by calling thread: rwlock 0x......... at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:212) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:186) ---------------- sem_* ---------------- @@ -110,6 +134,9 @@ Reader-writer lock not locked by calling thread: rwlock 0x......... Semaphore reinitialization: semaphore 0x........ at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:231) +semaphore 0x........ was first observed at: + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:228) FIXME: can't figure out how to verify wrap of sem_destroy @@ -119,6 +146,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ at 0x........: sem_wait* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:242) +semaphore 0x........ was first observed at: + at 0x........: sem_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:228) [1/1] semaphore_post 0x........ FIXME: can't figure out how to verify wrap of sem_post diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 index 772e1bc57d..7dcfa91188 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 @@ -143,11 +143,11 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ + at 0x........: sem_wait* (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:242) semaphore 0x........ was first observed at: at 0x........: sem_init* (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:228) - at 0x........: sem_wait* (drd_pthread_intercepts.c:?) - by 0x........: main (tc20_verifywrap.c:242) [1/1] semaphore_post 0x........ FIXME: can't figure out how to verify wrap of sem_post