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,
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. */
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");
}
}
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........
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
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........
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........
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