]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
All error and trace messages now show both Valgrind's and DRD's thread ID.
authorBart Van Assche <bvanassche@acm.org>
Sun, 16 Mar 2008 17:57:01 +0000 (17:57 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 16 Mar 2008 17:57:01 +0000 (17:57 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7716

13 files changed:
exp-drd/drd_error.c
exp-drd/drd_segment.c
exp-drd/drd_thread.c
exp-drd/tests/fp_race.stderr.exp
exp-drd/tests/hg03_inherit.stderr.exp
exp-drd/tests/hg04_race.stderr.exp
exp-drd/tests/hg05_race2.stderr.exp
exp-drd/tests/rwlock_race.stderr.exp
exp-drd/tests/sem_as_mutex.stderr.exp
exp-drd/tests/tc01_simple_race.stderr.exp
exp-drd/tests/tc16_byterace.stderr.exp
exp-drd/tests/tc20_verifywrap.stderr.exp
exp-drd/tests/tc20_verifywrap2.stderr.exp

index 21a8e2f86c61610a8b0cc51bfe062f7a503bcda4..ef72522746fff482101c8c0da7560a38b851c749 100644 (file)
@@ -81,10 +81,10 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri)
     describe_malloced_addr(dri->addr, dri->size, &ai);
   }
   VG_(message)(Vg_UserMsg,
-               "Conflicting %s by thread %d at 0x%08lx size %ld",
+               "Conflicting %s by thread %d/%d at 0x%08lx size %ld",
                dri->access_type == eStore ? "store" : "load",
                DrdThreadIdToVgThreadId(dri->tid),
-               /*dri->tid,*/
+               dri->tid,
                dri->addr,
                dri->size);
   VG_(pp_ExeContext)(VG_(get_error_where)(err));
@@ -156,8 +156,9 @@ static void drd_tool_error_pp(Error* const e)
   case CondDestrErr: {
     CondDestrErrInfo* cdi = (CondDestrErrInfo*)(VG_(get_error_extra)(e));
     VG_(message)(Vg_UserMsg,
-                 "%s: cond 0x%lx, mutex 0x%lx locked by thread %d",
-                 cdi->cond, cdi->mutex, cdi->tid);
+                 "%s: cond 0x%lx, mutex 0x%lx locked by thread %d/%d",
+                 cdi->cond, cdi->mutex,
+                 DrdThreadIdToVgThreadId(cdi->tid), cdi->tid);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
     break;
   }
index d8f1943a2ee91f8091f8d0d285b3c32739c6f241..6cf4f8df778b887e029808d37df7572a564b0547 100644 (file)
@@ -81,8 +81,8 @@ void sg_init(Segment* const sg,
   {
     char msg[256];
     VG_(snprintf)(msg, sizeof(msg),
-                  "New segment for thread %d with vc ",
-                  creator);
+                  "New segment for thread %d/%d with vc ",
+                  DrdThreadIdToVgThreadId(creator), creator);
     vc_snprint(msg + VG_(strlen)(msg), sizeof(msg) - VG_(strlen)(msg),
                &sg->vc);
     VG_(message)(Vg_UserMsg, "%s", msg);
index 45eb2351db62f125499e20db86b8006f11cbaf0e..17cf5a761c064c28296f21a1f1c549bbb0d9a847 100644 (file)
@@ -225,14 +225,6 @@ DrdThreadId thread_post_create(const ThreadId vg_created)
 /* ignored.                                                                */
 void thread_set_stack_startup(const DrdThreadId tid, const Addr stack_startup)
 {
-#if 0
-  VG_(message)(Vg_DebugMsg, "thread_set_stack_startup: thread %d (%d)"
-               " stack 0x%x .. 0x%lx (size %d)",
-               s_threadinfo[tid].vg_threadid, tid,
-               stack_startup,
-               s_threadinfo[tid].stack_max,
-               s_threadinfo[tid].stack_max - stack_startup);
-#endif
   tl_assert(0 <= tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID);
   tl_assert(s_threadinfo[tid].stack_min <= stack_startup);
   tl_assert(stack_startup <= s_threadinfo[tid].stack_max);
@@ -358,8 +350,9 @@ void thread_set_running_tid(const ThreadId vg_tid, const DrdThreadId drd_tid)
         && s_drd_running_tid != DRD_INVALID_THREADID)
     {
       VG_(message)(Vg_DebugMsg,
-                   "Context switch from thread %d to thread %d",
-                   s_drd_running_tid, drd_tid);
+                   "Context switch from thread %d/%d to thread %d/%d",
+                   s_vg_running_tid, s_drd_running_tid,
+                   DrdThreadIdToVgThreadId(drd_tid), drd_tid);
     }
     s_vg_running_tid = vg_tid;
     s_drd_running_tid = drd_tid;
