On Fri, Nov 30, 2018 at 1:19 AM Waldek Kozaczuk <[email protected]> wrote:
> Unless I made a mistake in the code that verifies fpu state corruption > which showed no corruption I think it might be worth to ponder possibility > of different nature of the root cause of this and other issues where > fmt_fp() shows up in the stack trace. > > What if the problem is actually caused by wrong/incompatible compiler > options that drive what machine code is generated to handle floating point > operation. For example I noticed that when I configured musl independently > on my machine I saw it add following options related to floating point math: > > CFLAGS_C99FSE = -std=c99 -nostdinc -ffreestanding -*fexcess-precision=* > *standard* *-frounding-**math* -Wa,--noexecstack > > I have not enough experience to make any conclusive observations but two > of those -fexcess-precision and -frounding-math do affet code using float, > double, long double etc. I did not see those in main OSv makefile so I > wonder if musl compiled code is wrong and misbehaves. > The gcc manual says that -fexcess-precision=standard is the default if -std=c99 is used. We use -std=gnu99, so I wonder if it also enabled by default. In any case, I doubt (but as usual, not sure), that rounding, in whatever manner, can cause the endless loop we're seeing. > I think FPU has control word with RC fields that control rounding ( > http://www.website.masmforum.com/tutorials/fptute/fpuchap1.htm) what if > our code setups FPU rounding that is incompatible with how we compile musl. > Just wild theory. > > Adding musl math library documentation - > https://wiki.musl-libc.org/mathematical-library.html- there are > paragraphs that talk about rounding and precision. > I never gave this issue any thought, so if you do, and come up with any conclusions, I'll be happy to know. We can easily change the Makefile to compile the Musl code differently, if needed, or set the default FPU control word differently. -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
