VX Ace game crashing with null dereference exception

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
I posted this in the VX Ace area, but I think that wasn't the right place. I tried moving the post, but saw no option for that.

Anyway, I have a crash on reloading that is the actual underlying RPG maker dll crashing on a null dereference exception:

First-chance exception at 0x10111A1C (RGSS301.dll) in Game.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x10111A1C (RGSS301.dll) in Game.exe: 0xC0000005: Access violation reading location 0x00000000.
I have a crash dump (edit: now removed b/c we're not supposed to attach debuggers to the RPGMaker engine) as well, if that would be useful. I would love to have this fixed, although I know VX Ace is pretty old and random crashes might be out of servicing. If no fix, I would be deeply grateful if I could get symbols or get a description of the crash from someone with symbols, so that I might have a prayer of avoiding it in my ruby code.

If it is useful: the crash seems to happen just after I've reloaded (upon player death), but the crash itself isn't during the load process. The screen has already drawn at least once in the post-load state before the game window freezes and vanishes. It does not happen on every load, but if I put the game into a death\reload loop, it will usually repro within 50-200 cycles. Despite the relatively low frequency, every play tester of my game has hit this crash within an hour, so it's not something I could ship with. And, without any hints, figuring out what the issue is seems nearly impossible.
 
Last edited:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,403
Reaction score
14,132
First Language
English
Primarily Uses
RMVXA
Oddly enough I released an ACE game and no one has hit this issue in my game even with 99+ hours playtime, so am curious how it is hitting it. I wonder if you have a script included 2x or something that is ballooning memory size or something? Or if there is something odd in how your game is being saved that is causing it?

Maybe start by showing us what scripts you have in the game? And what directory is the game in? Windows can cause odd errors if you put the game in certain directories I've heard.

the other thought is you have a bad DLL. Are you using the high res unofficial DLL by chance?

As for where to post this, ACE might have been better for it honestly. I'll put it over there since this will probably come into something ACE specific.
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
For what it's worth, I am fairly sure I am triggering the problem, even if null derefs should in theory never happen ;) I suspect something in the way I'm setting something up is triggering a code path that the underlying engine doesn't normally hit and that's why it's crashing. So, I am not at all surprised that other folks have released games that never hit this.

I am not using a custom dll, as far as I know. Mine reports itself as modified on 5/20/2013 at 12:00 AM and is 1,085,952 bytes. It reports its version as 3.0.1.1.

I checked on the memory size issue. It took me running 5 minutes straight with the game reloading every 2 seconds (so several hundred loads, which is far more than a normal play session). During that time, the process working set did climb very, very slowly (65MB -> 80MB) and the overall commit size went from 54MB -> 70MB. So, it is possible there's a slow memory leak. However, those sizes aren't remotely close enough to hit virtual memory pressure (and the presumed allocation failures it would cause), especially given the save file being loaded is 51KB.

The game is being run 'in the RPGMaker editor', which for this project is storing its files in an entirely mundane directory (D:\SaturnValley\Destiny).

As to scripts: I have something on the order of 5,000-10,000 lines of custom script in the game, most of which was written by me for this project. I don't want to share that entire thing with the world, although if you think reading it will be useful to you, I am happy to send you my full project. However, the modifications are so extensive that I suspect it'll be an undue burden on your time to even try to read\understand it all. That, BTW, is why I'm so desperate to try and get some hint as to the reason the RPG Maker DLL is crashing... otherwise, I'm looking for a needle in a very large haystack.

Regarding my saves files, in particular: I don't think there's anything particularly odd. I have modified the save file format a bit, although those modifications are patterned on a save file mod (which I've since rewritten and removed), so I don't think anything there is inherently suspect. The load is happening at the end of Scene_Map.update and looks generally fairly much like the normal game load. I can show you the code, if you would like.

If you've got other ideas, I can give you more info or, like I said, if you think it would be useful, I can provide you with a ZIP of the project.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,403
Reaction score
14,132
First Language
English
Primarily Uses
RMVXA
Its possible it is in the custom code. I am a novice at coding but can usually read code, but not the best at writing it. But it might be worth to make a .zip file just to have it ready for those who are good with code. I could try to peak at it yes, as I got a LOT of time right now and I could do that some this weekend. No idea if I could make heads or tails of it but I can give it the old college try. If you want to do that PM me it.

The directory should be fine, only issues I know of is if you try to use a really strange directory like h5$2157 ahaltehaty 1357105!#%!#% with all the spaces and symbols or something like that, as windows can throw fits with symbols and spaces.

Is your dll file called RGSS301.dll? I think it will with what you said, but want to confirm. If it is all I can think of is to get a new copy of the .dll and see if yours got corrupted by accident, as it might be as simple as the dll file is bad too.

I wonder what else others could think of though too? If no other ideas come up you could hire some people in classified -> Offers (be sure they do ACE scripting, as many are MV plug-ins now), I think Sixth has a shop there that is still active?
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
That was like reading a diagnosis for my issue. I have to run to sleep now, but I will ten billion percent give that script a try tomorrow morning. You are amazing :)
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,403
Reaction score
14,132
First Language
English
Primarily Uses
RMVXA
I saw you sent me the code too. I'll probably have to wait til Friday to look at it, so let me know if the script fixes it first too.
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
The script did indeed identify an undisposed sprite, which I fixed. I then ran the game in a death\reload loop for an hour and got zero crashes! That's about 2000 reloads, which is 10x the number I needed for a repro before. So, I think that was the issue!!!!!! :) :) :)

Thank you so much cremnophobia for the pointer, mithran for the nigh miraculous script and bgillisp for the brainstorming!

I'm going to fix one other memory leak the script identified and then release a new, 100% more stable build!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,403
Reaction score
14,132
First Language
English
Primarily Uses
RMVXA
Cool! Glad it worked! Let us know when the new version comes out and I can try to test run it on my toaster of a backup PC.
 

cremnophobia

Veteran
Veteran
Joined
Dec 10, 2013
Messages
214
Reaction score
94
Primarily Uses
Btw. while symbols would've helped somewhat it's actually against the EULA - but not necessarily illegal - to analyze this bug with a debugger/disassembler. I've only made a good guess based on it it being a well known issue since RGSS2. :ewink:
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
Oh! I suppose I can see how that is reasonable, given that disassembling can also be used to hack or steal the RPG Maker engine itself. I obviously didn't intend that, but thank you for the info. I'll avoid doing further debugging against their dll without explicit okay from someone with authority to authorize it. Given this bug is fixed, that should be fairly easy... I have little interest in reverse engineering the engine internals :) I've also removed my dump link above, since sounds like nobody should really be looking at it.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,403
Reaction score
14,132
First Language
English
Primarily Uses
RMVXA
I think the intent of that was to prevent you from copying the DLL illegally though. I didn't say anything as I saw it as intent to fix a bug.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Today's the day I post my demo!
I am having a great day today humans! May your day be great too! Praise the altar.
Recently discovered that an old member called "Kaus" stole some tilesets from other games, claim as yours, and some people associate his nick with mine. Besides having the same name, he was publishing tilesets too. Bad luck? Guess maybe I'll need to change my nickname... :(

My best practices for a new amazing plugin by this author https://kagedesuworkshop.blogspot.com

Forum statistics

Threads
104,191
Messages
1,004,540
Members
135,712
Latest member
Saediga
Top