• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Help diagnosing intermittent crash

markysoft

Member
Hi there, I bought a copy of GameMaker Studio last week, and I've having problems with my game crashing intermittently.

No doubt it's down to me doing something wrong, but there's no indication of why it's crashed.
I'm using GML and it occasionally happens just after a room has started.

I put some show_debug_messages in at the start and end of a step, and when it fails it runs a few steps completely, then exits.

I don't get any build or syntax errors. Is there any way to get a better crash report? All I get is the output below:

X://windows/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:05.4049970s for command "C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.1.406/bin/Igor.exe" -j=8 -options="C:\Users\markh\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 12/03/2020 19:01:10
"cmd" /c subst Z: /d

elapsed time 00:00:00.0451956s for command "cmd" /c subst Z: /d started at 12/03/2020 19:01:16
"cmd" /c subst Y: /d

elapsed time 00:00:00.0495543s for command "cmd" /c subst Y: /d started at 12/03/2020 19:01:16
"cmd" /c subst X: /d

elapsed time 00:00:00.0352364s for command "cmd" /c subst X: /d started at 12/03/2020 19:01:16
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.


The same thing happens when running the built exe.
Any advice appreciated!
 

Roldy

Member
Hi there, I bought a copy of GameMaker Studio last week, and I've having problems with my game crashing intermittently.

No doubt it's down to me doing something wrong, but there's no indication of why it's crashed.
I'm using GML and it occasionally happens just after a room has started.

I put some show_debug_messages in at the start and end of a step, and when it fails it runs a few steps completely, then exits.

I don't get any build or syntax errors. Is there any way to get a better crash report? All I get is the output below:

X://windows/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:05.4049970s for command "C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.1.406/bin/Igor.exe" -j=8 -options="C:\Users\markh\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 12/03/2020 19:01:10
"cmd" /c subst Z: /d

elapsed time 00:00:00.0451956s for command "cmd" /c subst Z: /d started at 12/03/2020 19:01:16
"cmd" /c subst Y: /d

elapsed time 00:00:00.0495543s for command "cmd" /c subst Y: /d started at 12/03/2020 19:01:16
"cmd" /c subst X: /d

elapsed time 00:00:00.0352364s for command "cmd" /c subst X: /d started at 12/03/2020 19:01:16
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.


The same thing happens when running the built exe.
Any advice appreciated!
Intermittent issues are the worst. If you can get the problem to happen more frequently or consistently then it will be easier to track down. But here are some things to consider:

  • -1073741819 is an access violation, typically deals with trying to access memory.
  • Run in the debugger until you get this resolved. The debugger may catch an unhandled exception and help you narrow it down.
  • Drill down with 'show_debug_messages.' Start placing messages at the beginning and end of most of your events. And see if there is a place the game will normally crash on. If you can identify a specific event, then start putting messages in the middle of that event and see if it crashes before or after that message. Then put a message before or after until you can narrow down that the crash happens before or after some code. Like a binary search of your code using 'show_debug_message' just to try to identify the code they may be causing it.
  • Take the time and get an idea of how frequent this will occur. Just launch your game over and over until you can reasonably say it crashes every 3rd time, or 10th time, or 20th time on average. Then start 'turning off' (commenting out code or removing instances for a room) parts of your game and test to see if it will still crash. If you remove something and it stops crashing then that is a place to start investigating.
  • Will it crash only when launched from the IDE. OR can you make an .exe and launch from the .exe and have it occasionally crash. If it will crash by running the a built exe directly without the IDE open, then take that exe to other computers and see if it will also crash on them. If it will not crash on a different computer then your developement computer may have a corrupted install, DLL, or other system problems.
  • Consider trying a different project. like a YoYo demo. Build and run that several times until you see that it crashes or are confident that it will not crash. If another project crashes then it may be your GMS runtime or environment is corrupted. But if another project won't crash then you can be more confident that it is a coding problem with your project.

Good Luck.
 
Last edited:

markysoft

