简体   繁体   中英

Matlab mex file crashes on windows - cannot debug

I have a mex-file I compiled

>> mex -g myMex.cpp

I ran it on several inputs and it works just fine.
All of a sudden, for a specific input, it crashes the machine!

Following the instructions on how to debug using visual studio I attached the debuger to Matlab process and put a break-point at the first line of my mexFunction .

However, when I tired to debug visual studio and Matlab crashes before the break point is hit in the mex C++ code!

Has anyone encountered such a frustrating behavior? How can I debug this crash if the crash happens before I can stop in the debugger?

Not really the answer you're looking for, but due to issues similar to the one you describe I've always found visual debugging of Matlab MEX files so fiddly as to be more trouble than it's worth. It may be quicker to track down problems by inserting mexPrintf and/or return statements in the main mexFunction routine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM