Game crashes unpredictably, but *ONLY* in release builds

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By uzkbwza

My game runs perfectly fine in the editor and the debug builds. However once exported at release the game exhibits frequent crashes when ingame. the only pattern I’ve noticed is that it occurs when many enemies and objects are on the playing field. Is there any way to debug this? I’m not using mono or GDNative at all.

I suspect it might have to do with a “dangling variant” issue mentioned in a comment on this post, because my game has quite a lot of instancing and freeing of objects. I just don’t know where to look, because my game has many complicated systems.

:bust_in_silhouette: Reply From: sash-rc

3.4 beta is still beta, so it’s expected.
The link you provided already suggests to try launching with --verbose, on different platforms and different versions. What are the results? Also try some diagnostic print()s in doubtful places.

Thanks for the response.
This problem was ocurring in 3.3.2 and 3.3.3, as well.
Running the exe via command prompt doesnt seem to do anything even with --verbose and -v, as it will run the executable but nothing is reported to the command prompt (it just returns back to the prompt like so). i don’t really know my way around windows’ shell so maybe i’m just missing something

as for print-debugging, well… my game is fairly big and there are a lot of “doubtful places”. but even if that were feasible, there isn’t a console window on release builds to output any information, so I don’t know how to achieve that. i suppose i could write a more extensive in-game debugging system but I’d prefer not to have to go that far

uzkbwza | 2021-09-01 23:28

there isn’t a console window

Console window == terminal. Your screenshot shows that you’re launching it from console.
And it’s very strange there’s no output at all.

my game is fairly big and there are a lot of “doubtful places”.

Then you just must use print(). Normally, you should use debugging and testing from the start. Just begin from something.

And by the way, what exactly do you mean by “release builds”?
Also, I’d suggest to export another project (like demos), and see how it behaves with console output.

sash-rc | 2021-09-02 10:36