Hi,
I created a custom C++ dll as a wrapper for the e57Format library that reads in data from .e57 point cloud files. (x64 only)
(GitHub - asmaloney/libE57Format: Library for reading & writing the E57 file format)
The DLL depends on other external DLLs such as xerces-c XML (also x64)
Everything is able to run fine without any issues, however this doesn’t always happen.
Sometimes when I attach the debugger and step through some code, it runs fine, other times when I do the same, it just straight up crashes.
And sometimes when I press “Play” without the debugger or without breakpoints, it also just straight up crashes. However, this is not always the case, since the same code can sometimes run just fine without any changes.
This might indicate a data race scenario, where either threads are run in an incorrect order or DLLs being loaded in incorrectly.
Note: I don’t use multithreading in the DLL.
The crash is shown below:
All DLLs are placed in Assets/Plugins and I do not get the Dllnotfoundexception
I am using the C++ debuglogger solution from: https://forum.unity.com/threads/log-to-console-from-c-dll.953498/
I also call functions in C# from the C++ dll through delegate/function pointers and marshal data from C++ to C#, which already shows correct results. (Unsafe code + unsafe keyword)
I’ve tried:
-
enabling load on startup
-
platform settings to Windows and x64 only
-
calling the function from a different thread
None of these solutions have worked so far.
Any help would be appreciated.
Note: I seem to not find any logs from this, maybe I am looking in the wrong directories?