C# application crashes while using Matlab .Net Assembly

47 views Asked by At

I have created dll library (.Net Assembly) of my matlab functions which I use in C# WinForm app. Now I am facing issue that most of the times my C# app crashes with code 3221226356 (0xc0000374), but sometimes it runs without issue as well.

I checked Event Viewer and got this info: Faulting application name: Search.exe, version: 1.0.0.0, time stamp: 0xa6ac8f38 Faulting module name: ntdll.dll, version: 10.0.22621.3235, time stamp: 0xa2c4352c Exception code: 0xc0000374 Fault offset: 0x000000000010c1a9 Faulting process id: 0x0x4CE0 Faulting application start time: 0x0x1DA74D3C58BCC79 Faulting application path: C:\Users\path\Search.exe Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll Report Id: 5a6729dd-9f7c-447e-9e75-adc2628f929b Faulting package full name: Faulting package-relative application ID: I also created a crash dump and got this info:


         std::terminate() detected at 2024-03-13 04:14:38 +0500

Configuration: Crash Decoding : Disabled - No sandbox or build area path Crash Mode : continue (default) Default Encoding : windows-1252 Deployed : true Graphics Driver : Unknown hardware Graphics card 1 : Intel Corporation ( 0x8086 ) Intel(R) UHD Graphics Version 31.0.101.4502 (2023-7-13) Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode MATLAB Architecture : win64 MATLAB Entitlement ID : Unknown MATLAB Root : C:\Program Files\Polyspace\R2021a MATLAB Version : 9.10.0.1602886 (R2021a) OpenGL : hardware Operating System : Microsoft Windows 11 Enterprise Process ID : 7824 Processor ID : x86 Family 6 Model 154 Stepping 4, GenuineIntel Session Key : 8f79256f-a074-4e06-9630-7d770196d4b9 Window System : Version 10.0 (Build 22631) Fault Count: 1 Abnormal termination: std::terminate() Current Thread: 'MCR 0 interpreter thread' id 19576 Register State (captured): `RAX = 00007fff8d43a758 RBX = 00007fff8d43a758 RCX = 00000089df9fbca0 RDX = 0000000000000000 RSP = 00000089df9fbbe0 RBP = 00000089df9fc9d0 RSI = 0000000000000000 RDI = 00007fff8d43a758

R8 = 000000000000000f R9 = 00000089df9fbb58 R10 = 0000000000000020 R11 = 00007fff8d42a750 R12 = 00000089df9fc8d8 R13 = 0000025c32cd7fe0 R14 = 00007fff8d42a698 R15 = 00000089df9fc310

RIP = 00007fff8d3110ba EFL = 00000202

CS = 0033 FS = 0053 GS = 002bStack Trace (captured):[ 0] 0x00007fff8d30a063 C:\Program Files\Polyspace\R2021a\bin\win64\libmwfl.dll+00041059 foundation::core::diag::thread_context::unspecified_bool+00000051 [ 1] 0x00007fff8d307338 C:\Program Files\Polyspace\R2021a\bin\win64\libmwfl.dll+00029496 foundation::core::diag::stacktrace_base::capture+00000024 [ 2] 0x00007fff8d30cbc1 C:\Program Files\Polyspace\R2021a\bin\win64\libmwfl.dll+00052161 foundation::core::diag::symbols::getSymbolAddress+00010001 [ 3] 0x00007fff8d30fe47 C:\Program Files\Polyspace\R2021a\bin\win64\libmwfl.dll+00065095 foundation::core::diag::is_terminate_message_enabled+00000567 [ 4] 0x00007fff3aae9abd C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00957117 mcr::shutdown::startWatchdog+00035885 [ 5] 0x00007fff3aae92c3 C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00955075 mcr::shutdown::startWatchdog+00033843 [ 6] 0x00007fff3aae4b09 C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00936713 mcr::shutdown::startWatchdog+00015481 [ 7] 0x00007fff3aaeb173 C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00962931 mnSetSegvServiceUrl+00000195 [ 8] 0x00007fffa3a65004 C:\Program Files\Polyspace\R2021a\bin\win64\VCRUNTIME140.dll+00020484 purecall+00000020 [ 9] 0x00007fff3f0c9573 C:\Program Files\Polyspace\R2021a\bin\win64\mlutil.dll+03183987 cmddistributor::PackagedTaskIIP::~PackagedTaskIIP+00000051 [ 10] 0x00007fff3f0bfeb5 C:\Program Files\Polyspace\R2021a\bin\win64\mlutil.dll+03145397 cmddistributor::CmdRequestTraits<cmddistributor::FcnCmdRequest<void> >::operator=+00001797 [ 11] 0x00007fff3f0c0ffb C:\Program Files\Polyspace\R2021a\bin\win64\mlutil.dll+03149819 cmddistributor::CmdRequestTraits<cmddistributor::FcnCmdRequest<void> >::operator=+00006219 [ 12] 0x00007fff3ac6cd1f C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00773407 iqm::IqmPlugin<cmddistributor::PackagedTaskIIP>::~IqmPlugin<cmddistributor::PackagedTaskIIP>+00000063 [ 13] 0x00007fff3aa7c6e3 C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00509667 services::lmgr::exception::LicensingStartupException::~LicensingStartupException+00002691 [ 14] 0x00007fff3ac3f157 C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00586071 iqm::Iqm::setupIqmFcnPtrs+00076359 [ 15] 0x00007fff3ac42904 C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00600324 iqm::Iqm::setupIqmFcnPtrs+00090612 [ 16] 0x00007fff3ac6fbfb C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00785403 iqm::PackagedTaskPlugin::~PackagedTaskPlugin+00010635 [ 17] 0x00007fff3ac1836a C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00426858 iqm::Iqm::create+00011498 [ 18] 0x00007fff3ac17c32 C:\Program Files\Polyspace\R2021a\bin\win64\iqm.dll+00425010 iqm::Iqm::create+00009650 [ 19] 0x00007fff3aa558fc C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00350460 mcrInstantiationError::operator=+00010428 [ 20] 0x00007fff3aa564ac C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00353452 mcrInstantiationError::operator=+00013420 [ 21] 0x00007fff3aa53ac0 C:\Program Files\Polyspace\R2021a\bin\win64\mcr.dll+00342720 mcrInstantiationError::operator=+00002688 [ 22] 0x00007fff93d49b9a C:\Program Files\Polyspace\R2021a\bin\win64\mwboost_thread-vc142-mt-x64-1_72.dll+00039834 mwboost::thread::swap+00000074 [ 23] 0x00007fffae8e9363 C:\WINDOWS\System32\ucrtbase.dll+00168803 recalloc+00000163 [ 24] 0x00007fffaec2257d C:\WINDOWS\System32\KERNEL32.dll+00075133 BaseThreadInitThunk+00000029

[ 25] 0x00007fffb0e6aa58 C:\WINDOWS\SYSTEM32\ntdll.dll+00371288 RtlUserThreadStart+00000040`

I don't understand or know how to interpret this and fix this issue, any help would be appreciated in resolving this crashing issue!

I tried changes in C# code, I did asynchronous coding and tried some other ways but they did not help. I checked the event logs and then checked crash dump but I can't understand and can't interpret them, so I am currently stuck.

0

There are 0 answers