Spring freezes nearly every game

Spring freezes nearly every game

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Spring freezes nearly every game

Post by very_bad_soldier »

Hi,

I got a pretty bad problem which causes my spring to freeze in midgame in 4 of 5 games. It happens without any obivous reason, the game just freezes, Vista tells me "the program doesnt responds anymore" and I have to close it via the taskManager. While that freeze spring uses one cpu core at full load. Last time I was only microing some units around when it happend. This can happen after 5 minutes but can also happen after 60 minutes. I tried all in last few days, I still have no idea what its coming from. I had this problem some times in the past but at the moment I can barely play a complete game of spring :cry:
My first guess was something with my graphics card but even after some testing I wasnt able to find a reason for it.

These are my specs:
Core2Duo E6300 with 6GB RAM
8800GT
Vista 64Bit
Tested with BA65

This is what I tried already:
-Reinstalled spring in a new directory
-Resetted all settings to default via springsettings.exe
-Updated to latest ForceWare 178.24
-Ran an OpenGL stress test which worked fine
-Turned off threaded-optimization in Nvidia-drivers

While testing stuff I found out that my spring also freezes in the same way if I active and deactive IceUI in the F11 exactly three times. When switching it on for the third time it makes my spring freeze exactly the same way it happens ingame. I dont think it is related to my "main problem" but it is the same result of freezing.

