Help regarding the VM Execution Aborted problem

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

Help regarding the VM Execution Aborted problem

Postby capnbunnypaws » Mon Aug 23, 2021 9:22 am

Hello,

I am posting again, because the GZDoom community has greatly helped me in resolving the issues. I have attempted to troubleshoot on my own, but to no success.

My friend and I currently have a VM Execution Aborted problem, specifically towards the aquiring of health, or something, of an actor for TPHPBARS.zc and getting a NULL value(?). We do not know how this error happens, but it has consistently happened throughout our playthroughts, at some point during HeXen's first hub. We usually just reload the map and move on, but maybe someone has a more elegant solution?

Details:
We are using LZDoom version 3.88a;
Mod used: https://drive.google.com/file/d/16mtweg ... sp=sharing
Save File: https://drive.google.com/file/d/1iv9FLP ... sp=sharing
Crash Screenshot: https://drive.google.com/file/d/1wmDHOo ... sp=sharing
capnbunnypaws
 
Joined: 25 Jul 2021

Re: Help regarding the VM Execution Aborted problem

Postby Player701 » Tue Aug 24, 2021 4:35 am

The error happens inside one of the mod's scripts, so you should probably ask the mod's author to fix it, provided that they support LZDoom in the first place. It's quite possible though that this is not related to the version of GZDoom/LZDoom being used, since using an incompatible version would have most likely resulted in the engine refusing to run the mod at all. There is also a slight chance that it might be an engine bug (especially if it appears to happen randomly) but it should probably be investigated by the mod's author(s) first, anyway.

It looks like this is the mod you're using, but it doesn't seem to be an official release - could be an unofficial patch or something; the latest official version appears to be V3A but yours is 4 (?), and I couldn't find any mentions of "woc_4.pk3" here except for this thread, which also appears to be made by you. If you know where you got it from, you could ask there. It doesn't look like the original author has been active on these forums recently, but other people who use that mod may still be able to help you, so you could try posting in the WoC thread too.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Help regarding the VM Execution Aborted problem

Postby Graf Zahl » Tue Aug 24, 2021 6:10 am

This looks like the mod calls Actor.CountInv with a null pointer as self. If that is the case it's clearly a mod bug.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Help regarding the VM Execution Aborted problem

Postby capnbunnypaws » Wed Aug 25, 2021 11:27 am

Graf Zahl wrote:This looks like the mod calls Actor.CountInv with a null pointer as self. If that is the case it's clearly a mod bug.


Thank you for clarifying. If it is not too much to ask, could you point out potential fixes to the issue? I am still learning to ZScript and could use the guidance.
capnbunnypaws
 
Joined: 25 Jul 2021

Re: Help regarding the VM Execution Aborted problem

Postby capnbunnypaws » Wed Aug 25, 2021 11:30 am

Player701 wrote:The error happens inside one of the mod's scripts, so you should probably ask the mod's author to fix it, provided that they support LZDoom in the first place. It's quite possible though that this is not related to the version of GZDoom/LZDoom being used, since using an incompatible version would have most likely resulted in the engine refusing to run the mod at all. There is also a slight chance that it might be an engine bug (especially if it appears to happen randomly) but it should probably be investigated by the mod's author(s) first, anyway.

It looks like this is the mod you're using, but it doesn't seem to be an official release - could be an unofficial patch or something; the latest official version appears to be V3A but yours is 4 (?), and I couldn't find any mentions of "woc_4.pk3" here except for this thread, which also appears to be made by you. If you know where you got it from, you could ask there. It doesn't look like the original author has been active on these forums recently, but other people who use that mod may still be able to help you, so you could try posting in the WoC thread too.


That is because it is a personally tweaked mod, not an Official one, as mentioned in that last post I made, and I was aware that it had an issue. I simply wished to ask the experts specifically, since I do not have the tools/knowledge to debug the error. Thank you for the guidance, though, it does help a lot. :)
capnbunnypaws
 
Joined: 25 Jul 2021

Re: Help regarding the VM Execution Aborted problem

Postby Player701 » Wed Aug 25, 2021 11:44 am

capnbunnypaws wrote:Thank you for clarifying. If it is not too much to ask, could you point out potential fixes to the issue? I am still learning to ZScript and could use the guidance.

If you're calling a method on an object, you have to make sure the object is not null, or a VM abort will happen.

E.g.

Code: Select allExpand view
if (somebody != null)
{
    return somebody.CountInv('Clip');
}

return 0; // or whatever else you want to do when your actor is null

However, it is not always that simple. Most of the time, it doesn't make sense to pass a null pointer in the first place, so you have to find out why it happened, and place a null check somewhere further up the call chain. It depends on your particular use case. Do not hesitate to ask further questions in the scripting forum especially if you can isolate the problem to a certain extent so that it will be easier to analyze.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Help regarding the VM Execution Aborted problem

Postby capnbunnypaws » Wed Aug 25, 2021 3:20 pm

Player701 wrote:
capnbunnypaws wrote:Thank you for clarifying. If it is not too much to ask, could you point out potential fixes to the issue? I am still learning to ZScript and could use the guidance.

If you're calling a method on an object, you have to make sure the object is not null, or a VM abort will happen.

E.g.

Code: Select allExpand view
if (somebody != null)
{
    return somebody.CountInv('Clip');
}

return 0; // or whatever else you want to do when your actor is null

However, it is not always that simple. Most of the time, it doesn't make sense to pass a null pointer in the first place, so you have to find out why it happened, and place a null check somewhere further up the call chain. It depends on your particular use case. Do not hesitate to ask further questions in the scripting forum especially if you can isolate the problem to a certain extent so that it will be easier to analyze.



Thank you for your help and guidance. The instructions were clear, and I will make the tweaks to the code based on your example. You have been a great help. :)
capnbunnypaws
 
Joined: 25 Jul 2021


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 0 guests