Segfault is caused in incredibly specific circumstances
Closed this issue · 7 comments
https://discordapp.com/channels/507304429255393322/507982463449169932/741110063187623946 Here is an even more specific instance where this causes issues, specifically a segfault under incredibly specific circumstances. Probably a good idea to re-open.
Originally posted by @NeRdTheNed in #3 (comment)
EDIT: After more testing, the segfault happens regardless of wether the window receives focus during loading
Copy paste from discord:
I'm using MacOS, the bane of many programs. I have found a setup that reliably causes segfaults in the JVM using three mods: Connected Block Textures, Canvas Renderer and Now Playing. The issue only occurs if the game isn't given focus until Connected Block Textures has caused the JVM to output a message saying "[JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode", and Now Playing tries to show a toast showing the name of a song on the title screen. This also only happens if Canvas is enabled.
I've created a MultiMC instance and gathered some logs if anyone wants to look at them, which you can find at (https://drive.google.com/drive/folders/1PPQxxV5F49pxHHFkSJn2bBv67Aco2VKG?usp=sharing). I'm completely lost on why this happens.
It is well known that AWT is a bad choice in mc modding as it fails to function on some systems, to the point that even in the fabric wiki it is noted to avoid it.
It would be good to find another way to do what this mod does, while avoiding the awt library.
Should be fixed in 0.1.2 but I'll leave this open until someone can verify.
...whut? apparently the issue still persists, and is not affected by AWT. this is highly confusing, and I don't know where to go from here. I've got to do some IRL things, but I'll continue to look into this very soon.
I'd suggest reporting this to Now Playing, that mod seems to be likely to be the jankiest.
Working theory for me right now is that, due to some old code I forgot to remove at some point during dev (it's gone now), Canvas currently falls back to using vanilla models instead of its own format when my mod is installed. Chances are, this causes Canvas to take a codepath that segfaults with Now Playing.
Thank you so much for looking into this, and for re-writing the previously AWT based code even though it likely wasn't the issue! I'm incredibly relived that the root issue is likely not an obscure MacOS bug haha.
Side note: I've now determined that the segfault happens regardless of wether the window receives focus during loading. I don't know if this is more concerning or less concerning.