matlab crash when executing mexw64 file

조회 수: 7 (최근 30일)
yongguang zhang
yongguang zhang 2020년 2월 7일
i mex a cpp file with command : mex example.cpp and get example.mexw64(env:matlab2019b, VS2019), when i execute the mexw64 file in commandline, matlab crashes, in the mexfunction i just call the windows threadcreate api CreateThread to create a thread, threadbody function do nothing expect printf function name.
crashdumple file:
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : GBK
Deployed : false
Graphics Driver : Unknown hardware
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce 940MX Version 26.21.14.3650 (2019-9-30)
Graphics card 2 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 630 Version 26.20.100.7263 (2019-9-25)
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 : 6257193
MATLAB Root : C:\Program Files\MATLAB\R2019b
MATLAB Version : 9.7.0.1190202 (R2019b)
OpenGL : hardware
Operating System : Microsoft Windows 10 家庭中文版
Process ID : 1444
Processor ID : x86 Family 6 Model 158 Stepping 9, GenuineIntel
Session Key : b6c0b4e1-6688-400a-bb21-1927d3a6a117
Window System : Version 10.0 (Build 17763)
Fault Count: 1
Assertion in foundation::usm::Detail<struct foundation::usm::scope::Mvm>::find at b:\matlab\foundation\usm\management.cpp line 712:
find: no active context for type 'struct `anonymous namespace'::AlreadyReportedFailure'
Register State (captured):
RAX = 0000000010b4eba8 RBX = 0000000010b4eba8
RCX = 000000021401e9b0 RDX = 0000000000000000
RSP = 000000021401e930 RBP = 00000000000002c8
RSI = 0000000123421100 RDI = 0000000010fcc4d0
R8 = 00007ffb9697ea38 R9 = 00007ffb9697ea40
R10 = 0000e15fc976b623 R11 = 0000000010b3ec05
R12 = 000000021401eff0 R13 = 00000000fea6da20
R14 = 0000000010fcb318 R15 = 0000000010b3ead8
RIP = 00000000108f427a EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00000000108eb603 C:\Program Files\MATLAB\R2019b\bin\win64\libmwfl.dll+00046595 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00000000108e95d8 C:\Program Files\MATLAB\R2019b\bin\win64\libmwfl.dll+00038360 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00000000108ef58a C:\Program Files\MATLAB\R2019b\bin\win64\libmwfl.dll+00062858 foundation::core::diag::symbols::getSymbolAddress+00015306
[ 3] 0x00000000108ee1a8 C:\Program Files\MATLAB\R2019b\bin\win64\libmwfl.dll+00057768 foundation::core::diag::symbols::getSymbolAddress+00010216
[ 4] 0x00000000108f3aab C:\Program Files\MATLAB\R2019b\bin\win64\libmwfl.dll+00080555 foundation::core::diag::terminate+00000059
[ 5] 0x0000000010fa391c C:\Program Files\MATLAB\R2019b\bin\win64\libmwfoundation_usm.dll+00014620 foundation::usm::getErrorHandler+00000060
[ 6] 0x0000000010fbafe3 C:\Program Files\MATLAB\R2019b\bin\win64\libmwfoundation_usm.dll+00110563 foundation::usm::Detail<foundation::usm::scope::Mvm>::find+00000163
[ 7] 0x00000000fb6018cb C:\Program Files\MATLAB\R2019b\bin\win64\libmwbridge.dll+00071883 ioSetIoCallbacks+00006763
[ 8] 0x00000000fe9db007 C:\Program Files\MATLAB\R2019b\bin\win64\libut.dll+00241671 utVprintf+00000199
[ 9] 0x00000000fc612793 C:\Program Files\MATLAB\R2019b\bin\win64\libmex.dll+00206739 mexPrintf_800+00000035
[ 10] 0x00007ffb97a129d7 C:\Users\jacky\Documents\MATLAB\client_1.mexw64+00010711
[ 11] 0x00007ffba1607974 C:\WINDOWS\System32\KERNEL32.DLL+00096628 BaseThreadInitThunk+00000020
[ 12] 0x00007ffba34fa271 C:\WINDOWS\SYSTEM32\ntdll.dll+00434801 RtlUserThreadStart+00000033
cpp file:
example.cpp
static DWORD WINAPI port_task_thread (LPVOID data)
{
struct sockaddr_in addrHost;
char clt_recv_buff[SOCKET_BUFF_SZIE + 1] = { 0 };
int nMsgLen, addrLen;
printf("%s \n\n", __func__);
return 0;
}
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
// pthread_create(&pthread_client_task, NULL, client_task_thread, NULL);
HANDLE hThread1 = CreateThread(NULL, 0, port_task_thread, NULL, 0, NULL);
return;
}

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by