[Fixed] ChangeSky() ZScript function crashes the game

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

ChangeSky() ZScript function crashes the game

Postby inkoalawetrust » Sat May 29, 2021 8:29 am

While I was writing an example usage of the ZScript ChangeSky() function, for the article about said function. I encountered a peculiar bug that crashes the game if you change the sky to an invalid texture, then try to change it with the changesky CCMD.

I encountered this bug by making a Zombieman variant that calls ChangeSky() on its' PostBeginPlay() virtual, while using invalid texture names for ChangeSky(). Below is the incorrect code I used for the actor. But the bug works if you use any other non-existant texture file/lump.

Code: Select allExpand view
Class SkyChangingZombieman : Zombieman
{
    Override Void PostBeginPlay()
    {
        Super.PostBeginPlay();
        Level.ChangeSky(TexMan.CheckForTexture("<FWATER1>",TexMan.Type_Any),TexMan.CheckForTexture("<NUKAGE1>",TexMan.Type_Any));
    }
}


If this actor is spawned in LZDoom, the sky will change to pitch black as expected, but if you then use the changesky CCMD, the game will have a fatal error. If you use the CCMD before spawning the actor the game does not crash.

This bug occurs on LZDoom 3.87c 32-Bit, on my OpenGL 2.1 desktop, in hardware mode. I've attached the crash log on the post. I would also try it out on software, but I can't since it requires OpenGL 3.0 and above.

Instead someone else (RaveYard) ran the same code in LZDoom 3.87c 64-Bit with OpenGL 4.6, where it also had a fatal error. The crash log from that is below too.
You do not have the required permissions to view the files attached to this post.
User avatar
inkoalawetrust
 
Joined: 26 Aug 2019
Discord: inkoalawetrust #9783
Operating System: Windows Vista/7/2008 32-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Legacy GZDoom)

Re: ChangeSky() ZScript function crashes the game

Postby drfrag » Sat May 29, 2021 8:36 am

And what happens in GZDoom?
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: ChangeSky() ZScript function crashes the game

Postby inkoalawetrust » Sat May 29, 2021 10:38 am

drfrag wrote:And what happens in GZDoom?


Here is RaveYard's bug report from trying the same in GZDoom.

In GZDoom it apperantly immediately crashes if the sky is in view of the player or any camera. It only seems to happen in the software renderer while using the Vulkan backend though.
User avatar
inkoalawetrust
 
Joined: 26 Aug 2019
Discord: inkoalawetrust #9783
Operating System: Windows Vista/7/2008 32-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Legacy GZDoom)

Re: ChangeSky() ZScript function crashes the game

Postby drfrag » Sat May 29, 2021 12:22 pm

Then it wasn't a LZDoom bug, anyway it's fixed. It was a missing null pointer check.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest