[PATCH v3] Cygwin: sigfe: Fix a bug that signal handler destroys fpu states

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Oct 31 10:18:59 GMT 2024


On Oct 31 17:36, Takashi Yano wrote:
> Hi Corinna,
> 
> On Fri, 25 Oct 2024 10:49:51 +0200
> Corinna Vinschen wrote:
> > On Oct 24 17:58, Takashi Yano wrote:
> > > On Tue, 22 Oct 2024 17:58:02 +0200
> > > Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> > > > Hi Takashi,
> > > > 
> > > > big change, so, honest question: Do you think this is safe for 3.5.5?
> > > > 
> > > > This certainly also requires an entry in the release text and there
> > > > are just a few minor typos in comments, see below.
> > > 
> > > What about adopting my first idea to 3.5.5
> > > https://cygwin.com/pipermail/cygwin/2024-October/256506.html
> > > and applying this patch to 3.6.0 branch?
> > 
> > Admittedly, I'm also not deep in FPU stuff.
> > 
> > fnstenv/fldenv and dropping fninit look like a simple approach to fix
> > the worst problem.  Did you just discuss this on the mailing list or did
> > you check that it actually fixes the reported problem?
> 
> I tested locally using Christian's test case and confirmed that
> the problem has been fixed as well as that no new problem occurs.
> 
> > But either way, I wonder if it's worth the effort to have two different
> > solutions.  This isn't a regression, so we don't have to fix this ASAP
> > in 3.5.5.  It could easily wait a version.
> > 
> > So I'm thinking we should go with your sleek new code in 3.6 and let
> > this simmer for a while, so it's put to use by people running 3.6
> > versions.
> > 
> > Does that sound right?
> 
> Hmm, this is not a regression but a long-standing bug which can
> easily be fixed. Also, there is only a very small risk of regression
> with the fnstenv/fldenv patch. Moreover, the bug causes critical
> miscalculations to result in long double processing.
> 
> So, I think it is better to apply the v3_5-branch patch (I have just
> submitted) for cygwin-3_5-branch, and to apply the v3 patch (I already
> submitted) to the master branch. v3_5-branch patch is simple and small,
> so it will not be so painful to maintain.
> 
> Don't you think so?

I asked because I wasn't sure, but your solution is fine with me.


Thanks,
Corinna


More information about the Cygwin-patches mailing list