Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The debug server causes a game crash on any Unity games using Unity 5.4 or lower #69

Closed
aldelaro5 opened this issue Jan 13, 2025 · 0 comments · Fixed by #70
Closed

The debug server causes a game crash on any Unity games using Unity 5.4 or lower #69

aldelaro5 opened this issue Jan 13, 2025 · 0 comments · Fixed by #70

Comments

@aldelaro5
Copy link
Contributor

Originally, I investigated an issue where someone couldn't get the debugger to work on a sonic fangame. The game is publicly accessible here: http://hedgehog.exposed/win

Notably, this game uses a very old Unity version: 4.6.6p3 which I found was related to this issue. After messing with logging, I found that the issue is the call to mono_debug_domain_create and I found something unexpected: it appears this function simply didn't exist in the game's mono's export table which explains why the call failed.

But what's interesting is I checked the export table of a couple of old unity mono games I had and I found that somewhere in the 5.x range, the symbol stopped to appear. After checking the unity mono's sources, I landed on this: Unity-Technologies/mono#399

This PR would suggest that the first version Unity shipped a mono with this symbol exposed is 5.5.0 (the change appears in the unity 5.5 branch, but not 5.4). This matches my testing: I found a missing symbol on a 5.3 game, but the symbol was present on a 5.5 game. All the ones with the symbol present could have the debug server start without crashes while all the ones with the symbol absent could reproduce the same crash I observed. This indicates the issue is for very old unity games, Doorstop's debug server simply doesn't work.

What I found interesting is if I simply commented out the call, debugging seemed to work. I at least could hit a breakpoint, but where I am unsure is I am not sure of the implications of not calling this. I am not familiar enough with mono's internals to know what's the best way to address this. What I do know is that we definitely can't lookup the function by name on these old mono. This suggest we might want to first check if the symbol exists and call it if it does, but what if it doesn't? What should we do in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant