|
From: Craig C. <cc...@us...> - 2005-06-15 20:15:21
|
On Fri, Jun 10, 2005 at 05:14:46PM -0400, Craig Chaney wrote: Hi, This patch applies to Paul Mackerras' latest Valgrind PPC port (http://valgrind.org/downloads/pmk/valgrind-2.4.0-ppc.tar.bz2). I discovered that the previous patch depended on sys_sigreturn running after a signal handler, which won't happen when you longjmp out of the signal handler. Hopefully the third time's a charm... The attached patch cleans up a couple of errors regarding sharing gpr3: 1. When a signal that was blocked by a thread was received, and then later unblocked via sigprocmask, the first argument to the signal handler for that delayed signal was wrong. In valgrind's sys_sigprocmask implementation, we were setting up the signal handler environment (including inserting the first argument's value into gpr3) before setting the sigprocmask return value, which eventually overwrote the arg1 value. By the time the signal handler executed, its first argument (sigNo) was wrong (typically it was zero, which would have been sigprocmask's return value). 2. When receiving a signal that interrupts a system call, we correctly set gpr3 during the execution of vg_async_signalhandler (either to EINTR or to the system call's arg1, depending on whether the syscall would be resumed or not). This value was overwritten by the return value of sys_sigreturn before it got used. Important: the patches in the two parent posts (named sigprocmask.patch and gpr3.patch) are superceded by this patch. Thanks, Craig -- Craig Chaney cc...@us... |