Access violations in base MATLAB code

17 vues (au cours des 30 derniers jours)
David Liebtag
David Liebtag le 9 Jan 2013
Commenté : David Liebtag le 26 Juin 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.
Thank you.
David Liebtag

Réponses (3)

Martijn
Martijn le 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.
  3 commentaires
Martijn
Martijn le 10 Jan 2013
No I am afraid that this is not possible, the MATLAB GUI is Java based so disabling Java will turn off the development environment.
So you would either:
1. Somehow need to deal with the exceptions on the Visual Studio Side (perhaps someone else has further suggestions on that).
2. Have to temporarily live with not having the full MATLAB GUI when debugging these kind of specific issues.
Daniel Shub
Daniel Shub le 10 Jan 2013
Turning off java does a whole lot more than just disabling the IDE.

Connectez-vous pour commenter.


Sohrab Abedini
Sohrab Abedini le 24 Fév 2015
I have the same error while I run syms. any idea?
  1 commentaire
David Liebtag
David Liebtag le 24 Fév 2015
Sohrab,
I never found an adequate solution and learned to live with running MATLAB without the IDE.
Sorry.
David Liebtag

Connectez-vous pour commenter.


Paul Romanczyk
Paul Romanczyk le 25 Juin 2019
In Visual Studio, Go To Debug > Windows > Exception Settings. Under Win32 Exceptions, Disable Access Violation
  1 commentaire
David Liebtag
David Liebtag le 26 Juin 2019
As I said in my original post Paul, "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."
In other words, I already know how to disable breaking on access violations. I was looking for a less cumbersome method.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by