The bad thing is I am not able to reproduce the error spontaneous. Even if I play a game and it works it doesnt mean it cant freeze in the next game :(
So please, any hints are very appreciated, big thanks in advance!

PS. Maybe someone could send me replay of a DSD-BA65 match that lasts at least an hour? I could test if it happens too while watching a replay.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

I appended a debugger last time it happened again, but I dont know where I can translate it. Maybe I can find the cause of the problem with it?

This is the stacktrace of the main thread after pausing the process while it was freezed:

Code: Select all

spring.exe 00800e84
spring.exe 008019e5
user32.dll 75b389b9
user32.dll 75b38911
user32.dll 75b389b9
spring.exe 00a7d2b0
spring.exe 008bb49b
spring.exe 00587b85
spring.exe 0092181f
user32.dll 75b389b9
user32.dll 75b38807
user32.dll 75b389b9
user32.dll 75b38911
user32.dll 75b389b9
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Spring freezes nearly every game

Post by imbaczek »

should help. lemme see...

Code: Select all

(gdb) symbol-file spring_R6740.dbg
Reading symbols from E:\gry\Spring-svn/spring_R6740.dbg...done.
(gdb) info line *0x00800e84
Line 137 of "rts/lib/lua/src/lvm.cpp"
   starts at address 0x800e80 <_Z13luaV_gettableP9lua_StatePK10lua_TValuePS1_S4_
>
   and ends at 0x800e8b <_Z13luaV_gettableP9lua_StatePK10lua_TValuePS1_S4_+11>.
(gdb) info line *0x008019e5
Line 466 of "rts/lib/lua/src/lvm.cpp"
   starts at address 0x8019a0 <_Z12luaV_executeP9lua_Statei+1232>
   and ends at 0x8019f3 <_Z12luaV_executeP9lua_Statei+1315>.
(gdb) info line *0x00a7d2b0
Line 67 of "rts/System/MouseInput.cpp"
   starts at address 0xa7d28f <_ZN16CWin32MouseInput13SpringWndProcEP6HWND__jjl@
16+31>
   and ends at 0xa7d2b3 <_ZN16CWin32MouseInput13SpringWndProcEP6HWND__jjl@16+67>
.
(gdb) info line *0x008bb49b
Line 295 of "rts/Game/Camera.cpp"
   starts at address 0x8bb49b <_ZN7CCamera12CalcPixelDirEii+283>
   and ends at 0x8bb4ab <_ZN7CCamera12CalcPixelDirEii+299>.
(gdb)
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

Big Thanks! Hm, does it make any sense for you? I looked through the source code but I dont even know how the functions of the stacktrace are related to each other but I didnt see anything I would suspect to cause an endless loop.
The last call seems to be something in the Lua-Code, do you think its probably a problem with a LUA-widget? I usually use alot of them.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Spring freezes nearly every game

Post by imbaczek »

this may actually be a loop; try resuming in the debugger and see if stacktraces differ (and where.)

if you download gdb/addr2line and debug symbols (see bibim's site for svn builds), you should be able to trace it yourself. also, there've been reports of windows global shortcut for keyboard layout switching (ctrl+alt or something) as the cause for lockup.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

Ok thanks, I was at least able to step through the assembly and to translate some addresses manually.
So I think I figured out that when the freeze occurs I get somehow stuck in the function luaV_execute in lvm.cpp line 402.
I tested against a running spring: it enters this function and leaves it a short time after again (not that surprising). But in my case he never gets out there again. There is an for(;;)-loop inside that function, probably this loops endlessly without getting to a return-statement.
I forced him to get to the "return" by editing the instruction pointer which at least made spring to throw an unhandled exception and close gracefully (again not very surprising).

That function looks like some low-level-lua-stuff and I really have no idea what is happending there. If somehow who knows about it could take a look at it I would be really happy, big thanks in advance! It really bugs me to freeze up nearly every game after playing it halfway :(
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Spring freezes nearly every game

Post by MelTraX »

The IceUI stuff was an endless recursion.. It was just my bug and will be fixed in the next IceUI update..

Thanks for the report btw :)
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

MelTraX wrote:The IceUI stuff was an endless recursion.. It was just my bug and will be fixed in the next IceUI update..

Thanks for the report btw :)
Nice1, but this seems to be another bug because I disabled IceUI (and some other widgets) for testing purpose some time ago and it still happens. :(
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

I still encounter this bug nearly every game.
I used a widget that logs all calls to other widgets and when they are completed. But it seems not to be a "normal" user widget which freezes.
That was my last idea, I absolutley dont know whats the cause of this. If a dev would help me out with that issue it would be highly appreciated and eternal gratefulness would be yours.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Spring freezes nearly every game

Post by jK »

tip, not all lua errors are caused by lua (remember ground decal crash in 76b1)
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

So, any idea how I could continue to debug this?
Or even how I could reproduce the bug? It doesnt occur when running replays or spectating other games.

I wiped spring completely from my HDD yesterday and reinstalled everything and resetted all settings. I disabled all features in springsettings and just installed a handful of tiny widgets. I also stopped all running background windows processes. But it still happens.
User avatar
caldera
Posts: 388
Joined: 18 Oct 2005, 20:56

Re: Spring freezes nearly every game

Post by caldera »

since a few weeks i also get some freezes in spring, but it happens only once in 10 or 15 games. it doesnt always freeze completely, sometimes it recovers after some time. i also have 8800GT. perhaps its something related to the graphics driver? using a very old one would be a nice try. also in your case its perhaps a hardware problem? perhaps RAM?
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Spring freezes nearly every game

Post by Hoi »

very_bad_soldier wrote:Hi,

I got a pretty bad problem which causes my spring to freeze in midgame in 4 of 5 games. It happens without any obivous reason, the game just freezes, Vista tells me "the program doesnt responds anymore" and I have to close it via the taskManager. While that freeze spring uses one cpu core at full load. Last time I was only microing some units around when it happend. This can happen after 5 minutes but can also happen after 60 minutes. I tried all in last few days, I still have no idea what its coming from. I had this problem some times in the past but at the moment I can barely play a complete game of spring :cry:
My first guess was something with my graphics card but even after some testing I wasnt able to find a reason for it.

These are my specs:
Core2Duo E6300 with 6GB RAM
8800GT
Vista 64Bit
Tested with BA65

This is what I tried already:
-Reinstalled spring in a new directory
-Resetted all settings to default via springsettings.exe
-Updated to latest ForceWare 178.24
-Ran an OpenGL stress test which worked fine
-Turned off threaded-optimization in Nvidia-drivers

While testing stuff I found out that my spring also freezes in the same way if I active and deactive IceUI in the F11 exactly three times. When switching it on for the third time it makes my spring freeze exactly the same way it happens ingame. I dont think it is related to my "main problem" but it is the same result of freezing.

The bad thing is I am not able to reproduce the error spontaneous. Even if I play a game and it works it doesnt mean it cant freeze in the next game :(
So please, any hints are very appreciated, big thanks in advance!

PS. Maybe someone could send me replay of a DSD-BA65 match that lasts at least an hour? I could test if it happens too while watching a replay.
Wernt there more people with that problem? like fang?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Spring freezes nearly every game

Post by aegis »

every time I start spring, without fail, it will sporadically hit a cpu-intensive loop and freeze (delayed response from myself for frame xx) for a bit, and barely be responsive.
pressing B reveals: draw interface has taken copious amounts of my time vs all of the other calls...
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Spring freezes nearly every game

Post by Hoi »

aegis wrote:every time I start spring, without fail, it will sporadically hit a cpu-intensive loop and freeze (delayed response from myself for frame xx) for a bit, and barely be responsive.
pressing B reveals: draw interface has taken copious amounts of my time vs all of the other calls...
I had that with 0.77b3 too at some point, but then it suddenly disappeared.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring freezes nearly every game

Post by ginekolog »

very_bad_soldier wrote:Hi,

I got a pretty bad problem which causes my spring to freeze in midgame in 4 of 5 games. It happens without any obivous reason, the game just freezesF
°

I have THE SAME problem - it never ever happend in 76 and i did not change a thing since then. Will try to digg which thread causes this crap.

BTW my PC is super stable tested with prime95 , ati artefacet finder and video card stability test.

Spec:
E8400
NV 9500GT
win xp
ba65, many widgets, iceui
Last edited by ginekolog on 28 Oct 2008, 19:58, edited 1 time in total.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring freezes nearly every game

Post by ginekolog »

It just froze again. Here is stack log from process explorer:

ntkrnlpa.exe!KiUnexpectedInterrupt+0x8d
ntkrnlpa.exe!PsDereferencePrimaryToken+0x362
ntkrnlpa.exe!KiDeliverApc+0xb3
hal.dll+0x2c35
spring.exe+0x40159d
spring.exe+0x417120
spring.exe+0x40ff21
spring.exe+0x416962
spring.exe+0x416a0f
spring.exe+0x40fd9d
spring.exe+0x2f508f
spring.exe+0x2f51ae
spring.exe+0x30b17e
spring.exe+0x1875b5
spring.exe+0x5223ff
spring.exe+0x67f341
spring.exe+0x1c4d14
spring.exe+0x1b77bd
spring.exe+0x1b79b9
spring.exe+0x634c01
spring.exe+0x10a7
spring.exe+0x1123
kernel32.dll!RegisterWaitForInputIdle+0x49

Also from process explroers cpu history bar i can see that after freeze game uses only CPU (green graph) and no more kernel fucntios like GFX (red graph). It only happens when i actually play, if i leave spring in single player for hours it runs fine. What else to try?

After freeze i have to kill spring.exe.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring freezes nearly every game

Post by ginekolog »

1 Q:

can lua cause freeze ? Can widget?
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Spring freezes nearly every game

Post by TheFatController »

Widgets can freeze and crash spring, or at least I've managed to do accidentally do it when developing stuff...
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring freezes nearly every game

Post by very_bad_soldier »

I used a modified version of Meltrax's widget profiler to test for widget freezes. Instead of profiling, it logs the last called LUA function to a file on harddisk ("luacalls.dbg" in spring-folder). Also it logs when the function gets left again.

Something like this means the function DrawScreen from the widget DGunLimit was entered. ("C" = called). When you see a CL-line (closed) it means the function was left again. This is the normal case.

Code: Select all

C: DGunLimit F: DrawScreen
CL: DGunLimit
If your spring freezes then look into the file. When you see in the file just the line:

Code: Select all

C: DGunLimit F: DrawScreen
Then it means the function was entered but never left again -> you probably freezed inside that function. This method doesnt work to 100% since it can also mean the lua engine was still runnning and you just terminated it when it was inside a LUA function but I think that isnt very likely.

But in my case it was not a freezed widget since I could see both C and CL-line in the logfile.

BTW: I installed a quite old Nvidia-driver and I am testing at the moment, nice idea, thx!

EDIT: Cause of very frequent file writes the widget produces a noticeable lag every few seconds. But I could not get around that sadly...
Attachments
dbg_protocol.lua
Protocol
(4.23 KiB) Downloaded 11 times
Post Reply

Return to “Help & Bugs”