Unrecoverable VM abort when loading game with serialised Canvas and a SkyViewpoint

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Xeotroid
Posts: 443
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Unrecoverable VM abort when loading game with serialised Canvas and a SkyViewpoint

Post by Xeotroid »

Normally if you forget to mark a Canvas reference with transient, save a game, and attempt to load it, you get the error, "Attempt to instantiate abstract class Canvas." There's nothing unusual here, this is expected.

However, if there's a SkyViewpoint also present in the level, you instead get the following error:

Code: Select all

VM execution aborted: tried to read from address zero.
Called from SkyViepoint.OnDestroy at gzdoom.pk3:zscript/actors/shared/skies.zs, line 64
There doesn't need to be any F_SKY displaying the 3D skybox, the canvas can be completely unrelated to a skybox, and it doesn't have to be used anywhere in the map. All that is needed is a member variable of type Canvas somewhere in ZScript (so that it can be serialised), and a SkyViewpoint present somewhere in the map. What's more bizarre (and more severe) is that this prevents you from starting any map in the session, be it restarting the current map or even starting a stock Doom 2 map. The whole engine has to be restarted.

I've attached a simple example map with a handler that stores a Canvas reference in a variable and assigns it a texture. The map contains an F_SKY that shows a skybox, and the canvas is used directly in the level, assigned to a TEXTURES texture, but neither of those is necessary to cause the issue.

You can check this video too, showing the expected behaviour and then the unexpected one after adding a SkyViewpoint:
Attachments
canvasSkyCrash.pk3
(7.4 KiB) Downloaded 6 times
Axensus

Re: Unrecoverable VM abort when loading game with serialised Canvas and a SkyViewpoint

Post by Axensus »

It's not a canvas issue specifically. This also happens if you have a TITLEMAP with a skybox and try loading a broken save game (though not always). Closing the console would throw you back to the titlemap which would immediately abort, resulting in a softlock. It's been a problem for a long, long time, albeit small and specific enough to not get reported.
User avatar
Xeotroid
Posts: 443
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: Unrecoverable VM abort when loading game with serialised Canvas and a SkyViewpoint

Post by Xeotroid »

Yeah, it took me a while to even figure out where the crash is coming from in a big clustermuck of a mod (incidentally from a part related to skyboxes), and I didn't even realise the fact that it's not needed to actually have a sky portal, use the canvas in the map, or draw to it until pretty much after writing the report.
Post Reply

Return to “Bugs [GZDoom]”