MATLAB Answers

Matlab crashes after mex from cpp

20 views (last 30 days)
I usually have my Matlab crashes after the succesfully completion of mex from cpp to mexmaci64. It gives a warning message that an internal error occured and needs to shut down and it prompts me either send a report to Matlab or not.
I need to try maybe more than 6-8 times to make it run without crashing. After multiple attemps, it will eventually finishes running without crashing. Any idea why this might happen?


Show 2 older comments
Stelios Fanourakis
Stelios Fanourakis on 4 Aug 2019
It happens after the mex compiler finishes successfully the compilation. I guess since the compilation is successful and crashes later on, then it has to do with the .mexmaci64 file
Guillaume on 4 Aug 2019
The crash is because of a bug in the code that was compiled as mex. The mex file tries to access some memory it's not allowed.
Walter Roberson
Walter Roberson on 4 Aug 2019
For example if you compile the code and then quit MATLAB and then restart MATLAB and run code that uses the .mex* file, then do you still get the crash?
If you use mex to compile the file but do not run the .mex* file, then does the crash still appear?

Sign in to comment.

More Answers (0)