Member
Intermittent issues are the worst. If you can get the problem to happen more frequently or consistently then it will be easier to track down. But here are some things to consider:

  • -1073741819 is an access violation, typically deals with trying to access memory.
  • Run in the debugger until you get this resolved. The debugger may catch an unhandled exception and help you narrow it down.
  • Drill down with 'show_debug_messages.' Start placing messages at the beginning and end of most of your events. And see if there is a place the game will normally crash on. If you can identify a specific event, then start putting messages in the middle of that event and see if it crashes before or after that message. Then put a message before or after until you can narrow down that the crash happens before or after some code. Like a binary search of your code using 'show_debug_message' just to try to identify the code they may be causing it.
  • Take the time and get an idea of how frequent this will occur. Just launch your game over and over until you can reasonably say it crashes every 3rd time, or 10th time, or 20th time on average. Then start 'turning off' (commenting out code or removing instances for a room) parts of your game and test to see if it will still crash. If you remove something and it stops crashing then that is a place to start investigating.
  • Will it crash only when launched from the IDE. OR can you make an .exe and launch from the .exe and have it occasionally crash. If it will crash by running the a built exe directly without the IDE open, then take that exe to other computers and see if it will also crash on them. If it will not crash on a different computer then your developement computer may have a corrupted install, DLL, or other system problems.

Good Luck.
Thanks Roldy, I thought I might have to take that approach. I'll add lots of logging and try and zero in on the problem.
 

Roldy

Member
Thanks Roldy, I thought I might have to take that approach. I'll add lots of logging and try and zero in on the problem.
I edited one more suggestion:

  • Consider trying a different project. like a YoYo demo. Build and run that several times until you see that it crashes or are confident that it will not crash. If another project crashes then it may be your GMS runtime or environment is corrupted. But if another project won't crash then you can be more confident that it is a coding problem with your project.
Possibly do that first before digging into your code. If you can verify that a demo project also crashes then you can look elsewhere other than your code.
 

markysoft

Member
I tried a demo project and ran fine.
I also put logging everywhere, and the crash isn't happening during any of my scripts, but somewhere after my last script fires (draw GUI) and before the first script fires (the camera object step) after successfully running several step cycles across all the objects without incident.

It seems related to the number of objects in the room as my narrower rooms with fewer objects don't crash. I'm defining levels in a text file and creating walls, etc, based on the character read. The room that crashes creates around 750 objects. I don't know if that's a lot or if loading levels in this way is a bad idea, but the crash happens after the level has loaded and rendered OK for several steps.

It only started happening since I paid for a full license and upgraded which is aggravating... think I'll pause the investigation for now and hope an update fixes the problem, or notice some strange config I have is causing the issue.
 

Roldy

Member
When you run in the debugger and break on each frame does the memory usage increase every frame?
Will it crash on that room with 750 objects, or is that also intermittent?
 

markysoft

Member
It's intermittent, I made a few changes and it happens less now, and I haven't been able to get it to crash in the debugger after running more than 20 times.
I've flicked back and forth between levels loading them really quickly and that never crashes, and memory doesn't change significantly, with an average of 4.65MB.

I was using two rooms and switching back and forth between them when loading levels of different sizes so I could change the width and the height, but now I use a single large room and clamp the camera x/y and handle the 'outside room' check myself.

So now I have a single room, and use `layer_destroy_instances` then recreate the objects when changing or restarting a level.
The crash will happen a few frames into a change to a new level, but is much rarer now. I also removed logic from the destroy event as that could fire when resetting objects in the room.
 

meltypixel

Member
I'm having a similar issue recently with my game, which has been in development for almost 2 years and didn't have this problem at launch in August. I'm currently trying to track down if it was a change I made or a problem with the runtime, but it's extremely hard because the crash is rare and happens seemingly at random.
 

meltypixel

Member
I've rolled back to runtime 2.3.0.401 to test whether the crash is related to the latest engine update or not. I'd be interested to hear if your crash happens under the previous runtime or not.
 

markysoft

Member
I switched back to runtime 2.3.0.401 and the game does not work at all.
It completely ignores my room start order and run one that doesn't have anything in it so I just get a black screen.

Edit: I managed to get it to actually run the game by dropping my game and camera objects into the room it insists on starting on.
No crashes, so for me it looks like it might be related to the run time. I didn't get the problem until I upgraded, so could be that.

Frustrating I can't roll back though.
 
Last edited:
Top