|
From: <sv...@va...> - 2014-05-08 15:14:58
|
Author: sewardj
Date: Thu May 8 15:14:48 2014
New Revision: 13943
Log:
When constructing a signal frame, tell the tool that the registers
that carry the arguments (signo, siginfo, mcontext) for the handler,
have been written. In particular this makes Memcheck think
(correctly) they are defined and so removes a bunch of false positives
that can happen in the signal handler, should the registers have been
marked undefined before the signal.
The same fix needs to be applied to various other of these
sigframe-*.c files.
Modified:
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c Thu May 8 15:14:48 2014
@@ -521,6 +521,16 @@
tst->arch.vex.guest_RDI = (ULong) siginfo->si_signo;
tst->arch.vex.guest_RSI = (Addr) &frame->sigInfo;
tst->arch.vex.guest_RDX = (Addr) &frame->uContext;
+ /* And tell the tool that these registers have been written. */
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid,
+ offsetof(VexGuestAMD64State,guest_RIP), sizeof(UWord) );
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid,
+ offsetof(VexGuestAMD64State,guest_RDI), sizeof(UWord) );
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid,
+ offsetof(VexGuestAMD64State,guest_RSI), sizeof(UWord) );
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid,
+ offsetof(VexGuestAMD64State,guest_RDX), sizeof(UWord) );
+
/* This thread needs to be marked runnable, but we leave that the
caller to do. */
|