|
From: <sv...@va...> - 2014-07-24 21:00:37
|
Author: philippe
Date: Thu Jul 24 21:00:24 2014
New Revision: 14188
Log:
Describe the lock address in a lock announcement message.
(note that some error messages are not announcing the lock,
which is not that nice).
At least the lock order violation message do not announce locks.
That should be improved/fixed
Modified:
trunk/NEWS
trunk/helgrind/hg_addrdescr.h
trunk/helgrind/hg_errors.c
trunk/helgrind/tests/annotate_rwlock.stderr.exp
trunk/helgrind/tests/locked_vs_unlocked1_fwd.stderr.exp
trunk/helgrind/tests/locked_vs_unlocked1_rev.stderr.exp
trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp
trunk/helgrind/tests/locked_vs_unlocked3.stderr.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Thu Jul 24 21:00:24 2014
@@ -18,16 +18,18 @@
the block size - 8. This is e.g. used by sqlite3MemMalloc.
* Helgrind:
- - Helgrind GDB server monitor command 'info locks' giving
- the list of locks, their location, and their status.
- Race condition error message with allocated blocks also show
the thread nr that allocated the racy block.
+ - The message indicating where a lock was first observed now also
+ describes the address/location of the lock.
- Helgrind now understands the Ada task termination rules
and creates a 'H-B relationship' between a terminated task and
its master. This avoids some false positive and avoids big
memory usage when a lot of Ada tasks are created and terminated.
The interceptions are only activated with gnatpro >= 7.3.0w-20140611
or gcc >= ????? (TBD: check when changes pushed to FSF gcc).
+ - Helgrind GDB server monitor command 'info locks' giving
+ the list of locks, their location, and their status.
* Callgrind:
- callgrind_control now supports the --vgdb-prefix argument,
Modified: trunk/helgrind/hg_addrdescr.h
==============================================================================
--- trunk/helgrind/hg_addrdescr.h (original)
+++ trunk/helgrind/hg_addrdescr.h Thu Jul 24 21:00:24 2014
@@ -39,12 +39,6 @@
VG_(clear_addrinfo). */
extern void HG_(describe_addr) ( Addr a, /*OUT*/AddrInfo* ai );
-/* Prints (using *print) the readable description of addr given in ai.
- "what" identifies the type pointed to by addr (e.g. a lock). */
-extern void HG_(pp_addrdescr) (Bool xml, const HChar* what, Addr addr,
- AddrInfo* ai,
- void(*print)(const HChar *format, ...));
-
/* Get a readable description of addr, then print it using HG_(pp_addrdescr)
using xml False and VG_(printf) to emit the characters.
Returns True if a description was found/printed, False otherwise. */
Modified: trunk/helgrind/hg_errors.c
==============================================================================
--- trunk/helgrind/hg_errors.c (original)
+++ trunk/helgrind/hg_errors.c Thu Jul 24 21:00:24 2014
@@ -770,9 +770,15 @@
if (VG_(clo_xml)) {
/* fixme: add announcement */
} else {
- VG_(umsg)( "Lock at %p was first observed\n",
- (void*)lk->guestaddr );
- VG_(pp_ExeContext)( lk->appeared_at );
+ if (lk->appeared_at) {
+ VG_(umsg)( "Lock at %p was first observed\n",
+ (void*)lk->guestaddr );
+ VG_(pp_ExeContext)( lk->appeared_at );
+ } else {
+ VG_(umsg)( "Lock at %p : no stacktrace for first observation\n",
+ (void*)lk->guestaddr );
+ }
+ HG_(get_and_pp_addrdescr) (lk->guestaddr);
VG_(umsg)("\n");
}
}
Modified: trunk/helgrind/tests/annotate_rwlock.stderr.exp
==============================================================================
--- trunk/helgrind/tests/annotate_rwlock.stderr.exp (original)
+++ trunk/helgrind/tests/annotate_rwlock.stderr.exp Thu Jul 24 21:00:24 2014
@@ -102,6 +102,7 @@
Lock at 0x........ was first observed
at 0x........: rwlock_init (annotate_rwlock.c:54)
by 0x........: main (annotate_rwlock.c:161)
+ Address 0x........ is 0 bytes inside data symbol "s_rwlock"
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: 1, at address 0x........
Modified: trunk/helgrind/tests/locked_vs_unlocked1_fwd.stderr.exp
==============================================================================
--- trunk/helgrind/tests/locked_vs_unlocked1_fwd.stderr.exp (original)
+++ trunk/helgrind/tests/locked_vs_unlocked1_fwd.stderr.exp Thu Jul 24 21:00:24 2014
@@ -19,6 +19,7 @@
by 0x........: child_fn (locked_vs_unlocked1.c:18)
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
+ Address 0x........ is 0 bytes inside data symbol "mx"
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: none
Modified: trunk/helgrind/tests/locked_vs_unlocked1_rev.stderr.exp
==============================================================================
--- trunk/helgrind/tests/locked_vs_unlocked1_rev.stderr.exp (original)
+++ trunk/helgrind/tests/locked_vs_unlocked1_rev.stderr.exp Thu Jul 24 21:00:24 2014
@@ -19,6 +19,7 @@
by 0x........: child_fn (locked_vs_unlocked1.c:18)
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
+ Address 0x........ is 0 bytes inside data symbol "mx"
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: 1, at address 0x........
Modified: trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp
==============================================================================
--- trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp (original)
+++ trunk/helgrind/tests/locked_vs_unlocked2.stderr.exp Thu Jul 24 21:00:24 2014
@@ -17,14 +17,17 @@
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
by 0x........: main (locked_vs_unlocked2.c:58)
+ Address 0x........ is 0 bytes inside data symbol "mx2a"
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
by 0x........: main (locked_vs_unlocked2.c:59)
+ Address 0x........ is 0 bytes inside data symbol "mx2b"
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
by 0x........: main (locked_vs_unlocked2.c:57)
+ Address 0x........ is 0 bytes inside data symbol "mx1b"
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: 2, at addresses 0x........ 0x........
Modified: trunk/helgrind/tests/locked_vs_unlocked3.stderr.exp
==============================================================================
--- trunk/helgrind/tests/locked_vs_unlocked3.stderr.exp (original)
+++ trunk/helgrind/tests/locked_vs_unlocked3.stderr.exp Thu Jul 24 21:00:24 2014
@@ -17,6 +17,7 @@
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
by 0x........: main (locked_vs_unlocked3.c:51)
+ Address 0x........ is 0 bytes inside data symbol "mx"
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: none
|