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",
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);
}
#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
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" \
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)