@@ -668,7 +661,7 @@ static void show_call_stack(const DrdThreadId tid,
 {
   const ThreadId vg_tid = DrdThreadIdToVgThreadId(tid);
 
-  VG_(message)(Vg_UserMsg, "%s (thread %d)", msg, /*vg_tid,*/ tid);
+  VG_(message)(Vg_UserMsg, "%s (thread %d/%d)", msg, vg_tid, tid);
 
   if (vg_tid != VG_INVALID_THREADID)
   {
@@ -775,8 +768,8 @@ static void thread_update_danger_set(const DrdThreadId tid)
     char msg[256];
 
     VG_(snprintf)(msg, sizeof(msg),
-                  "computing danger set for thread %d with vc ",
-                  tid);
+                  "computing danger set for thread %d/%d with vc ",
+                  DrdThreadIdToVgThreadId(tid), tid);
     vc_snprint(msg + VG_(strlen)(msg),
                sizeof(msg) - VG_(strlen)(msg),
                &s_threadinfo[tid].last->vc);
index bceb943444bc4717746fa24867c9519f4b588577..8c509c70a7338d37a24d1c0a11b281e377780248 100644 (file)
@@ -1,20 +1,20 @@
 
-Conflicting load by thread 1 at 0x........ size 8
+Conflicting load by thread 1/1 at 0x........ size 8
    at 0x........: main (fp_race.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
 declared at fp_race.c:47, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 1 at 0x........ size 8
+Conflicting store by thread 1/1 at 0x........ size 8
    at 0x........: main (fp_race.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
 declared at fp_race.c:47, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 681579ead20b090c8b1e2dd2fcedf1d5c8566d93..5533a7c4f19d9704f79842421d4cd9391e667828 100644 (file)
@@ -1,31 +1,31 @@
 
 Thread 3:
-Conflicting store by thread 3 at 0x........ size 4
+Conflicting store by thread 3/3 at 0x........ size 4
    at 0x........: t2 (hg03_inherit.c:28)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside shared[1],
 declared at hg03_inherit.c:11, in frame #? of thread 3
-Other segment start (thread 1)
+Other segment start (thread 1/1)
    at 0x........: pthread_join (drd_pthread_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:49)
-Other segment end (thread 1)
+Other segment end (thread 1/1)
    at 0x........: (within libpthread-?.?.so)
    by 0x........: pthread_join (drd_pthread_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:63)
 
-Conflicting store by thread 3 at 0x........ size 4
+Conflicting store by thread 3/3 at 0x........ size 4
    at 0x........: t2 (hg03_inherit.c:29)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside shared[1],
 declared at hg03_inherit.c:11, in frame #? of thread 3
-Other segment start (thread 1)
+Other segment start (thread 1/1)
    at 0x........: pthread_join (drd_pthread_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:49)
-Other segment end (thread 1)
+Other segment end (thread 1/1)
    at 0x........: (within libpthread-?.?.so)
    by 0x........: pthread_join (drd_pthread_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:63)
index dd7b91f11d60b1a2655bd0b87bc379d0dfd5c69f..e9ad4351a8d93ce6a5a4d2de47b945a6b8846804 100644 (file)
@@ -1,27 +1,27 @@
 
 Thread 2:
-Conflicting load by thread 2 at 0x........ size 4
+Conflicting load by thread 2/3 at 0x........ size 4
    at 0x........: th (hg04_race.c:10)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside local var "shared"
 declared at hg04_race.c:6, in frame #? of thread 2
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 2 at 0x........ size 4
+Conflicting store by thread 2/3 at 0x........ size 4
    at 0x........: th (hg04_race.c:10)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside local var "shared"
 declared at hg04_race.c:6, in frame #? of thread 2
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 02910761f81082e940d32b2383922016b0176ef8..876b30205e8bff4538e2b97e21383c35daa3fa79 100644 (file)
@@ -1,27 +1,27 @@
 
 Thread 2:
-Conflicting load by thread 2 at 0x........ size 4
+Conflicting load by thread 2/3 at 0x........ size 4
    at 0x........: th (hg05_race2.c:17)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
 declared at hg05_race2.c:24, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 2 at 0x........ size 4
+Conflicting store by thread 2/3 at 0x........ size 4
    at 0x........: th (hg05_race2.c:17)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
 declared at hg05_race2.c:24, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 7e73726e73bd2d9098b00c828fa4138074ec292b..560d313b71c7d6c2153c1784e61d58aff6e2d9a8 100644 (file)
@@ -1,27 +1,27 @@
 
 Thread 2:
-Conflicting load by thread 2 at 0x........ size 4
+Conflicting load by thread 2/3 at 0x........ size 4
    at 0x........: thread (rwlock_race.c:?)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside local var "s_racy"
 declared at rwlock_race.c:17, in frame #? of thread 2
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 2 at 0x........ size 4
+Conflicting store by thread 2/3 at 0x........ size 4
    at 0x........: thread (rwlock_race.c:?)
    by 0x........: vg_thread_wrapper (drd_pthread_intercepts.c:?)
    by 0x........: (within libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
 Location 0x........ is 0 bytes inside local var "s_racy"
 declared at rwlock_race.c:17, in frame #? of thread 2
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 Result: 2
 
index ccd4d003dd740e0b4fe31429a5664275e9876275..b02899a281f2def696abeffc291d370de5ba0a18 100644 (file)
@@ -1,20 +1,20 @@
 
-Conflicting load by thread 1 at 0x........ size 8
+Conflicting load by thread 1/1 at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
 declared at sem_as_mutex.c:48, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 1 at 0x........ size 8
+Conflicting store by thread 1/1 at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
 declared at sem_as_mutex.c:48, in frame #? of thread 1
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index abe4f211e3ab6ed7dff302e7498eec4de4ae3533..28db43ac5afb5985c77334914782217210c06bce 100644 (file)
@@ -1,20 +1,20 @@
 
-Conflicting load by thread 1 at 0x........ size 4
+Conflicting load by thread 1/1 at 0x........ size 4
    at 0x........: main (tc01_simple_race.c:28)
 Location 0x........ is 0 bytes inside global var "x"
 declared at tc01_simple_race.c:9
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 1 at 0x........ size 4
+Conflicting store by thread 1/1 at 0x........ size 4
    at 0x........: main (tc01_simple_race.c:28)
 Location 0x........ is 0 bytes inside global var "x"
 declared at tc01_simple_race.c:9
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 35bfc961afec5bf083190b5fba5d3964fad99167..4454700d5893e2dc4e5259c60b007086cde6eb46 100644 (file)
@@ -1,20 +1,20 @@
 
-Conflicting load by thread 1 at 0x........ size 1
+Conflicting load by thread 1/1 at 0x........ size 1
    at 0x........: main (tc16_byterace.c:34)
 Location 0x........ is 0 bytes inside bytes[4],
 a global variable declared at tc16_byterace.c:7
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
-Conflicting store by thread 1 at 0x........ size 1
+Conflicting store by thread 1/1 at 0x........ size 1
    at 0x........: main (tc16_byterace.c:34)
 Location 0x........ is 0 bytes inside bytes[4],
 a global variable declared at tc16_byterace.c:7
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 1efc93fe233f3d391c1a6ac30b309a540e7fec94..6a60bc01d8d79527f86d31cf574e982cdcebba8b 100644 (file)
@@ -5,13 +5,13 @@
 
 ---------------- pthread_create/join ----------------
 
-Conflicting store by thread 1 at 0x........ size 2
+Conflicting store by thread 1/1 at 0x........ size 2
    at 0x........: main (tc20_verifywrap.c:78)
 Location 0x........ is 0 bytes inside global var "unprotected"
 declared at tc20_verifywrap.c:27
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ---------------- pthread_mutex_lock et al ----------------
index b02f57cf517adfff7e6deb9857415ffe9916349e..7345f23b78da9b1d0b1474804f403ca3ad33b4c5 100644 (file)
@@ -5,13 +5,13 @@
 
 ---------------- pthread_create/join ----------------
 
-Conflicting store by thread 1 at 0x........ size 2
+Conflicting store by thread 1/1 at 0x........ size 2
    at 0x........: main (tc20_verifywrap.c:78)
 Location 0x........ is 0 bytes inside global var "unprotected"
 declared at tc20_verifywrap.c:27
-Other segment start (thread 2)
+Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
-Other segment end (thread 2)
+Other segment end (thread 0/2)
    (thread finished, call stack no longer available)
 
 ---------------- pthread_mutex_lock et al ----------------