Page 1 of 1

Good FPU Control Error Shiit

Posted: 31 Dec 2006, 00:23
by REVENGE
Continues to be cause of much PITA and irritation...argh...

Now, it only happens when I press, then release Alt+Shift, so I have to remember not to do that ingame, which is annoying because I can't build in blocks now...

As for the actual error, it's

Code: Select all

Assertion failed!

Program: Blah\Spring.exe
File: rts\Game\game.cpp
Line: 1375

Expression: good_fpu_control_registers("CGame::Update")

For more information, go post thread on TA: Spring forum and annoy people ingame by crashing all the time...

Blah blah blah...

Posted: 31 Dec 2006, 00:52
by overkill
is that why u keep crashing

Posted: 31 Dec 2006, 01:46
by REVENGE
overkill wrote:is that why u keep crashing
YES! :oops:

/me cries...

Posted: 31 Dec 2006, 13:57
by BaCaMe
Just on a sidenote: Alt+Shift is the standard keycombo to change to a different keyboard input scheme for windows. Maybe this is what's causing the problem somewhow and not Spring itself?

Posted: 03 Jan 2007, 15:03
by Tobi
http://taspring.clan-sy.com/mantis/view.php?id=341:
Changed the code to be a bit less constraining.

In the next version, it will show a warning in infolog.txt and reset the FPU control word to the correct value. You then only have to pray no synced floating point calculations were performed while the control word was wrong, because if that's so you'll probably desync.

Keeping the bug report open because this is just a workaround, not a true solution.

Posted: 03 Jan 2007, 17:51
by jcnossen
Is the FPU control word a per-process thing, or could other running apps also change it?

Posted: 03 Jan 2007, 19:23
by Tobi
It's per process, should be part of the FPU state that's supposed to be saved/restored on task switches. (It's saved with FXSAVE and loaded with FXRSTOR at least.)

So it should be as easy/hard to change by other apps as the rest of the FPU state of another program :-)

EDIT: according to some links and what I thought already, the problem is that in windows lots of system functions load lots of DLLs all in the same context, and some DLLs mess with the FPU control word (they set it in their initialization routine for example).

Posted: 03 Jan 2007, 21:23
by Kloot
I suppose executing an FLDCW on every ENTER_SYNCED would be overkill? :]

Posted: 03 Jan 2007, 21:37
by AF
Has nobody written a 3rd party implementation of these libraries for use in this sort of situation? Surely we cant be the first people to come across this problem in an opensource project.

Posted: 03 Jan 2007, 23:17
by Tobi
Kloot wrote:I suppose executing an FLDCW on every ENTER_SYNCED would be overkill? :]
Hmm, could be possible too. Still have the same issue tho, but less chance for it to happen.