LavaGang / MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
https://discord.gg/2Wn3N2P
Apache License 2.0
2.38k stars 472 forks source link

[Bug]: Game crashes to desktop right after log step Support Module Loaded: [...]\Il2Cpp.dll #491

Closed sunyudai closed 3 days ago

sunyudai commented 1 year ago

All of the following criteria must be met

All of the following are optional to answer

Describe the issue.

Hello,

I'm trying to get MelonLoader to launch with the game "Take Me To The Dungeon!!", currently it is failing with no mods or plugins installed.


Upon launch:

Last line from Latest.log reads:

[08:00:18.284] Support Module Loaded: C:\Program Files (x86)\Steam\steamapps\common\Take Me To The Dungeon!!\MelonLoader\Dependencies\SupportModules\Il2Cpp.dll

Windows Event Viewer shows two possible entries that may be helpful:

Application: Take Me To The Dungeon!!.exe
CoreCLR Version: 6.0.2023.32017
.NET Version: 6.0.20
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFC6AF626A1 (00007FFC6AD90000) with exit code c0000005.

and

Faulting application name: Take Me To The Dungeon!!.exe, version: 2020.3.48.1457, time stamp: 0x6459a05f
Faulting module name: coreclr.dll, version: 6.0.2023.32017, time stamp: 0x6491fccb
Exception code: 0xc0000005
Fault offset: 0x00000000001d26a1
Faulting process id: 0x0x51F4
Faulting application start time: 0x0x1D9B4C0CD235CD8
Faulting application path: C:\Program Files (x86)\Steam\steamapps\common\Take Me To The Dungeon!!\Take Me To The Dungeon!!.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.20\coreclr.dll
Report Id: 4fe162d1-f20b-4628-995f-e6d3489f9d6f
Faulting package full name: 
Faulting package-relative application ID: 

Latest Log here: Latest.log (same link as above)

side note: attached log was from a launch with title screen turned off, to rule out an issue there. Title screen does display when configured to do so.


I do have MelonLoader working with another game, Bloons TD6, without issue, so I beleive this is not a dependency issue.


Things tried:

Did you attach your log file?

sunyudai commented 1 year ago

CoreCLR Error c0000005 appears to indicate a memory access violation: either a buffer overflow, array index out of bounds, or (more likely I think in this case) an issue with the way MelonLoader is trying to hook into the application, possibly getting blocked by windows security controls or resulting in a stack overflow.

In light of this, new things tried:

I'm not sure where to go from here in terms of troubleshooting this.

sunyudai commented 1 year ago

Through the magic of grabbing the source code and spamming log messages, I can determine that MelonLoader.NativeHost.NativeEntryPoint.Start() runs and completes without error - but at that point we get into unmanaged code, and I haven't been able to trace the flow from there.

So it doesn't look like it's an issue with Il2Cpp, at least.