GMS 2.3+ Collect sample runtime stacktraces

rui.r6o

Member
Hello GMC,

I am currently trying to create a set of scripts to extract some common information from stacktraces generated by GameMaker at runtime, that I later intend to use for a myriad of different applications, but mostly for easing their processing (e.g. parsing and serialization of the parsed stacktrace structure, advanced visualisation of the stacktraces with projections of the code structure, etc). Basically I am playing around with how much information you can extract and display from a runtime stacktrace, for advanced debugging across different platforms.

There is however a problem. To quote the official documentation:
The exact string format will vary depending on the target platform chosen
Therefore I would like to ask the community for example runtime stacktraces that they've encountered, across different platforms, that they'd be willing to share for the purposes of this "research". It can be a simple runtime stacktrace or a complex one, from a VM target or a console target (if they can be shared without breaking the EULA, I know the console ones are stricter but I'm not familiar with how they cover sharing of stacktraces). Basically whatever you're willing to/can share and have access to.

I can produce artificial runtime stacktraces on my own, which I'm using for the initial developments, but I only have access to a limited set of platforms, which limits the scope.

Alternatively, if anyone has official documentation of the runtime stacktrace format on a per-platform basis then it would be highly appreciated.

Some ideas on how to generate a few runtime stacktraces:
  • Using a throw statement in a Room Creation Code, an Object Event (different types of events would be useful, e.g. Step, Draw, User Event, etc), basically anywhere GM allows code to be executed;
  • Using a throw statement in nested functions;
  • Any complex scenario you might feel will lead to a complex runtime stacktrace
As for platforms, I can personally get some runtime stacktraces from Windows targets (VM & YYC). However, if you have real life stacktraces from any platforms that have already been shared do feel free to still share them, as the more stacktraces can be collected the better. Note that for complex stacktraces it might be helpful to provide a small description of how the code structure looks like (e.g. it got generated from a 2-level deep function defined on a script resource and invoked through a with statement inside the User Event 0 of object obj_test that got triggered in the Step Event of object obj_foo).

Thank you for your attention.
 
Last edited:

rui.r6o

Member
Pretty sure nothing important to you or anyone besides YoYoGames is being printed to console.
AFAIK GM stack traces don't usually contain internal code frames, only user code. That's where I'm focusing on, in order to help debugging user code. So the information would be important to me as it would (theoretically) be my code that was producing those stacktraces.
 

FoxyOfJungle

Kazan Games
I have a project that has this error, and most likely it is internal:
The game doesn't even compile.

Code:
.
.
.
Writing Chunk... OPTN
Writing Chunk... LANG
Writing Chunk... EXTN
Writing Chunk... SOND

Exceção Sem Tratamento: System.Reflection.TargetInvocationException: Uma exceção foi acionada pelo destino de uma chamada. ---> System.Reflection.TargetInvocationException: Uma exceção foi acionada pelo destino de uma chamada. ---> System.AccessViolationException: Tentativa de leitura ou gravação em memória protegida. Normalmente, isso é uma indicação de que outra memória está danificada.
   em GMAssetCompiler.Wave.(Byte[] , Int32& , Int32& )
   em GMAssetCompiler.Wave.()
   em GMAssetCompiler.Wave..ctor(IFF _iff, Byte[] _wave, String _name, Boolean bOggData)
   em GMAssetCompiler.WADSaver`1..(KeyValuePair`2 , Stream , IFF , Int64 )
   em GMAssetCompiler.WADSaver`1.[](IList`1 , Stream , IFF , WriteDelegateKVP`1 )
   em GMAssetCompiler.WADSaver`1.(IList`1 , Stream , IFF )
   em ..(Stream , IFF )
   em GMAssetCompiler.IFF.(Stream , TextWriter )
   em GMAssetCompiler.WADSaver`1.(GMAssets , Stream , List`1 , Dictionary`2 )
   em GMAssetCompiler.IFFSaver.(GMAssets , String )
   em GMAssetCompiler.Program.(GMAssets )
   em GMAssetCompiler.Program.Reentry(String[] _args)
   --- Fim do rastreamento de pilha de exceções internas ---
   em System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   em System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   em System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   em Igor.Program.(String )
   em Igor.WindowsBuilder.Compile(Boolean _exe)
   em Igor.WindowsBuilder.Deploy(Boolean _exe)
   em Igor.WindowsBuilder.Run()
   --- Fim do rastreamento de pilha de exceções internas ---
   em System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   em System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   em System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   em Igor.Program.( )
   em Igor.Program.(String[] )
elapsed time 00:00:04.2222393s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.2.426/bin/Igor.exe" -j=8 -options="C:\Users\foxyo\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 05/09/2021 01:43:37
"cmd"  /c subst Z: /d

elapsed time 00:00:00.0357045s for command "cmd" /c subst Z: /d started at 05/09/2021 01:43:41
"cmd"  /c subst Y: /d

elapsed time 00:00:00.0319990s for command "cmd" /c subst Y: /d started at 05/09/2021 01:43:41
"cmd"  /c subst X: /d

elapsed time 00:00:00.0303297s for command "cmd" /c subst X: /d started at 05/09/2021 01:43:41
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.
If anyone has any clue what that is...
 

rui.r6o

Member
I apologize @FoxyOfJungle but I meant stacktraces generated from runtime errors 😅

Looking at the log it seems like the compiler is having trouble writing to protected memory, which maybe is the remnants of a polluted cache? Have you tried clearing the cache and recompiling?
 

Samuel Venable

Time Killer
I apologize @FoxyOfJungle but I meant stacktraces generated from runtime errors 😅

Looking at the log it seems like the compiler is having trouble writing to protected memory, which maybe is the remnants of a polluted cache? Have you tried clearing the cache and recompiling?
I don't know why, but I didn't know you meant runtime errors lol. I'm still a bit confused by what you are trying to achieve honestly, but I'm sure you know more about what you are doing than I do. I thought initially you just meant the ouput of running a game when it doesn't error. Shows how lost I was reading your post.

Can I get more information on like, what kind of errors you are looking to retrieve? Also, what platforms are your highest priority? I can provide for desktops, that's pretty much it. I do own other exports but I never got around to using them. I can also do HTML5 at least.

So if i just intentionally make gm spit out an error, does it matter what I do in specific?
 

FoxyOfJungle

Kazan Games
I apologize @FoxyOfJungle but I meant stacktraces generated from runtime errors 😅

Looking at the log it seems like the compiler is having trouble writing to protected memory, which maybe is the remnants of a polluted cache? Have you tried clearing the cache and recompiling?
So I apologize, but I didn't understand initially what you wanted people to post here. However, some parts are in Portuguese. (in my log).
What do you really mean by what you asked for in the post? Errors within the game itself on different platforms?

Therefore I would like to ask the community for example stacktraces that they've encountered, across different platforms, that they'd be willing to share for the purposes of this "research". It can be a simple stacktrace or a complex one, from a VM target or a console target (if they can be shared without breaking the EULA, I know the console ones are stricter but I'm not familiar with how they cover sharing of stacktraces). Basically whatever you're willing to/can share and have access to.
I interpreted that my log would fit this.

Have you tried clearing the cache and recompiling?
Yes :)


I don't know why, but I didn't know you meant runtime errors lol. I'm still a bit confused by what you are trying to achieve honestly, but I'm sure you know more about what you are doing than I do. I thought initially you just meant the ouput of running a game when it doesn't error. Shows how lost I was reading your post.

Can I get more information on like, what kind of errors you are looking to retrieve? Also, what platforms are your highest priority? I can provide for desktops, that's pretty much it. I do own other exports but I never got around to using them. I can also do HTML5 at least.

So if i just intentionally make gm spit out an error, does it matter what I do in specific?
I misunderstand, sorry.
But, however, I'm just trying to export to Windows x86, VM compiler. Last version of GMS 2 and last runtime version. This happened after I upgraded to the latest latest version of the program. I hadn't touched this project for 2 months. Before it worked, because this specific project was being developed in a team of several people. (They also updated GMS 2).


I thought initially you just meant the ouput of running a game when it doesn't error.
Lol, sorry XD

what kind of errors you are looking to retrieve?
Well, actually, I think there is not much to do, because only one person from the YYG team can help me with this error, since it is from the runtime... Important: The project has administrator privileges, this also occurs in the GM of other people who opened the project.
 
Last edited:

rui.r6o

Member
I don't know why, but I didn't know you meant runtime errors lol. I'm still a bit confused by what you are trying to achieve honestly, but I'm sure you know more about what you are doing than I do. I thought initially you just meant the ouput of running a game when it doesn't error. Shows how lost I was reading your post.
I think I might need to clarify my first post then 😅


Can I get more information on like, what kind of errors you are looking to retrieve? Also, what platforms are your highest priority? I can provide for desktops, that's pretty much it. I do own other exports but I never got around to using them. I can also do HTML5 at least.

So if i just intentionally make gm spit out an error, does it matter what I do in specific?
So far I only have access to Windows platforms (both VM and YYC), so pretty much any other platform you have access to is a major help. As for the stacktraces themselves, just do some throw statements in some different situations, I'd say. For example, Room Creation, inside an Object event, some more complex scenarios like a function within a function, etc. Any situation you think might generate some complex stacktraces would be a big help as well. Thanks!


Errors within the game itself on different platforms?
Yes, exactly that! Runtime generated stacktraces.

I interpreted that my log would fit this.
Yeah, I'll have to update my first post to make it clearer...

Sorry I can't help you more then :( the Portuguese part of the log is not really a problem, but I'm afraid I don't know what might be wrong then.

But, however, I'm just trying to export to Windows x86, VM compiler. Last version of GMS 2 and last runtime version. This happened after I upgraded to the latest latest version of the program. I hadn't touched this project for 2 months. Before it worked, because this specific project was being developed in a team of several people. (They also updated GMS 2).
Have you tried exporting all of the resources, re-importing them to a new project and then running the game? Maybe that could help clarify some things (e.g. corrupt resource references, etc)
 
Top