From: Bart Van Assche Date: Mon, 27 Jul 2009 14:04:46 +0000 (+0000) Subject: Made the error reporting behavior of DRD similar to that of other X-Git-Tag: svn/VALGRIND_3_5_0~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3770e93570884e513e765e4b875a084f375ef2c4;p=thirdparty%2Fvalgrind.git Made the error reporting behavior of DRD similar to that of other Valgrind tools: if the same kind of error has been detected a second time with an identical call stack, count it as an error but do not print it a second time. The total number of detected errors remains unchanged but the number of error contexts is now reported correctly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10633 --- diff --git a/drd/drd_error.c b/drd/drd_error.c index b15eafc39d..ea6220ae3d 100644 --- a/drd/drd_error.c +++ b/drd/drd_error.c @@ -190,7 +190,7 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri) static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2) { - return False; + return True; } static void drd_tool_error_before_pp(Error* const e) diff --git a/drd/tests/bar_bad.stderr.exp b/drd/tests/bar_bad.stderr.exp index 6b50433a51..ea51161dd4 100644 --- a/drd/tests/bar_bad.stderr.exp +++ b/drd/tests/bar_bad.stderr.exp @@ -31,13 +31,6 @@ barrier 0x........ was first observed at: at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) by 0x........: main (bar_bad.c:?) -Destruction of barrier that is being waited upon: 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 diff --git a/drd/tests/omp_matinv_racy.stderr.exp b/drd/tests/omp_matinv_racy.stderr.exp index a3c5c4f6eb..8340d6c300 100644 --- a/drd/tests/omp_matinv_racy.stderr.exp +++ b/drd/tests/omp_matinv_racy.stderr.exp @@ -1 +1 @@ -ERROR SUMMARY: 76 errors from 76 contexts +ERROR SUMMARY: 76 errors from 7 contexts diff --git a/drd/tests/pth_barrier2.stderr.exp b/drd/tests/pth_barrier2.stderr.exp index b1a6f0be1b..bb25d5288a 100644 --- a/drd/tests/pth_barrier2.stderr.exp +++ b/drd/tests/pth_barrier2.stderr.exp @@ -1 +1 @@ -ERROR SUMMARY: 32 errors from 32 contexts +ERROR SUMMARY: 32 errors from 1 contexts diff --git a/drd/tests/pth_barrier3.stderr.exp b/drd/tests/pth_barrier3.stderr.exp index 7e1382d340..6c5b8a3576 100644 --- a/drd/tests/pth_barrier3.stderr.exp +++ b/drd/tests/pth_barrier3.stderr.exp @@ -1 +1 @@ -ERROR SUMMARY: 31 errors from 31 contexts +ERROR SUMMARY: 31 errors from 1 contexts diff --git a/drd/tests/tc09_bad_unlock.stderr.exp b/drd/tests/tc09_bad_unlock.stderr.exp index 870958f64c..825090a5ac 100644 --- a/drd/tests/tc09_bad_unlock.stderr.exp +++ b/drd/tests/tc09_bad_unlock.stderr.exp @@ -42,17 +42,6 @@ mutex 0x........ was first observed at: 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. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: child_fn (tc09_bad_unlock.c:11) - 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........: 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. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:41) @@ -66,4 +55,4 @@ mutex 0x........ was first observed at: by 0x........: nearly_main (tc09_bad_unlock.c:31) by 0x........: main (tc09_bad_unlock.c:50) -ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 8 errors from 7 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 index 8aeeb0cce3..ae6f880532 100644 --- a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 +++ b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 @@ -42,17 +42,6 @@ mutex 0x........ was first observed at: 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. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: child_fn (tc09_bad_unlock.c:11) - 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........: 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. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:41) @@ -66,4 +55,4 @@ mutex 0x........ was first observed at: by 0x........: nearly_main (tc09_bad_unlock.c:31) by 0x........: main (tc09_bad_unlock.c:50) -ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 8 errors from 7 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-darwin b/drd/tests/tc23_bogus_condwait.stderr.exp-darwin index 6cbd844d08..81ce9e75ab 100644 --- a/drd/tests/tc23_bogus_condwait.stderr.exp-darwin +++ b/drd/tests/tc23_bogus_condwait.stderr.exp-darwin @@ -1,8 +1,4 @@ -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: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:69) @@ -34,13 +30,6 @@ 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) - 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) @@ -70,4 +59,4 @@ 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: 9 errors from 9 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc index 135ea9afee..19842f6e51 100644 --- a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc +++ b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc @@ -1,8 +1,4 @@ -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: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:69) @@ -13,4 +9,4 @@ Process terminating with default action of signal 7 (SIGBUS) 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) +ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 index eb619bd2d0..46c92e168e 100644 --- a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 +++ b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 @@ -1,8 +1,4 @@ -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: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:69) @@ -44,13 +40,6 @@ 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. at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?) @@ -93,4 +82,4 @@ 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) +ERROR SUMMARY: 11 errors from 9 contexts (suppressed: 0 from 0) diff --git a/drd/tests/thread_name.stderr.exp b/drd/tests/thread_name.stderr.exp index b74a4ada90..75112198b5 100644 --- a/drd/tests/thread_name.stderr.exp +++ b/drd/tests/thread_name.stderr.exp @@ -11,82 +11,28 @@ The object at address 0x........ is not a mutex. thread_func instance 2 -Thread 3 (thread_func instance 2): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 3 -Thread 4 (thread_func instance 3): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 4 -Thread 5 (thread_func instance 4): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 5 -Thread 6 (thread_func instance 5): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 6 -Thread 7 (thread_func instance 6): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 7 -Thread 8 (thread_func instance 7): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 8 -Thread 9 (thread_func instance 8): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 9 -Thread 10 (thread_func instance 9): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - thread_func instance 10 -Thread 11 (thread_func instance 10): -The object at address 0x........ is not a mutex. - at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: thread_func (thread_name.c:?) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - -ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 10 errors from 1 contexts (suppressed: 0 from 0)