Root causes my program built in debug configuration to crash at memory deallocation.
My code is like this:
my_dll_function is function inside DLL which I also build in debug mode.
Normally debug mode programs refer to UCRTBASED.DLL, however debug Root libraries still refer to UCRTBASE.DLL (release one) - checked it with Dependency Walker.
For some reason libcling.dll exports operator delete and linker links operator delete to the code in EXE instead of using standard one.
So what happens:
- Vector allocates its data storage inside DLL using UCRTBASED.DLL
- Vector deallocates storage in the EXE using operator delete from libcling.dll which points to the UCRTBASE.DLL
- Program crashed on the CRT heap assertion.
Proof crash stack trace:
What needs to be done:
- Please make sure all executables and DLLs in the "debug" version of Root are built with /MDD compiler switch instread of /MD (or no such switch at all - I am not familiar with Root build script and don't know what it uses exactly).
- Issue new Root version with properly compiled stuff