Why does MATLAB R2016b crash with no dialog after loading a custom DLL with "loadlibrary"?

I am using the function "loadlibrary" to load a DLL compiled from custom C code into MATLAB R2016b. When I call a function from this DLL, causing a crash in the DLL, MATLAB also crashes without any dialog and with no generated crash dump.
Why does this occur and is it expected behavior?

 Risposta accettata

This is expected behavior. MATLAB cannot guarantee a crash dialog or crash dumps when the crash originates from a third-party shared library, which is loaded in-process via "loadlibrary." This is because the DLL shares MATLAB's process space. Therefore, if the DLL corrupts memory or hits a Segmentation Fault, MATLAB cannot recover or log the crash.
We recommend upgrading to a later MATLAB release for improved crash handling and for techniques such as Out-of-Process Execution Mode, which can isolate a third-party library bug or version skew. For example, later versions exhibit better isolation and crash handling with the C++ interface "clibgen," which supports out-of-process execution.

Più risposte (0)

Categorie

Prodotti

Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by