#12873: Clear MMX state in i686 longjmp()
----------------------------------+-----------------------------------------
Reporter: jdemeyer | Owner: jdemeyer
Type: defect | Status: new
Priority: major | Milestone: sage-5.0
Component: c_lib | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Jeroen Demeyer | Merged in:
Dependencies: | Stopgaps:
----------------------------------+-----------------------------------------
Description changed by jdemeyer:
Old description:
> The libc `setjmp`/`longjmp` functions on i686 hardware do not restore the
> x87 FPU state, in particular when MMX instructions have been used. On
> Linux, the FPU state is restored when an interrupt occurs, but on Solaris
> this is not the case.
>
> The proposed solution is to clear the FPU state (using the `EMMS`
> instruction) in the signal handler. For more context, see #12777 where
> this bug was discovered.
>
> To see the problem in action, compile [attachment:emms.c] on i686
> hardware with
> {{{
> gcc -march=pentium2 -m32 -mfpmath=387 -lm emms.c -o emms
> }}}
New description:
The libc `setjmp`/`longjmp` functions on i686 hardware do not restore the
x87 FPU state, in particular when MMX instructions have been used. On
Linux and OS X 10.6, the FPU state is restored when an interrupt occurs,
but on Solaris this is not the case.
The proposed solution is to clear the FPU state (using the `EMMS`
instruction) in the signal handler. For more context, see #12777 where
this bug was discovered.
To see the problem in action, compile [attachment:emms.c] on i686 hardware
with
{{{
gcc -march=pentium2 -m32 -mfpmath=387 -lm emms.c -o emms
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12873#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.