From: Ralf Baechle <[EMAIL PROTECTED]>
Date: Tue, 8 Aug 2006 12:04:37 +0100
> We were able to trigger this when debugging a multithreaded programs.
> At least i386 uses virtually identical algorithms so I think is likely
> to have the same issue.
Other platforms, including x86, clear the state out in one way or
another before the next iteration.
Actually on x86 it occurs as a side effect of setting
regs->eax, it is reset to the system call number requested
at syscall trap time, so it will not match any of the
error return values in this switch statement:
/* Are we from a system call? */
if (regs->orig_eax >= 0) {
/* If so, check system call restarting.. */
switch (regs->eax) {
case -ERESTART_RESTARTBLOCK:
case -ERESTARTNOHAND:
regs->eax = -EINTR;
break;
case -ERESTARTSYS:
if (!(ka->sa.sa_flags & SA_RESTART)) {
regs->eax = -EINTR;
break;
}
/* fallthrough */
case -ERESTARTNOINTR:
regs->eax = regs->orig_eax;
regs->eip -= 2;
}
}
So after the first iteration, the next time through here we
won't be "from a system call".
-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html