dsda-doom icon indicating copy to clipboard operation
dsda-doom copied to clipboard

Fix potential hang after restoring keyframe due to invalid blocklist pointers.

Open PeterN opened this issue 6 months ago • 1 comments

Fix potential hang after restoring keyframe due to invalid blocklist pointers.

When restoring a keyframe, the blockmap is not cleared and blocklist pointers are modified during P_UnArchiveThinkers. The blockmap is then restored in UnArchiveBlockLinks, but this can leave blocklist pointers in an invalid state.

This can then lead to a hang later when the blocklist is iterated and may get stuck in an infinite loop.

The hang is fairly easy to reproduce using Legacy of Rust when Vassago are present after using keyframe restore.

I chose to simply wipe the blocklist pointers during restoring as this avoids adding extra functions or modifying much existing code. It's basically brute-forcing it.

PeterN avatar Aug 21 '24 18:08 PeterN