Access Violation when using system() command. No issues when running from command line directly.

8 Ansichten (letzte 30 Tage)
Hello,
I am running a r2015b version of Matlab. I have a simulation that uses the MCR (version 8.5). In order to enable this, I run the System() command from Matlab.
When I call the system command from Matlab, there is an access violation detected and the get the following response:
*************************************************
ZSIM 36 (ZView-4.2.0-Windows)
******
Architecture Simulator
*************************************************
***(info) Starting address: 0x086e
.vectors1 : Loading to INT-INST memory ... 0x0000 -> 0x0008 (0x0009)
.text : Loading to INT-INST memory ... 0x0800 -> 0x1e28 (0x1629)
.data : Loading to INT-DATA memory ... 0x0000 -> 0x0a63 (0x0a64)
.vectors2 : Loading to INT-INST memory ... 0x0018 -> 0x0080 (0x0069)
.isrs : Loading to INT-INST memory ... 0x0400 -> 0x0511 (0x0112)
***(info) __stack_start=0xf7ff
***(info) _ZSP_target_type=0xa2
Loading "***.out" successfully.
calling zsp_vss_init
in 1: 0 in 2: 0 in 3: 0 in 4: 0 in 5: 0 in 6: 0 in 7: 0 in 8: 0 in 9: 0
in 10: 0
log base 0
scaling_sel 0
size_code 96
mode_sel 0
in[0] 0
in[127] 4294836224
in[511] 0
FFTDMAChannel: 1
mcdma_idle loop count 0
DMA channel returned
Timer Count is = 3638 (cycles)
out[0] 65523
out[127] 917520
out[511] 0
calling zsp_vss_init
in 1: 0 in 2: 0 in 3: 0 in 4: 0 in 5: 0 in 6: 0 in 7: 0 in 8: 0 in 9: 0
in 10: 0
log base 0
scaling_sel 0
size_code 96
mode_sel 0
in[0] 0
in[127] 65535
in[511] 0
------------------------------------------------------------------------
Access violation detected at Wed Dec 23 10:12:57 2015
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Default Encoding : windows-1252
Graphics card 1 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 5500 V
ersion 10.18.14.4264
Host Name : USSJC-2F1RV32
MATLAB Architecture : win32
MATLAB Root : C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85
MATLAB Version : 8.5.0.197613 (R2015a)
OpenGL : hardware
Operating System : Microsoft Windows 7 Professional
Processor ID : x86 Family 6 Model 61 Stepping 4, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(T
M) Client VM mixed mode
Window System : Version 6.1 (Build 7601: Service Pack 1)
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
EAX = 004edc08 EBX = 00000000
ECX = 00000000 EDX = 004edc08
ESP = 004ec334 EBP = 004edc44
ESI = ffffffff EDI = 00000000
EIP = 04973255 EFL = 00210287
CS = 00000023 DS = 0000002b SS = 0000002b
ES = 0000002b FS = 00000053 GS = 0000002b
Stack Trace (from fault):
[ 0] 0x04973255 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\libm
wservices.dll+00078421 svGetPref_UserWorkFolder+00000245
[ 1] 0x7cfcb5fe C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mcr.
dll+00374270 mcrInstance::init+00001566
[ 2] 0x06538dc2 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\MVML
ocal.dll+00101826 mvm_server::inproc::LocalMVM::privateInit+00000498
[ 3] 0x06535d66 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\MVML
ocal.dll+00089446 mvm_server::inproc::LocalMVM::create+00000262
[ 4] 0x0653d64b C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\MVML
ocal.dll+00120395 mvm_server::inproc::LocalFactory::createMVM+00000123
[ 5] 0x069e9096 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mclm
cr.dll+00888982 mclmcr::CtfExtractor::operator=+00087510
[ 6] 0x069ded6d C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mclm
cr.dll+00847213 mclmcr::CtfExtractor::operator=+00045741
[ 7] 0x06a344ae C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mclm
cr.dll+01197230 mclInitializeInstance+00000990
[ 8] 0x06a33fe2 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mclm
cr.dll+01196002 mclInitializeComponentInstance+00000690
[ 9] 0x06a0ed92 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32\mclm
cr.dll+01043858 mclInitializeComponentInstanceEmbedded+00000370
[ 10] 0x10011123 C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\runtime\win32\
mclmcrrt8_5.dll+00069923 mclInitializeComponentInstanceEmbedded_proxy+00000067
[ 11] 0x00301112 C:\ZSP\ZView4.2.0\bin\fft64_512.dll+00004370 fft
64_512InitializeWithHandlers+00000098
[ 12] 0x637140cd C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00016589
[ 13] 0x637152d3 C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00021203
[ 14] 0x637112da C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00004826
[ 15] 0x6371227b C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00008827
[ 16] 0x6371256f C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00009583
[ 17] 0x63715594 C:\ZSP\ZView4.2.0\bin\libzmfftmodel.dll+00021908
[ 18] 0x63763ed1 C:\ZSP\ZView4.2.0\bin\libzmxu.dll+00016081
[ 19] 0x63764e01 C:\ZSP\ZView4.2.0\bin\libzmxu.dll+00019969 Zsp
_MXU_ExecuteClock+00000017
[ 20] 0x6c764271 C:\ZSP\ZView4.2.0\bin\libzmssdrvg1.dll+00017009 zic
_Terminate+00010881
[ 21] 0x6c76159f C:\ZSP\ZView4.2.0\bin\libzmssdrvg1.dll+00005535 zic
_ExecuteClock+00000015
[ 22] 0x6bb4e609 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00189961 ZLo
adObjectFile+00043609
[ 23] 0x6bb4ee28 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00192040 ZLo
adObjectFile+00045688
[ 24] 0x6bb42171 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00139633 ZAd
vanceSim+00000401
[ 25] 0x6bb4b606 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00177670 ZLo
adObjectFile+00031318
[ 26] 0x6bb4b6d9 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00177881 ZLo
adObjectFile+00031529
[ 27] 0x6bb43a15 C:\ZSP\ZView4.2.0\bin\libzsim400.dll+00145941 ZSe
tAttribute+00001653
[ 28] 0x00321036 C:\ZSP\ZView4.2.0\bin\zsim400.exe+00004150
[ 29] 0x00321269 C:\ZSP\ZView4.2.0\bin\zsim400.exe+00004713
[ 30] 0x764f336a C:\Windows\syswow64\kernel32.dll+00078698 Bas
eThreadInitThunk+00000018
[ 31] 0x772c9882 C:\Windows\SysWOW64\ntdll.dll+00235650 Rtl
InitializeExceptionChain+00000099
[ 32] 0x772c9855 C:\Windows\SysWOW64\ntdll.dll+00235605 Rtl
InitializeExceptionChain+00000054
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.** This crash report has been saved to disk as C:\Users\
ADHANA~1\AppData\Local\Temp\matlab_crash_dump.1420-1 **
MATLAB is exiting because of fatal error
-----------------------------------------------------------------
However, if I run it directly from command line, I have no issues and it would complete the execution without any access violation issues.
I tried running Matlab as Admin and that did not help either.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 23 Dez. 2015
Generally speaking, these kinds of crashes (works at command line, does not work with system()) occur because MATLAB sets up library path environment variables that are in effect during calls to system(), and the paths it constructs that way bring in a DLL version that the called program is not expecting. The problem can be traced by calling a library dependency tool from the shell to find out what the program is expecting, and then called from system() to find out what the program is ending up with instead. You then modify your MATLAB source slightly to setenv() the needed library paths before calling system(); or you invoke a .bat that sets to environment variables and runs the program; or you construct a more complicated system() command line that sets the environment variables and then runs the program.
You are using MS Windows and I do not recall which environment variables are the relevant ones for it. For OS-X or Linux, the variables would include LD_LIBRARY_PATH; my memory at the moment is that for MS Windows it might be just the PATH environment variable.
  1 Kommentar
Ajay Kumar
Ajay Kumar am 28 Dez. 2015
Bearbeitet: Ajay Kumar am 28 Dez. 2015
Thank you very much, Walter! you have always been very helpful and prompt in your responses.
I tried uninstalling and reinstalling Matlab 2015b, MCR for 2015a and nothing helped. Finally, I just had to go and deleete all the temporary files in the C:\users\<username>\AppData\Local\Matlab\* and C:\users\<username>\AppData\RoamingData\Matlab\*

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by