How can one debug mex code called by fminsearch?
Show older comments
On Windows or MacOS, I've never been able to debug a mex file without disabling Java with the option -nojvm. Otherwise I always get segmentation violation errors or bad access exceptions from Java code (a dog's breakfast, clearly) that my debugger catches.
Up to now this worked for my needs, with the minor annoyance of having to shut off all graphical output.
Now I'm trying to debug a mex code called by fminsearch. This function can use an option 'Display' 'off' (or 'none"). You'd have thought that it would play nice with -nojvm but not at all, its still insists on calling some graphics even without any need, and matlab stops with:
Error in callAllOptimPlotFcns (line 64)
fig = figure('visible','off');
What am I supposed to do now (apart from banging my head on a wall)?
Thanks for the help.
1 Comment
Answers (1)
Steven Lord
on 18 Sep 2023
0 votes
What happened after you handled the SIGSEGV and SIGBUS signals as described in the last section, "Debug MEX with JVM", on this documentation page? Were you able to debug your MEX-file on Mac with the JVM successfully after that?
1 Comment
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!