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

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!

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Unrecoverable VM abort when loading game with serialised Canvas and a SkyViewpoint

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

by Xeotroid » Sun May 05, 2024 4:59 am

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.

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

by Axensus » Sun May 05, 2024 1:05 am

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.

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

by Xeotroid » Sat May 04, 2024 4:02 pm

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 7 times

Top