-
Notifications
You must be signed in to change notification settings - Fork 112
Description
Hi @bb107, After 2 years I'm back :D
I am working on a complicated project in Godot game engine. My project require loading some dll from memory which uses TLS (from Godot SDK) I tried many manual mappers and only one that works properly is yours which is really impressive.
However, After using MemoryModulePP (Static Link, DLL) It causes a instability in Godot when it tries to initialize Vulkan, D3D12, Sound Engine etc. and Leads to a _debugbreak And also It causes crash on Exit.
I did try many things and spent 3 days on debugging But I couldn't find the root, All I know is this is caused by loading MemoryModulePP and I guess it's caused by the hooks, Note that this only happens after loading the dll with TLS. Without TLS it looks fine.
I prepared a fully pre-setup project for looking into the issue which can be downloaded here.
This project contains Godot 4.3 engine, pre-built Godot SDK and GDExtension that uses MemoryModulePP. However in this test project I couldn't reproduce the startup crash on vulkan but exit crash is happening which I believe it's connected to the same startup bug.
This is a very critical project for me and I will really appreciate it if you can help me diagnose the issue and fix it.
One important thing is the startup initialization crash always happens after calling to RtlFreeHeap and raised by RtlReportCriticalFaliure and it happens same on Vulkan, D3D12, XInput etc.
Startup issue only happens randomly sometimes it doesn't happen sometimes it does.
Also sometimes break will be on MemoryModulePP itself at this line.
Do you have any idea or lead to fix the issue?
Thanks
Update 2 :
I got some clue on what is happening, So I believe something going wrong with hooks and things done in MemoryModulePP initialization.
- Linking statically against MemoryModulePP.lib = Startup Random Crash Happens
- Linking dynamically against MemoryModulePP.dll = Startup Random Crash Happens
- Linking dynamically against MemoryModulePP.dll As Delayed DLL = Stable Startup
So If I delay loading of MemoryModule.dll which happens when it is needed to be called from, Startup instability won't happen.
