On Sun, 23 Jan 2011, Stefan Sperling wrote: > The patch protects the region around _thread_machdep_restore_float_state(), > which severly messes with the stack of the current thread, from being > interrupted by signals. > Please test. This problem could also affect other applications. > > I'm not sure of the bit making sig_defer_count volatile is needed, > but it does have an effect on the assembly code generated for > _thread_kern_sig_defer() and _thread_kern_sig_undefer().
Like Federico, I want to eyeball this part a bit more closely before oking it. The other thing I need to finish double checking is whether the nesting of _thread_kern_in_sched vs _queue_signals is correct here: > @@ -481,6 +487,9 @@ _thread_kern_sched(struct sigcontext * s > */ > curthread = _get_curthread(); > _thread_kern_in_sched = 0; > + > + /* Allow signals again. */ > + _queue_signals = 0; > > /* run any installed switch-hooks */ > if ((_sched_switch_hook != NULL) && ...or whether the order should be flipped. The core idea makes sense to me though. I should be able to finish reviewing in the next couple days. Philip