]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Switched to VG_(get_data_description)() for descriptions of addresses in error reports.
authorBart Van Assche <bvanassche@acm.org>
Fri, 7 Mar 2008 18:52:38 +0000 (18:52 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 7 Mar 2008 18:52:38 +0000 (18:52 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7585

13 files changed:
exp-drd/drd_error.c
exp-drd/drd_error.h
exp-drd/tests/filter_stderr
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 05bf4a4267726f6ea0fb33392df121c420d680be..20d3aff2487a9d28e054e455dd7af1359e0bdb4a 100644 (file)
@@ -220,13 +220,20 @@ static
 void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri)
 {
    AddrInfo ai;
-   Char descr[256];
+   Char descr1[256];
+   Char descr2[256];
 
    tl_assert(dri);
    tl_assert(dri->addr);
    tl_assert(dri->size > 0);
-   describe_addr_text(dri->addr, dri->size,
-                      &ai, descr, sizeof(descr));
+
+   descr1[0] = 0;
+   descr2[0] = 0;
+   VG_(get_data_description)(descr1, descr2, sizeof(descr1), dri->addr);
+   if (descr1[0] == 0)
+   {
+      describe_addr(dri->addr, dri->size, &ai);
+   }
    VG_(message)(Vg_UserMsg,
                 "Conflicting %s by %s at 0x%08lx size %ld",
                 dri->access_type == eStore ? "store" : "load",
@@ -234,11 +241,19 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri)
                 dri->addr,
                 dri->size);
    VG_(pp_ExeContext)(VG_(get_error_where)(err));
-   VG_(message)(Vg_UserMsg, "Allocation context: %s", descr);
-   if (ai.akind == eMallocd && ai.lastchange)
+   if (descr1[0])
+   {
+      VG_(message)(Vg_UserMsg, "%s", descr1);
+      VG_(message)(Vg_UserMsg, "%s", descr2);
+   }
+   else if (ai.akind == eMallocd && ai.lastchange)
    {
       VG_(pp_ExeContext)(ai.lastchange);
    }
+   else
+   {
+      VG_(message)(Vg_UserMsg, "Allocation context: unknown.\n");
+   }
    thread_report_conflicting_segments(VgThreadIdToDrdThreadId(dri->tid),
                                       dri->addr, dri->size, dri->access_type);
 }
index 1ef243e0789635a52b5570748c28f1bba0e7caa2..e459034b1984b058da4ca0de67bac133ea7a5a37 100644 (file)
@@ -27,7 +27,7 @@
 #define __DRD_ERROR_H
 
 
-#include "pub_drd_bitmap.h"         // BmAccessTypeT
+#include "pub_drd_bitmap.h"     // BmAccessTypeT
 #include "drd_thread.h"         // DrdThreadId
 #include "pub_tool_basics.h"    // SizeT
 #include "pub_tool_debuginfo.h" // SegInfo
index fd864725ac8fa1ba2ccd05dc65ed964526eefde7..aebffc03c6f06ea47de1f20f251b9d80f868d458 100755 (executable)
@@ -11,7 +11,6 @@ $dir/../../tests/filter_stderr_basic |
 sed \
 -e "/^exp-drd, a data race detector\.$/d" \
 -e "s/^Allocation context: stack of thread \([0-9]*\), offset -[0-9]*$/Allocation context: stack of thread \1, offset .../" \
--e "s/^Allocation context: .*$/Allocation context: unknown/" \
 -e "s/(tc20_verifywrap.c:261)/(tc20_verifywrap.c:262)/" \
 -e "/^NOTE: This is an Experimental-Class Valgrind Tool.$/d"  \
 -e "/^Copyright (C) 2006-200., and GNU GPL'd, by Bart Van Assche.$/d" \
index c9afafd7b1df89e7ef02aa3cf09dd40721e8f4d9..153ce9609089c6262a885a402825a65ab40c8c6c 100644 (file)
@@ -1,7 +1,8 @@
 
 Conflicting load by main at 0x........ size 8
    at 0x........: main (fp_race.c:?)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_d3"
+declared at fp_race.c:47, in frame #0 of thread 1
 Other segment start (thread_func)
    (thread finished, call stack no longer available)
 Other segment end (thread_func)
@@ -9,7 +10,8 @@ Other segment end (thread_func)
 
 Conflicting store by main at 0x........ size 8
    at 0x........: main (fp_race.c:?)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_d3"
+declared at fp_race.c:47, in frame #0 of thread 1
 Other segment start (thread_func)
    (thread finished, call stack no longer available)
 Other segment end (thread_func)
index 274c6a726e120c956fbf9012ecb2870eab857b21..3102848f89b9feb771e325cb9070d142db56a2ac 100644 (file)
@@ -5,7 +5,8 @@ Conflicting store by thread 3 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside shared[1],
+declared at hg03_inherit.c:11, in frame #0 of thread 3
 Other segment start (thread 1)
    at 0x........: pthread_join (drd_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:49)
