From: Jeremy S. <jas...@pa...> - 2002-09-02 07:22:03
|
Hi Niibe, I saw the recent signal.c and entry.S changes; if I understand correctly, the idea is to make sure that r0 (arg4) is restored correctly when a syscall is restarted (better than providing random arbitrary arguments!) and that strace always sees a new task return 0 from fork(). But after picking them up, I had some problems; here's what seems to be going on. In signal.c:restore_sigcontext(), r0 was never copied back to the exception frame. This was fine when it was copied to a local variable returned by sys_sigreturn() to entry.S:syscall_ret(), since it was put into the exception frame there -- but now that sys_sigreturn() goes directly to ret_from_syscall, the r0 value is not restored; the exception frame retains whatever arbitrary r0 value was left by the signal handler, and when the original syscall resumes (if it was *not* restarted) then the return value is bogus. (Similarly, I suspect that if a process was simply scheduled during a timeslice interrupt and is rescheduled with a pending signal, the r0 value may be stomped on as well.) Simply putting the COPY(regs[0]) in restore_sigcontext() seemed to help with the some of the problems I saw, but maybe not all. Does that seem a reasonable thing to do? Or are all these changes still considered experimental, and I just shouldn't be using them yet? Thanks, --Jeremy Siegel (js...@mv...) |