| Summary: | the signal handler's ucontext doesn't get any FPU state | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Jeremy Fitzhardinge <jeremy> |
| Component: | general | Assignee: | Jeremy Fitzhardinge <jeremy> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | johan.walles, mcguire, tjt |
| Priority: | NOR | ||
| Version First Reported In: | 2.1 CVS | ||
| Target Milestone: | --- | ||
| Platform: | Unlisted Binaries | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Jeremy Fitzhardinge
2004-02-05 23:51:28 UTC
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). |