@@ -19,7 +20,8 @@ Conflicting store by thread 3 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside shared[1],
+declared at hg03_inherit.c:11, in frame #0 of thread 3
 Other segment start (thread 1)
    at 0x........: pthread_join (drd_intercepts.c:?)
    by 0x........: main (hg03_inherit.c:49)
index c713aff4b90431db0d688f8ed2650d23df3f0776..8679d06394c32b35a45bf7d470e242322da551ba 100644 (file)
@@ -5,7 +5,8 @@ Conflicting load by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "shared"
+declared at hg04_race.c:6, in frame #0 of thread 2
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
@@ -16,7 +17,8 @@ Conflicting store by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "shared"
+declared at hg04_race.c:6, in frame #0 of thread 2
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index da70ded1e575507e9bdad5a67ce5d00998377770..743a78fad15d3c0290768002d14c15c61669d799 100644 (file)
@@ -5,7 +5,8 @@ Conflicting load by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
+declared at hg05_race2.c:24, in frame #4 of thread 1
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
@@ -16,7 +17,8 @@ Conflicting store by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
+declared at hg05_race2.c:24, in frame #4 of thread 1
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index 8bf1411d10014ba292943cbdc1601b418c76d445..fdcfccc3aaeb0c7d307ed8a5de5f0c3fe5b38ab9 100644 (file)
@@ -5,7 +5,8 @@ Conflicting load by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_racy"
+declared at rwlock_race.c:17, in frame #0 of thread 2
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
@@ -16,7 +17,8 @@ Conflicting store by thread 2 at 0x........ size 4
    by 0x........: vg_thread_wrapper (drd_intercepts.c:?)
    by 0x........: start_thread (in libpthread-?.?.so)
    by 0x........: clone (in /...libc...)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_racy"
+declared at rwlock_race.c:17, in frame #0 of thread 2
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index 8c396090a93c468a21074c5a5a8edb951ac92be1..8a28a5f0ef90aab158da52671937e756ad98a68e 100644 (file)
@@ -1,7 +1,8 @@
 
 Conflicting load by main at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_d3"
+declared at sem_as_mutex.c:48, in frame #0 of thread 1
 Other segment start (thread_func)
    (thread finished, call stack no longer available)
 Other segment end (thread_func)
@@ -9,7 +10,8 @@ Other segment end (thread_func)
 
 Conflicting store by main at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside local var "s_d3"
+declared at sem_as_mutex.c:48, in frame #0 of thread 1
 Other segment start (thread_func)
    (thread finished, call stack no longer available)
 Other segment end (thread_func)
index 8a2b91a99bcf22c79c69f537bd7dadb507922c77..abe4f211e3ab6ed7dff302e7498eec4de4ae3533 100644 (file)
@@ -1,7 +1,8 @@
 
 Conflicting load by thread 1 at 0x........ size 4
    at 0x........: main (tc01_simple_race.c:28)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside global var "x"
+declared at tc01_simple_race.c:9
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
@@ -9,7 +10,8 @@ Other segment end (thread 2)
 
 Conflicting store by thread 1 at 0x........ size 4
    at 0x........: main (tc01_simple_race.c:28)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside global var "x"
+declared at tc01_simple_race.c:9
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index 84db3ce31f950e5dba1170416633ab14f8800475..35bfc961afec5bf083190b5fba5d3964fad99167 100644 (file)
@@ -1,7 +1,8 @@
 
 Conflicting load by thread 1 at 0x........ size 1
    at 0x........: main (tc16_byterace.c:34)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside bytes[4],
+a global variable declared at tc16_byterace.c:7
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
@@ -9,7 +10,8 @@ Other segment end (thread 2)
 
 Conflicting store by thread 1 at 0x........ size 1
    at 0x........: main (tc16_byterace.c:34)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside bytes[4],
+a global variable declared at tc16_byterace.c:7
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index 40b607d8f732e3aa5f33e1a84b353023e7afa7bb..1ea635c29b25ff938c8aca190fb41001c6554572 100644 (file)
@@ -7,7 +7,8 @@
 
 Conflicting store by thread 1 at 0x........ size 2
    at 0x........: main (tc20_verifywrap.c:78)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside global var "unprotected"
+declared at tc20_verifywrap.c:27
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)
index 4ac981c16fcacfe50edc88c513bc6cb73c8c1c4b..f7fe3a5dfb91a7758385ccbbd014bd794ef7ddb3 100644 (file)
@@ -7,7 +7,8 @@
 
 Conflicting store by thread 1 at 0x........ size 2
    at 0x........: main (tc20_verifywrap.c:78)
-Allocation context: unknown
+Location 0x........ is 0 bytes inside global var "unprotected"
+declared at tc20_verifywrap.c:27
 Other segment start (thread 2)
    (thread finished, call stack no longer available)
 Other segment end (thread 2)