GodotSteam: On MacOS, game sometimes crashes when closing it

On MacOS (I’ve tested Catalina and Big Sur), the game will sometimes crash when closing it. The “Problem Report” dialog that appears points to something happening in the Steam::~Steam() destructor:

Crashed Thread:        0  MainThrd  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
Retro Tank Party(13000,0x11360bdc0) malloc: *** error for object 0x7fef0b8205f0: pointer being freed was not allocated
 

Thread 0 Crashed:: MainThrd  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff67cd333a __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff67d93e60 pthread_kill + 430
2   libsystem_c.dylib             	0x00007fff67c5a808 abort + 120
3   libsystem_malloc.dylib        	0x00007fff67d5450b malloc_vreport + 548
4   libsystem_malloc.dylib        	0x00007fff67d5740f malloc_report + 151
5                                 	0x0000000107698586 Steam::~Steam() + 166

This doesn’t happen every time, only maybe 50% of the time? However, it never happens in the non-Steam export of the game on the same machines. Also, looking at the stack trace above, it really does seem like it’s stemming from the Steam destructor from GodotSteam.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve never seen the problem happen in the editor, so I don’t know if testing that would be very instructive. But for what it’s worth, I tried the test editor linked above and didn’t have any issues when closing it.

I did successfully compile Godot + GodotSteam export templates on my test Mac! My plan was to first compile it without changes as a baseline, and make sure that the game still worked, then try again with those lines commented out. However, using the version I compiled, I couldn’t get the crash to happen at all, even without any changes! I tried 10 times, and got no crashes. I thought I was going crazy, so I switched back to using the pre-compiled template, and only tried twice and got the crash both times.

Maybe the issue was fixed in the commits since the last pre-compiled binaries? Looking at the diff it doesn’t seem like there’s any changes that would have helped with this issue…

In any case, I think I’ll just switch to using the binary that I compiled and see if any of the beta testers with Mac’s report the problem coming up again.

This has been out to Beta testers since Monday, and they haven’t seen this issue at all with the new build! I’ll definitely comment here if it comes up again, but I have the feeling that commenting out those lines may have fixed it.

So, while I couldn’t reproduce the issue after my re-compile, beta testers are still seeing this. 😦

When I get a chance, I’m going to try commenting out the line 10459 to 10462 (as previously discussed), recompile and get that out to beta testers. I’ll let you know how it goes!

Should we consider this closed since it is working fine with your compiled version?

Sure, we can always re-open it if it comes up again!

It may be worth releasing a new pre-compiled MacOS build some time soon, though.

Thanks! I’ll see if I can try it out this afternoon.

Thanks for the information! While I don’t have a Mac I will dig into it and see what I can find. Hopefully whatever it is can be fixed for the next big update after Godot 3.3 releases.