What exactly is hang detect and why does it keep triggering?

What exactly is hang detect and why does it keep triggering?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

What exactly is hang detect and why does it keep triggering?

Post by smoth »

As title says, what is it, why does it keep triggering? Why do we need it?
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: What exactly is hang detect and why does it keep triggering?

Post by zerver »

It helps find bugs, such as deadlocks and infinite loops, in the Spring code, lua code or system drivers. It could falsely trigger either because it is too sensitive or because your computer is too slow.

If you tell about the particular situation where you have a false trigger, we may be able to reduce the sensitivity in a future release. You can also manually increase the timeout seconds (Edit settings -> HangTimeout)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: What exactly is hang detect and why does it keep triggering?

Post by lurker »

What's the default?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: What exactly is hang detect and why does it keep triggering?

Post by smoth »

how do I know what the trigger is? All I get are random assed hex values.
http://pastebin.com/fWj9NmS2
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: What exactly is hang detect and why does it keep triggering?

Post by hoijui »

default is 10s (it was 10ms in earlier releases)

i don't know the details, but it works about like this (using a windows API thing):
if for a period >= hangTimeout, the program stays in a certain part of the code, it is assumed we are in a hang. we have this system in windows only, zerver implemented it.
i don't know how that windows API thing works, how often it checks where the program(-pointer) is, and what is considered one-part-of-the-code.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: What exactly is hang detect and why does it keep triggering?

Post by zerver »

Actually less intelligent than that, it uses a watchdog timer technique, where each Update() or Draw() clears a timer. And it should be implemented for Linux also, just no one did it I guess.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: What exactly is hang detect and why does it keep triggering?

Post by lurker »

No, no, timer's more intelligent. I'd hate to have something detected as 'hung' because it was in the same spot every time it was checked.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: What exactly is hang detect and why does it keep triggering?

Post by smoth »

so my question still remains, why do we get stacktraces on hang? why does it mess with my game?
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: What exactly is hang detect and why does it keep triggering?

Post by zerver »

Those hex values need to be translated in order to make it useful.

You did not tell in what particular situation it happens for you. Do you get a continuous spam or what?

The stack trace tells us where the hang occurred, something that could otherwise be pretty hard to find, in particular if the problem cannot be reproduced easily by someone with a proper development environment set up.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: What exactly is hang detect and why does it keep triggering?

Post by smoth »

Ah, so it might be catching whatever hang it is that you lot introduced in 86? Coolio.

The hangs happen sporadically, and variable times if my infologs are to be believed. i can start copying them to see if I can get a collection of the various errors it yaks up if you desire it.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: What exactly is hang detect and why does it keep triggering?

Post by zerver »

I tried translating the one you provided, but the results did not make any sense. Is this the official 82.6.0 build or some custom build? Any custom builds you will have to translate yourself.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: What exactly is hang detect and why does it keep triggering?

Post by smoth »

spring_0.82.6.1


This one happened when I was doing an icon build during icon generator. predictable io hang with this gadget becomes gadget breaking with the hang detection. Maybe this can shed some insight?
Attachments
infolog.txt
(170.08 KiB) Downloaded 17 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What exactly is hang detect and why does it keep triggering?

Post by abma »

translated: http://spring-stacktrace.pastebin.com/gfJ07Frw

infolog says "Spring 0.82.6.0 (0.82.6)"

please update to current version!
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: What exactly is hang detect and why does it keep triggering?

Post by smoth »

well I will re-re-redownload. but I play on the main lobby.
Post Reply

Return to “Engine”