]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Fix some bugs in syscall/signal handling:
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Fri, 7 Nov 2003 23:09:48 +0000 (23:09 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Fri, 7 Nov 2003 23:09:48 +0000 (23:09 +0000)
commit4eac75bf3e2dd0ec9356680262d5faeeaba803b2
treebafe4b00aa0b61a7bf1bdedd5c32e79fae4112fa
parent6828a1cbebb7ce9b3076247bb987098fd06db62c
Fix some bugs in syscall/signal handling:

If the proxyLWP for a thread got a signal just as we were sending the
syscall request to it, then we would end up running the syscall twice.
The fix is to not check the results pipe while sending the syscall request
- wait until we're in a better state for handling signals (the deadlock
the results-read was supposed to avoid cannot actually happen).

Related to that, if we're delivering a signal to a thread, and that thread
is currently waiting for a syscall to complete, make sure we collect the
syscall results before entering the signal handler (otherwise we may end
up bogusly trying to restart the syscall by moving EIP back, even though
it now points to the signal handler rather than the syscall instruction)

This change also adds an assertion to VG_(restart_syscall) to make sure
we were actually restarting a syscall and not just randomly changing EIP
(this found the problem above).

Also, make set/getitimer run in the proxyLWP context, so that they
modify/read the proxyLWP's timers rather than the schedluer LWP's timers.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2013
coregrind/vg_include.h
coregrind/vg_mylibc.c
coregrind/vg_proxylwp.c
coregrind/vg_signals.c
coregrind/vg_syscalls.c
docs/proxylwp.sxw
include/valgrind.h
include/vg_kerneliface.h