-
-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear FPU in i386/x86_64 longjmp() #12873
Comments
comment:1
Well, actually it's not so clear whether |
This comment has been minimized.
This comment has been minimized.
comment:3
I can't be sure that the problem is limited to Solaris. Using a test program (attached), I managed to reproduce the issue on Linux also. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test program |
comment:6
Attachment: emms.c.gz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:9
Attachment: 12873_emms.patch.gz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Reviewer: Volker Braun |
comment:11
The joys of the x86 architechture! ;-) Patch looks good to me. |
Merged: sage-5.1.beta0 |
Similar test program using setcontext() |
This comment has been minimized.
This comment has been minimized.
comment:14
Attachment: context.c.gz #13076 fixes this problem in a much better way, so that ticket effectively undoes this. |
If an interrupt occurs during a 387 FPU computation or during an MMX computation (which also uses the FPU registers), then some of the FPU registers will be occupied. This may lead to failures with subsequent FPU compuations, see for example #12777. Some operating systems (e.g. Linux and OS X 10.6) restore the FPU state when an interrupt occurs, but on Solaris this is not the case.
The proposed solution is to clear the FPU "tag word" (using the
EMMS
orFFREE
instructions) in the signal handler.To see the problem in action, compile attachment: emms.c on i686 hardware with
Apply attachment: 12873_emms.patch
Obsoleted by #13076 and fixed in a better way.
CC: @nexttime
Component: c_lib
Author: Jeroen Demeyer
Reviewer: Volker Braun
Merged: sage-5.1.beta0
Issue created by migration from https://trac.sagemath.org/ticket/12873
The text was updated successfully, but these errors were encountered: