When a signal handler for CPU excepton is called, it gets passed a ucontext structure, which contains the CPU state at the time of the exception. Valgrind doesn't pass the handler any FPU/SSE related information; the fpstate pointer is left NULL. This makes Mesa-6.0 crash, because it looks at the fpstate when it's checking that SSE is properly supported.
confirmed.
Well, this turns out to be tricky to fix, at least for Mesa. Mesa wants to do the hardest of all things - it wants to take an FPU exception, inspect the up-to-date FP state in the handler, then modify it, returning to the original instruction. Valgrind really isn't set up for this. Firstly, because of bug 69530, we can't give up-to-date FPU state to the handler. Secondly, the signal frame is constructed so that there are two copies of the VCPU state - one for the handler to see, and one which is used to restore the state when the handler returns, so if the handler does change the state, it isn't the one which takes effect. The second problem can be fixed reasonably easily, but the first is much harder. The workaround we can apply now is to save the FP state before each potentially faulting instruction, but this is hard work and potentially a huge performance hit. Not really sure what to do here.
Well, it can be made to work, but only if you use --single-step=yes.
*** Bug 86641 has been marked as a duplicate of this bug. ***
*** Bug 95667 has been marked as a duplicate of this bug. ***
OK, signal handlers now get state. You still need to use --single-step=yes if you want accurately inspect/modify it from the handler (as Mesa wants to do).