Note that there are some explanatory texts on larger screens.

plurals
  1. POMixed-mode C++/CLI DLL throws exception on exit
    primarykey
    data
    text
    <p>I am having a problem with a C++/CLI mixed mode DLL that I created. It is throwing an exception when unloading as the .NET application that uses it exits. After <code>DLL_PROCESS_DETACH</code> is executed, the DLL does runtime clean-up using automatically registered <code>atexit() / __onexit()</code> functions and throws the following exception:</p> <pre><code>Unhandled exception at 0x752bb9bc (KernelBase.dll) in psstestm.exe: 0xC0020001: The string binding is invalid. </code></pre> <p>I've traced the problem to an <code>atexit()</code> call which is registered by a static boost exception object <code>get_static_exception_object()</code>.</p> <pre><code> function_to_call 0x0f560410 _t2m@???__Fep@?1???$get_static_exception_object@Ubad_exception_@exception_detail@boost@@@exception_detail@boost@@YA?AVexception_ptr@1@XZ@YAXXZ@?A0x0a546e27@@YAXXZ void (void)* </code></pre> <p>I am using boost_1_47 statically linked for the most part except boost::thread which is dynamically linked to avoid loaderlock. I've also tried dynamically linking all of boost which didn't help. Also all of the boost includes are surrounded by <code>#pragma unmanaged</code> blocks.</p> <p><strong>I'm hoping someone has had a similar problem or knows of a solution?</strong></p> <p>Thanks, Mark</p> <p><em>Here is the call stack just before the exception occurs:</em></p> <pre><code>psscorem.dll!_CRT_INIT(void * hDllHandle=0x0f4b0000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 413 C psscorem.dll!__DllMainCRTStartup(void * hDllHandle=0x0f4b0000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 526 + 0x11 bytes C psscorem.dll!_DllMainCRTStartup(void * hDllHandle=0x0f4b0000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 476 + 0x11 bytes C mscoreei.dll!__CorDllMain@12() + 0xde bytes mscoree.dll!_ShellShim__CorDllMain@12() + 0xad bytes ntdll.dll!_LdrpCallInitRoutine@16() + 0x14 bytes ntdll.dll!_LdrShutdownProcess@0() + 0x141 bytes ntdll.dll!_RtlExitUserProcess@4() + 0x74 bytes kernel32.dll!749479f5() mscoreei.dll!RuntimeDesc::ShutdownAllActiveRuntimes() + 0xc8 bytes mscoreei.dll!CLRRuntimeHostInternalImpl::ShutdownAllRuntimesThenExit() + 0x15 bytes clr.dll!EEPolicy::ExitProcessViaShim() + 0x66 bytes clr.dll!SafeExitProcess() + 0x99 bytes clr.dll!DisableRuntime() - 0x1146bb bytes clr.dll!EEPolicy::HandleExitProcess() + 0x57 bytes clr.dll!__CorExeMainInternal@0() + 0x11c bytes clr.dll!__CorExeMain@0() + 0x1c bytes mscoreei.dll!__CorExeMain@0() + 0x38 bytes mscoree.dll!_ShellShim__CorExeMain@0() + 0x227 bytes mscoree.dll!__CorExeMain_Exported@0() + 0x8 bytes kernel32.dll!@BaseThreadInitThunk@12() + 0x12 bytes ntdll.dll!___RtlUserThreadStart@8() + 0x27 bytes ntdll.dll!__RtlUserThreadStart@8() + 0x1b bytes </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload