2019-08-24 22:21 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004910Spring engineGeneralpublic2015-07-22 16:32
Reporterabma 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
Product Version100.0+git 
Target VersionFixed in Version 
Summary0004910: check if SIGNAL_NANS can be replaced by feenableexcept()
Descriptionif not, it could be made runtime changeable / always enabled and SIGNAL_NANS removed.
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0015020

abma (administrator)

maybe as alternative if feenableexcept() / _control87() leads to the same result:
http://en.cppreference.com/w/cpp/numeric/fenv

~0015021

abma (administrator)

Last edited: 2015-07-20 15:31

View 2 revisions

with this (--std=c++11)

// g++ -fno-signaling-nans -std=c++11 test.cpp -o signal-nans
#include <stdio.h>
#include <cfenv>

int main()
{
        feenableexcept(FE_ALL_EXCEPT);
        std::feraiseexcept(FE_ALL_EXCEPT);
        printf("%f\n", 1.0f / 0.0f);
        return 0;
}


i get Floating point exception (core dumped), soo...?!

~0015026

jK (developer)

The engine uses that already.
Just for lua it's disabled, cause: any usage of math.huge would trigger a SIGFPE.
Crashing on such is not an option, so the engine only handles NANs when they leave lua & enter engine code.

~0015028

abma (administrator)

code reference:

https://github.com/spring/spring/blob/036b798fefe0e4a3bc82be8ecb8aa8806a6a9263/rts/System/Sync/FPUCheck.cpp#L108

so, more specific: anything against making #if defined(__SUPPORT_SNAN__) a config setting?

~0015029

jK (developer)

Last edited: 2015-07-22 16:32

View 2 revisions

only when SIGNAL_NANS is enabled, else it would raise in lua too and cause a lot crashes.

+Notes

-Issue History
Date Modified Username Field Change
2015-07-20 15:22 abma New Issue
2015-07-20 15:22 abma Description Updated View Revisions
2015-07-20 15:26 abma Note Added: 0015020
2015-07-20 15:28 abma Note Added: 0015021
2015-07-20 15:31 abma Note Edited: 0015021 View Revisions
2015-07-20 15:32 abma Summary check if SIGNAL_NANS is slower than regular build => check if SIGNAL_NANS can be replaced by feenableexcept()
2015-07-22 03:53 jK Note Added: 0015026
2015-07-22 11:55 abma Note Added: 0015028
2015-07-22 16:32 jK Note Added: 0015029
2015-07-22 16:32 jK Note Edited: 0015029 View Revisions
+Issue History