Access violations in base MATLAB code
33 views (last 30 days)
Show older comments
David Liebtag on 9 Jan 2013
Commented: David Liebtag on 26 Jun 2019
I am debugging a mex function using Microsoft Visual Studio 2010 Professional with MATLAB R2012b on 64 bit Windows 7 Ultimate. When I configure Visual Studio to break on Win32 access violations, I get dozens of breaks in MATLAB base code. This happens before I even load or call my mex function. The only way I have found to debug my program is to only configure VS to break on access violations after I have loaded and called my mex function and stopped in my code. This is very cumbersome.
Is there some way to make MATLAB avoid these violations so I can leave Visual Studio configured to break on them all the time?
FYI Here's an example of the kind of message I see:
First-chance exception at 0x0de62a68 in MATLAB.exe; 0xC0000005; Access violation reading location 0x00000004.
Martijn on 9 Jan 2013
These exceptions are most probably coming from the JIT in the JRE so what you could try is running MATLAB without Java. To do so start MATLAB with the -nojvm option.
Sohrab Abedini on 24 Feb 2015
I have the same error while I run syms. any idea?
Paul Romanczyk on 25 Jun 2019
In Visual Studio, Go To Debug > Windows > Exception Settings. Under Win32 Exceptions, Disable Access Violation
Find more on Write C Functions Callable from MATLAB (MEX Files) 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!