Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game freeze: Infinite loop detected when sweeping things list (stable) #674

Closed
Loobinex opened this issue Oct 24, 2015 · 7 comments

Comments

@Loobinex
Copy link

commented Oct 24, 2015

Playing a map in 0.4.6.1714( stable), my game froze up after playing about an hour. Looking at the log I don't think it is the pathfinding bug.

Attached a 7zip file with the log file, a packet file and a save game made about 45 seconds before the hang: hang.7z

The hang is reproducible, I loaded the save, continued playing, and the game froze again. Before it freezes the bottom side of the screen goes black several times. Log of second freeze: log2.7z

Loading the save game in 0.4.6 main will also give a freeze there, however before this I managed to complete the map in that version just fine.

@Loobinex Loobinex changed the title Game freeze (stable) Game freeze: Infinite loop detected when sweeping things list (stable) Oct 24, 2015

@mefistotelis

This comment has been minimized.

Copy link
Member

commented Oct 24, 2015

This specific list of things is called "mapwho", and for every subtile, it contains a list of things that stand there.

As usual in such case, the mapwho chain was already damaged when you saved your game. I can't tell when this happened. I might try the packet file, but I need the map you were playing.

Anyway I added workaround for this, which may also help in fixing - when a damaged chain is first detected, the game will cut it and log an error message.

@Loobinex

This comment has been minimized.

Copy link
Author

commented Oct 24, 2015

Map attached. I tried packetload, it is synchronized(r1714).

map674.7z

@mefistotelis

This comment has been minimized.

Copy link
Member

commented Oct 24, 2015

I'm getting a desync on turn 20639...
And that after I fixed an issue with pause which was causing desync at 14000,

It would be great if the packets were more reliable; but as of now I have no idea how to even debug them.

@Loobinex

This comment has been minimized.

Copy link
Author

commented Oct 24, 2015

How do you want to proceed on this issue?

This was the first map I played on the stable build, although it's a map with a lot going on. So right now we have a 100% failure rate,....
Over the next few days I'll play some maps of the map list on the stable branch and see if I have more problems or if this was a rare situation.

@mefistotelis

This comment has been minimized.

Copy link
Member

commented Oct 24, 2015

It is evident that there is invalid memory write - likely accessing array element outside bounds.

These are always hard issues to handle. If KeeperFX was fully rewritten, I would use Valgrind on it. But as of now - I can only improve the packets system and hope the problem will happen again.

Note that in r1719 or newer, if this happens, system (most likely) won't hang - it will just log an error like:
"Non-existing thing index .... in mapwho ..... index ....!"
There aren't many error messages with exclamation mark at end, so it's easy to find in log.

@Loobinex

This comment has been minimized.

Copy link
Author

commented Nov 1, 2015

I've played several games since reporting this issue, have been checking the log file after each game, but never any mention of 'mapwho' in the log.
I don't think there's any way we can reproduce the issue, so I'm closing it until i accidentally run into it again.

@Loobinex Loobinex closed this Nov 1, 2015

Loobinex added a commit to Loobinex/keeperfx-unofficial that referenced this issue Aug 2, 2016
Cherry picked 1c81c88 - break mapwho chain
Taken part of the 1c81c88 commit to prevent  a hang. See
dkfans/keeperfx#674
@Loobinex

This comment has been minimized.

Copy link
Author

commented Aug 2, 2016

I've managed to reproduce the issue with a proper build and I can confirm it 'fixed'. The game did not hang, but I found the mention in the log. In case you're interested I've attached the log and the package file.

packetlogmapwholvl17.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.