Index: coregrind/m_sigframe/sigframe-x86-linux.c
===================================================================
--- coregrind/m_sigframe/sigframe-x86-linux.c	(revision 5643)
+++ coregrind/m_sigframe/sigframe-x86-linux.c	(working copy)
@@ -122,6 +122,7 @@
    struct _vki_fpstate fpstate;
 
    struct vg_sigframe vg;
+   Addr OldESP;
 };
 
 struct rt_sigframe
@@ -478,6 +534,7 @@
 	     esp, offsetof(struct sigframe, vg) );
 
    frame->sigNo = sigNo;
+   frame->OldESP = tst->arch.vex.guest_ESP;
 
    if (flags & VKI_SA_RESTORER)
       frame->retaddr = (Addr)restorer;
@@ -692,6 +749,22 @@
 
    /* tell the tools */
    VG_TRACK( post_deliver_signal, tid, sigNo );
+
+   if (!isRT && tst->arch.vex.guest_ESP != ((struct sigframe*)esp)->OldESP)
+   {
+       Addr tesp = tst->arch.vex.guest_ESP;
+       Addr oesp = ((struct sigframe*)esp)->OldESP;
+
+       /* reset thread's stack if it has been changed by sig handler */
+       VG_(extend_stack)(tesp, tst->client_stack_szB);
+
+       VG_(set_SP)(tid, tesp);
+       VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(Addr));
+       if (tesp < oesp && (oesp - tesp) < 512) {
+           VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+                     tesp, oesp - tesp );
+       }
+   }
 }
 
 /*--------------------------------------------------------------------*/
