View Issue Details

IDProjectCategoryView StatusLast Update
0005296The Dark ModCodingpublic17.07.2020 17:53
Reporterstgatilov Assigned Tostgatilov  
PrioritylowSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionTDM 2.09 
Target VersionTDM 2.09Fixed in VersionTDM 2.09 
Summary0005296: Implement FP exceptions handling: crash on NaN
DescriptionThere have been nasty bugs when NaN appear in the data, get silently propagated across dataflow, causing a crash in another place.
On x64, it is possible to configure FP exceptions, for instance cause a crash when NaN appears.
It would be great to implement a developer mode which works this way.
Additional InformationSee also original discussion on forums:
  https://forums.thedarkmod.com/index.php?/topic/19093-generate-fp-exceptions
TagsNo tags attached.

Activities

stgatilov

stgatilov

16.07.2020 16:38

administrator   ~0012656

Last edited: 16.07.2020 16:38

View 2 revisions

The main commits are:
  r8846 New sys function FPU_SetExceptions --- implemented only on Windows.
  r8848 Added cvar com_fpexceptions to enable/disable exceptions. Also implemented idIgnoreFpExceptions scope guard --- not used yet.
  r8850 Ignore FP exceptions in several SIMD routines. They are known to have NaN as intermediate values, or to accept NaN from some external calls.

After that catching FP exception works by setting cvar "com_fpexceptions 1"
However, there are many places with NaNs in the code...
stgatilov

stgatilov

16.07.2020 16:51

administrator   ~0012657

Revisions 8851-8854 fix various places where NaNs and overflows happen regularly.
stgatilov

stgatilov

17.07.2020 17:53

administrator   ~0012658

More fixes follow in svn revs 8855-8862.
Hopefully, I did not break anything =)

Right now the following FMs can start and play with "com_fpexceptions 1":
  New Job
  Saint Lucia
  Inn Business
  Behind Closed Doors

I think it should not generate to much trash now, and can be used to debug issues.

Issue History

Date Modified Username Field Change
16.07.2020 12:23 stgatilov New Issue
16.07.2020 12:23 stgatilov Status new => assigned
16.07.2020 12:23 stgatilov Assigned To => stgatilov
16.07.2020 16:38 stgatilov Note Added: 0012656
16.07.2020 16:38 stgatilov Note Edited: 0012656 View Revisions
16.07.2020 16:51 stgatilov Note Added: 0012657
17.07.2020 17:53 stgatilov Note Added: 0012658
17.07.2020 17:53 stgatilov Status assigned => resolved
17.07.2020 17:53 stgatilov Resolution open => fixed
17.07.2020 17:53 stgatilov Fixed in Version => TDM 2.09