From: Bart Van Assche Date: Thu, 3 Jul 2008 10:57:30 +0000 (+0000) Subject: Made error messages more verbose. X-Git-Tag: svn/VALGRIND_3_4_0~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36b50174da28fd381cd27c4fd05a538902620236;p=thirdparty%2Fvalgrind.git Made error messages more verbose. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8341 --- diff --git a/exp-drd/drd_clientobj.c b/exp-drd/drd_clientobj.c index 5090aacebe..1d62db1832 100644 --- a/exp-drd/drd_clientobj.c +++ b/exp-drd/drd_clientobj.c @@ -68,6 +68,15 @@ void clientobj_cleanup(void) s_clientobj = 0; } +/** Return the data associated with the client object at client address addr. + * Return 0 if there is no client object in the set with the specified start + * address. + */ +DrdClientobj* clientobj_get_any(const Addr addr) +{ + return VG_(OSetGen_Lookup)(s_clientobj, &addr); +} + /** Return the data associated with the client object at client address addr * and that has object type t. Return 0 if there is no client object in the * set with the specified start address. @@ -121,6 +130,7 @@ clientobj_add(const Addr a1, const ObjType t) VG_(memset)(p, 0, sizeof(*p)); p->any.a1 = a1; p->any.type = t; + p->any.first_observed_at = VG_(record_ExeContext)(VG_(get_running_tid)(), 0); VG_(OSetGen_Insert)(s_clientobj, p); tl_assert(VG_(OSetGen_Lookup)(s_clientobj, &a1) == p); drd_start_suppression(a1, a1 + 1, "clientobj"); @@ -200,3 +210,15 @@ DrdClientobj* clientobj_next(const ObjType t) return p; } +const char* clientobj_type_name(const ObjType t) +{ + switch (t) + { + case ClientMutex: return "mutex"; + case ClientCondvar: return "cond"; + case ClientSemaphore: return "semaphore"; + case ClientBarrier: return "barrier"; + case ClientRwlock: return "rwlock"; + } + return "(unknown)"; +} diff --git a/exp-drd/drd_clientobj.h b/exp-drd/drd_clientobj.h index b8297b7f11..19a361535f 100644 --- a/exp-drd/drd_clientobj.h +++ b/exp-drd/drd_clientobj.h @@ -51,9 +51,10 @@ typedef enum { struct any { - Addr a1; - ObjType type; - void (*cleanup)(union drd_clientobj*); + Addr a1; + ObjType type; + void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; }; struct mutex_info @@ -61,23 +62,24 @@ struct mutex_info Addr a1; ObjType type; void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; MutexT mutex_type; // pthread_mutex_t or pthread_spinlock_t. int recursion_count; // 0 if free, >= 1 if locked. DrdThreadId owner; // owner if locked, last owner if free. Segment* last_locked_segment; ULong acquiry_time_ms; - ExeContext* first_observed_at; ExeContext* acquired_at; }; struct cond_info { - Addr a1; - ObjType type; - void (*cleanup)(union drd_clientobj*); - int waiter_count; - Addr mutex; //Client mutex specified in pthread_cond_wait() call, and null - //if no client threads are currently waiting on this cond.var. + Addr a1; + ObjType type; + void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; + int waiter_count; + Addr mutex; // Client mutex specified in pthread_cond_wait() call, and + // null if no client threads are currently waiting on this cond.var. }; struct semaphore_info @@ -85,6 +87,7 @@ struct semaphore_info Addr a1; ObjType type; void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; UWord value; // Semaphore value. UWord waiters; // Number of threads inside sem_wait(). DrdThreadId last_sem_post_tid; // Thread ID associated with last sem_post(). @@ -96,6 +99,7 @@ struct barrier_info Addr a1; ObjType type; void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; BarrierT barrier_type; // pthread_barrier or gomp_barrier. Word count; // Participant count in a barrier wait. Word pre_iteration; // pthread_barrier_wait() call count modulo two. @@ -110,6 +114,7 @@ struct rwlock_info Addr a1; ObjType type; void (*cleanup)(union drd_clientobj*); + ExeContext* first_observed_at; OSet* thread_info; ULong acquiry_time_ms; ExeContext* acquired_at; @@ -131,6 +136,7 @@ typedef union drd_clientobj void clientobj_set_trace(const Bool trace); void clientobj_init(void); void clientobj_cleanup(void); +DrdClientobj* clientobj_get_any(const Addr addr); DrdClientobj* clientobj_get(const Addr addr, const ObjType t); Bool clientobj_present(const Addr a1, const Addr a2); DrdClientobj* clientobj_add(const Addr a1, const ObjType t); @@ -138,5 +144,7 @@ Bool clientobj_remove(const Addr addr, const ObjType t); void clientobj_stop_using_mem(const Addr a1, const Addr a2); void clientobj_resetiter(void); DrdClientobj* clientobj_next(const ObjType t); +const char* clientobj_type_name(const ObjType t); + #endif /* __DRD_CLIENTOBJ_H */ diff --git a/exp-drd/drd_error.c b/exp-drd/drd_error.c index e66fdac576..72e781793b 100644 --- a/exp-drd/drd_error.c +++ b/exp-drd/drd_error.c @@ -70,21 +70,23 @@ void describe_malloced_addr(Addr const a, SizeT const len, AddrInfo* const ai) } } -/** Report where a mutex has been observed for the first time. The printed - * call stack will either refer to a pthread_mutex_init() or a - * pthread_mutex_lock() call. +/** Report where an object has been observed for the first time. The printed + * call stack will either refer to a pthread_*_init() or a pthread_*lock() + * call. */ -static void mutex_first_observed(const Addr mutex) +static void first_observed(const Addr obj) { - struct mutex_info* mi; + DrdClientobj* cl; - mi = mutex_get(mutex); - if (mi) + cl = clientobj_get_any(obj); + if (cl) { - tl_assert(mi->first_observed_at); + tl_assert(cl->any.first_observed_at); VG_(message)(Vg_UserMsg, - "Mutex 0x%lx was first observed at:", mutex); - VG_(pp_ExeContext)(mi->first_observed_at); + "%s 0x%lx was first observed at:", + clientobj_type_name(cl->any.type), + obj); + VG_(pp_ExeContext)(cl->any.first_observed_at); } } @@ -176,6 +178,7 @@ static void drd_tool_error_pp(Error* const e) p->mutex); } VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(p->mutex); break; } case CondErr: { @@ -185,6 +188,7 @@ static void drd_tool_error_pp(Error* const e) VG_(get_error_string)(e), cdei->cond); VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(cdei->cond); break; } case CondDestrErr: { @@ -195,7 +199,7 @@ static void drd_tool_error_pp(Error* const e) cdi->cond, cdi->mutex, DrdThreadIdToVgThreadId(cdi->tid), cdi->tid); VG_(pp_ExeContext)(VG_(get_error_where)(e)); - mutex_first_observed(cdi->mutex); + first_observed(cdi->mutex); break; } case CondRaceErr: { @@ -206,7 +210,8 @@ static void drd_tool_error_pp(Error* const e) " by the signalling thread.", cei->cond, cei->mutex); VG_(pp_ExeContext)(VG_(get_error_where)(e)); - mutex_first_observed(cei->mutex); + first_observed(cei->cond); + first_observed(cei->mutex); break; } case CondWaitErr: { @@ -218,8 +223,9 @@ static void drd_tool_error_pp(Error* const e) cwei->mutex1, cwei->mutex2); VG_(pp_ExeContext)(VG_(get_error_where)(e)); - mutex_first_observed(cwei->mutex1); - mutex_first_observed(cwei->mutex2); + first_observed(cwei->cond); + first_observed(cwei->mutex1); + first_observed(cwei->mutex2); break; } case SemaphoreErr: { @@ -229,17 +235,19 @@ 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)); break; } case BarrierErr: { - BarrierErrInfo* sei =(BarrierErrInfo*)(VG_(get_error_extra)(e)); - tl_assert(sei); + BarrierErrInfo* bei =(BarrierErrInfo*)(VG_(get_error_extra)(e)); + tl_assert(bei); VG_(message)(Vg_UserMsg, "%s: barrier 0x%lx", VG_(get_error_string)(e), - sei->barrier); + bei->barrier); VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(bei->barrier); break; } case RwlockErr: { @@ -250,6 +258,7 @@ static void drd_tool_error_pp(Error* const e) VG_(get_error_string)(e), p->rwlock); VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(p->rwlock); break; } case HoldtimeErr: { @@ -265,6 +274,7 @@ static void drd_tool_error_pp(Error* const e) p->hold_time_ms, p->threshold_ms); VG_(pp_ExeContext)(VG_(get_error_where)(e)); + first_observed(p->synchronization_object); break; } case GenericErr: { diff --git a/exp-drd/drd_mutex.c b/exp-drd/drd_mutex.c index 148ec23975..db1ef84634 100644 --- a/exp-drd/drd_mutex.c +++ b/exp-drd/drd_mutex.c @@ -76,7 +76,6 @@ void mutex_initialize(struct mutex_info* const p, p->owner = DRD_INVALID_THREADID; p->last_locked_segment = 0; p->acquiry_time_ms = 0; - p->first_observed_at = VG_(record_ExeContext)(VG_(get_running_tid)(), 0); p->acquired_at = 0; } diff --git a/exp-drd/tests/hold_lock_1.stderr.exp b/exp-drd/tests/hold_lock_1.stderr.exp index 2571d62745..45ed99db27 100644 --- a/exp-drd/tests/hold_lock_1.stderr.exp +++ b/exp-drd/tests/hold_lock_1.stderr.exp @@ -6,6 +6,9 @@ Acquired at: Lock on mutex 0x........ was held during ... ms (threshold: 500 ms). at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: main (hold_lock.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (hold_lock.c:?) Locking rwlock exclusively ... Acquired at: @@ -14,6 +17,9 @@ Acquired at: Lock on rwlock 0x........ was held during ... ms (threshold: 500 ms). at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (hold_lock.c:?) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (hold_lock.c:?) Locking rwlock shared ... Done. diff --git a/exp-drd/tests/hold_lock_2.stderr.exp b/exp-drd/tests/hold_lock_2.stderr.exp index b4a5acffd9..5620c9dda8 100644 --- a/exp-drd/tests/hold_lock_2.stderr.exp +++ b/exp-drd/tests/hold_lock_2.stderr.exp @@ -8,6 +8,9 @@ Acquired at: Lock on rwlock 0x........ was held during ... ms (threshold: 500 ms). at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (hold_lock.c:?) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (hold_lock.c:?) Done. ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/pth_barrier_reinit.stderr.exp b/exp-drd/tests/pth_barrier_reinit.stderr.exp index a29c1bd160..d3cf90218a 100644 --- a/exp-drd/tests/pth_barrier_reinit.stderr.exp +++ b/exp-drd/tests/pth_barrier_reinit.stderr.exp @@ -2,5 +2,8 @@ Barrier reinitializatoin: barrier 0x........ at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_barrier_reinit.c:?) +barrier 0x........ was first observed at: + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (pth_barrier_reinit.c:?) ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/pth_cond_race.stderr.exp b/exp-drd/tests/pth_cond_race.stderr.exp index 8e38ee6eb9..e428656b55 100644 --- a/exp-drd/tests/pth_cond_race.stderr.exp +++ b/exp-drd/tests/pth_cond_race.stderr.exp @@ -6,7 +6,10 @@ Probably a race condition: condition variable 0x........ has been signaled but t by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + by 0x........: main (pth_cond_race.c:?) +mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_cond_race.c:?) diff --git a/exp-drd/tests/pth_inconsistent_cond_wait.stderr.exp b/exp-drd/tests/pth_inconsistent_cond_wait.stderr.exp index 5300ec01d2..f08e28aea9 100644 --- a/exp-drd/tests/pth_inconsistent_cond_wait.stderr.exp +++ b/exp-drd/tests/pth_inconsistent_cond_wait.stderr.exp @@ -6,10 +6,13 @@ Inconsistent association of condition variable and mutex: condition variable 0x. by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + by 0x........: main (pth_inconsistent_cond_wait.c:?) +mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_inconsistent_cond_wait.c:?) -Mutex 0x........ was first observed at: +mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_inconsistent_cond_wait.c:?) @@ -17,14 +20,20 @@ Thread 1: 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........: main (pth_inconsistent_cond_wait.c:?) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + by 0x........: main (pth_inconsistent_cond_wait.c:?) +mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_inconsistent_cond_wait.c:?) 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........: main (pth_inconsistent_cond_wait.c:?) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + by 0x........: main (pth_inconsistent_cond_wait.c:?) +mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (pth_inconsistent_cond_wait.c:?) diff --git a/exp-drd/tests/tc09_bad_unlock.stderr.exp b/exp-drd/tests/tc09_bad_unlock.stderr.exp index 31aaabc295..f7bf6fc966 100644 --- a/exp-drd/tests/tc09_bad_unlock.stderr.exp +++ b/exp-drd/tests/tc09_bad_unlock.stderr.exp @@ -3,6 +3,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1 at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:27) by 0x........: main (tc09_bad_unlock.c:49) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:23) + by 0x........: main (tc09_bad_unlock.c:49) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. @@ -11,6 +15,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1 by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:31) + by 0x........: main (tc09_bad_unlock.c:49) Thread 1: The object at address 0x........ is not a mutex. @@ -26,6 +34,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1 at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:27) by 0x........: main (tc09_bad_unlock.c:50) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:23) + by 0x........: main (tc09_bad_unlock.c:50) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. @@ -34,6 +46,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1 by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:31) + by 0x........: main (tc09_bad_unlock.c:50) Thread 1: The object at address 0x........ is not a mutex. diff --git a/exp-drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 b/exp-drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 index 7c6ca3ba9b..38d3759e0a 100644 --- a/exp-drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 +++ b/exp-drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 @@ -3,6 +3,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1 at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:27) by 0x........: main (tc09_bad_unlock.c:49) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:23) + by 0x........: main (tc09_bad_unlock.c:49) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. @@ -11,6 +15,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1 by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:31) + by 0x........: main (tc09_bad_unlock.c:49) Thread 1: The object at address 0x........ is not a mutex. @@ -26,6 +34,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1 at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:27) by 0x........: main (tc09_bad_unlock.c:50) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:23) + by 0x........: main (tc09_bad_unlock.c:50) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. @@ -34,6 +46,10 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1 by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:31) + by 0x........: main (tc09_bad_unlock.c:50) Thread 1: The object at address 0x........ is not a mutex. diff --git a/exp-drd/tests/tc10_rec_lock.stderr.exp b/exp-drd/tests/tc10_rec_lock.stderr.exp index 186510ef2c..7b1c9ce359 100644 --- a/exp-drd/tests/tc10_rec_lock.stderr.exp +++ b/exp-drd/tests/tc10_rec_lock.stderr.exp @@ -10,5 +10,9 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1 at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc10_rec_lock.c:42) by 0x........: main (tc10_rec_lock.c:47) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc10_rec_lock.c:24) + by 0x........: main (tc10_rec_lock.c:47) ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/tc12_rwl_trivial.stderr.exp b/exp-drd/tests/tc12_rwl_trivial.stderr.exp index 4e34a104b0..c9339196bd 100644 --- a/exp-drd/tests/tc12_rwl_trivial.stderr.exp +++ b/exp-drd/tests/tc12_rwl_trivial.stderr.exp @@ -2,5 +2,8 @@ Reader-writer lock not locked by calling thread: rwlock 0x......... at 0x........: pthread_rwlock_unlock* (drd_pthread_intercepts.c:?) by 0x........: main (tc12_rwl_trivial.c:29) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (tc12_rwl_trivial.c:18) ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/tc18_semabuse.stderr.exp b/exp-drd/tests/tc18_semabuse.stderr.exp index 17d11f1418..bfd3ab889c 100644 --- a/exp-drd/tests/tc18_semabuse.stderr.exp +++ b/exp-drd/tests/tc18_semabuse.stderr.exp @@ -1,9 +1,15 @@ Semaphore reinitialization: semaphore 0x........ +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........ +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) diff --git a/exp-drd/tests/tc20_verifywrap.stderr.exp b/exp-drd/tests/tc20_verifywrap.stderr.exp index 57532209a8..ce3fe3d957 100644 --- a/exp-drd/tests/tc20_verifywrap.stderr.exp +++ b/exp-drd/tests/tc20_verifywrap.stderr.exp @@ -28,18 +28,30 @@ Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:108) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) ---------------- pthread_cond_wait et al ---------------- @@ -47,6 +59,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) FIXME: can't figure out how to verify wrap of pthread_cond_signal @@ -60,6 +75,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 @@ -67,10 +85,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 @@ -80,11 +104,17 @@ 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_* ---------------- Semaphore reinitialization: semaphore 0x........ +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) @@ -92,6 +122,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ +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) diff --git a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 index 83f217cfa9..b178aabc0a 100644 --- a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 +++ b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.3 @@ -46,6 +46,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) FIXME: can't figure out how to verify wrap of pthread_cond_signal @@ -59,6 +62,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 @@ -66,10 +72,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 @@ -79,11 +91,17 @@ 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_* ---------------- Semaphore reinitialization: semaphore 0x........ +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) @@ -91,6 +109,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ +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) diff --git a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.8 b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.8 index 47d53ba239..d4e7175e5e 100644 --- a/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.8 +++ b/exp-drd/tests/tc20_verifywrap.stderr.exp-glibc2.8 @@ -28,18 +28,30 @@ Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:108) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) 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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) ---------------- pthread_cond_wait et al ---------------- @@ -47,6 +59,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) FIXME: can't figure out how to verify wrap of pthread_cond_signal @@ -60,6 +75,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 @@ -67,10 +85,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 @@ -88,6 +112,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy Invalid semaphore: semaphore 0x........ +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) diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp b/exp-drd/tests/tc20_verifywrap2.stderr.exp index 1c8e909852..c207a43c80 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp @@ -34,24 +34,36 @@ Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:108) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_trylock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:116) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) ---------------- pthread_cond_wait et al ---------------- @@ -62,6 +74,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 @@ -84,6 +99,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 @@ -91,10 +109,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 @@ -104,6 +128,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_* ---------------- @@ -111,6 +138,9 @@ Reader-writer lock not locked by calling thread: rwlock 0x......... [1/1] semaphore_init 0x........ Semaphore reinitialization: semaphore 0x........ +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) @@ -120,6 +150,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ +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........ diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 index a64518da01..654a370f58 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.3 @@ -59,6 +59,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 +84,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 +94,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 +113,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_* ---------------- @@ -108,6 +123,9 @@ Reader-writer lock not locked by calling thread: rwlock 0x......... [1/1] semaphore_init 0x........ Semaphore reinitialization: semaphore 0x........ +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) @@ -117,6 +135,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ +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........ diff --git a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 index cd8e41fb72..772e1bc57d 100644 --- a/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 +++ b/exp-drd/tests/tc20_verifywrap2.stderr.exp-glibc2.8 @@ -34,24 +34,36 @@ Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:108) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_trylock (drd_pthread_intercepts.c:?) by 0x........: main (tc20_verifywrap.c:116) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) [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_lock (drd_pthread_intercepts.c:?) + by 0x........: main (tc20_verifywrap.c:108) ---------------- pthread_cond_wait et al ---------------- @@ -62,6 +74,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 @@ -84,6 +99,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 @@ -91,10 +109,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 @@ -104,6 +128,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_* ---------------- @@ -116,6 +143,9 @@ FIXME: can't figure out how to verify wrap of sem_destroy [1/1] semaphore_post_wait 0x........ Invalid semaphore: semaphore 0x........ +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........ diff --git a/exp-drd/tests/tc22_exit_w_lock.stderr.exp-64bit b/exp-drd/tests/tc22_exit_w_lock.stderr.exp-64bit index df2d4c10be..217757ce2e 100644 --- a/exp-drd/tests/tc22_exit_w_lock.stderr.exp-64bit +++ b/exp-drd/tests/tc22_exit_w_lock.stderr.exp-64bit @@ -2,5 +2,11 @@ Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 3. at 0x........: pthread_join (drd_pthread_intercepts.c:?) by 0x........: main (tc22_exit_w_lock.c:43) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: child_fn1 (tc22_exit_w_lock.c:18) + by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) + by 0x........: (within libpthread-?.?.so) + by 0x........: clone (in /...libc...) ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/tc23_bogus_condwait.stderr.exp b/exp-drd/tests/tc23_bogus_condwait.stderr.exp index 3b0a93a1e5..1f7bde6cd5 100644 --- a/exp-drd/tests/tc23_bogus_condwait.stderr.exp +++ b/exp-drd/tests/tc23_bogus_condwait.stderr.exp @@ -14,11 +14,17 @@ Probably a race condition: condition variable 0x........ has been signaled but t by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + 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:72) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + 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. @@ -27,7 +33,10 @@ Probably a race condition: condition variable 0x........ has been signaled but t by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + 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:51) @@ -35,10 +44,16 @@ 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:75) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + 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:75) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + 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. @@ -47,11 +62,20 @@ Probably a race condition: condition variable 0x........ has been signaled but t by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + 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: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:78) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + 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. @@ -60,7 +84,10 @@ Probably a race condition: condition variable 0x........ has been signaled but t by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) -Mutex 0x........ was first observed at: +cond 0x........ was first observed at: + at 0x........: pthread_cond_init* (drd_pthread_intercepts.c:?) + 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:53) The impossible happened: mutex 0x........ is locked simultaneously by two threads (recursion count 1, owners 2 and 1) ! @@ -72,5 +99,8 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 2, owner 1 by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?) by 0x........: (within libpthread-?.?.so) by 0x........: clone (in /...libc...) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:53) ERROR SUMMARY: 11 errors from 11 contexts (suppressed: 0 from 0) diff --git a/exp-drd/tests/trylock.stderr.exp b/exp-drd/tests/trylock.stderr.exp index cd9c7dd021..68993a51e4 100644 --- a/exp-drd/tests/trylock.stderr.exp +++ b/exp-drd/tests/trylock.stderr.exp @@ -9,6 +9,9 @@ Attempt to lock for writing recursively (not allowed). Recursive writer locking not allowed: rwlock 0x......... at 0x........: pthread_rwlock_wrlock* (drd_pthread_intercepts.c:?) by 0x........: main (trylock.c:?) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?) + by 0x........: main (trylock.c:?) Locking mutex via pthread_mutex_trylock(). Locking mutex via pthread_mutex_lock(). Locking mutex via pthread_mutex_timedlock().