|
From: Jeremy F. <je...@go...> - 2003-10-21 22:34:35
|
On Tue, 2003-10-21 at 04:30, Tom Hughes wrote:
> My real problem seems to be that the waitpid is sometimes returning a
> nonsense error of -512 at the system call level. I've written a little
> test program, which is attached, and when it is run under valgrind
> this is what I see:
OK, there seems to be some slight timing difference between 2.4-RH and
2.6, or something. Anyway, I think this is the right fix - can you test
it out?
Index: vg_syscalls.c
===================================================================
RCS file: /cvsroot/valgrind/valgrind/coregrind/vg_syscalls.c,v
retrieving revision 1.50
diff -c -r1.50 vg_syscalls.c
*** vg_syscalls.c 19 Oct 2003 16:46:06 -0000 1.50
--- vg_syscalls.c 21 Oct 2003 22:12:12 -0000
***************
*** 4467,4472 ****
--- 4467,4482 ----
VGP_POPCC(VgpSkinSysWrap);
}
+ if (tst->m_eax == -VKI_ERESTARTSYS) {
+ /* Applications never expect to see this, so we should actually
+ restart the syscall (it means the signal happened before the
+ syscall made any progress, so we can safely restart it and
+ pretend the signal happened before the syscall even
+ started) */
+ tst->m_eax = tst->syscallno;
+ tst->m_eip -= 2; /* sizeof(int $0x80) */
+ }
+
tst->status = VgTs_Runnable; /* runnable again */
tst->syscallno = -1;
J
|