Why did "Matlab has encountered an internal problem and need to close" happen?

6 views (last 30 days)
I'm using Field II to simulate the blood flow in an bifurcation vessel, then this error came up.
Warning: Remember to set all pulses in apertures for the new sampling frequency
Now making Shoots 100...........................................
Now making line 1
------------------------------------------------------------------------
Segmentation violation detected at Tue Sep 04 13:05:27 2012
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.10.0.499 (R2010a)
MATLAB License: *******
Operating System: Microsoft Windows XP
Window System: Version 5.1 (Build 2600: Service Pack 3)
Processor ID: x86 Family 6 Model 7 Stepping 10, GenuineIntel
Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
Default Encoding: GBK
Fault Count: 1
Register State:
EAX = 1cfa9cf0 EBX = 022e27c0
ECX = 00c2c4a0 EDX = 00000018
ESI = 00000018 EDI = 00000000
EBP = 00c2c3d4 ESP = 00c2c3d0
EIP = 057ada9a FLG = 00210206
Stack Trace:
[0] Mat_field.mexw32:0x057ada9a(0x1cfa9cf0, 24, 0x1cfa9cf0, 0x1c4e6610 " FLG = 00210206\n")
[1] Mat_field.mexw32:0x057b057c(0x1c4e6610 " FLG = 00210206\n", 0x022e27c0 "Linear array transducer", 0, 0)
[2] Mat_field.mexw32:0x057a4c2e(0x1cfa9cf0, 2, 0x00c2cbf0, 3)
[3] Mat_field.mexw32:0x057a5db2(2, 0x00c2cbf0, 3, 0x00c2cb60)
[4] libmex.dll:_mexRunMexFile(2, 0x00c2cbf0, 3, 0x00c2cb60) + 132 bytes
[5] libmex.dll:private: void __thiscall Mfh_mex::runMexFileWithSignalProtection(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2cbf0, 3, 0x00c2cb60) + 73 bytes
[6] libmex.dll:public: virtual void __thiscall Mfh_mex::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2cbf0, 3, 0x00c2cb60) + 321 bytes
[7] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2cbf0, 3, 0x00c2cb60) + 249 bytes
[8] m_dispatcher.dll:public: void __thiscall Mfunction_handle::dispatch(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2cbf0, 3, 0x00c2cb60) + 420 bytes
[9] m_interpreter.dll:public: void __thiscall ResolverFunctionDesc::CallFunction(int,struct mxArray_tag * * const,int,struct mxArray_tag * * const)(2, 0x00c2cbf0, 3, 0x00c2d3bc "兄) + 81 bytes
[10] m_interpreter.dll:public: bool __thiscall Resolver::CallMFunction(int,int,class _m_operand * const,union m_operand_storage *,int,class _m_operand * const,union m_operand_storage *,int *)(0x00c2ce80, 2, 2, 0x1cd59de0) + 1209 bytes
[11] m_interpreter.dll:private: bool __thiscall accelImpl::MFunctionCall(struct _accelOp * *)(0x00c2d3d0, 0xffffffff, 0x1cc00428, 0xffffffff) + 545 bytes
[12] m_interpreter.dll:public: enum jitReturnFlags __thiscall accelImpl::Exec(void)(0x00c2d3bc "兄, 0xffffffff, 0x1d12b790, 0xffffffff) + 170 bytes
[13] m_interpreter.dll:public: enum jitReturnFlags __thiscall accelCode::Call(enum inMarshalType *,int *)const (0x00c2d694, 23, 0x1d0917f0, 0) + 133 bytes
[14] m_interpreter.dll:public: static bool __cdecl inJit::ExecuteHotSegment(struct _inJitAccelInfo *,enum opcodes *,int *,int *)(0x00c2d788, 0x00c2d750, 0x00c2d77c, 0x00c2d778) + 2529 bytes
[15] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x1c8c9b00 "爖", 0xffffffff, 0x1c9710d0, 2) + 558 bytes
[16] m_interpreter.dll:void __cdecl inRunMfile(int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_mp *,struct inWorkSpace_tag *)(2, 0x00c2db88, 2, 0x00c2daf8) + 466 bytes
[17] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 2, 0x00c2db88, 2) + 23 bytes
[18] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2db88, 2, 0x00c2daf8) + 25 bytes
[19] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2db88, 2, 0x00c2daf8) + 249 bytes
[20] m_dispatcher.dll:public: void __thiscall Mfunction_handle::dispatch(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00c2db88, 2, 0x00c2daf8) + 420 bytes
[21] m_interpreter.dll:public: void __thiscall ResolverFunctionDesc::CallFunction(int,struct mxArray_tag * * const,int,struct mxArray_tag * * const)(2, 0x00c2db88, 2, 0x00c2e350 "d媛") + 81 bytes
[22] m_interpreter.dll:public: bool __thiscall Resolver::CallMFunction(int,int,class _m_operand * const,union m_operand_storage *,int,class _m_operand * const,union m_operand_storage *,int *)(0x00c2de18, 2, 2, 0x1cd59780) + 1209 bytes
[23] m_interpreter.dll:private: bool __thiscall accelImpl::MFunctionCall(struct _accelOp * *)(0x00c2e364, 0xffffffff, 0x189d4e38, 0xffffffff) + 545 bytes
[24] m_interpreter.dll:public: enum jitReturnFlags __thiscall accelImpl::Exec(void)(0x00c2e350 "d媛", 0xffffffff, 0x1d1091e8, 0xffffffff) + 170 bytes
[25] m_interpreter.dll:public: enum jitReturnFlags __thiscall accelCode::Call(enum inMarshalType *,int *)const (0x00c2e628, 0xffffffff, 0, 0) + 133 bytes
[26] m_interpreter.dll:public: static bool __cdecl inJit::ExecuteHotSegment(struct _inJitAccelInfo *,enum opcodes *,int *,int *)(0x00c2e7f0, 0x00c2e940, 0x00c2e8e4, 0x00c2eac0) + 2529 bytes
[27] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *,int *)(1, 3246, 123, 0) + 797 bytes
[28] m_interpreter.dll:int __cdecl protected_inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 3246, 54, 0) + 39 bytes
[29] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 3246, 54, 0) + 251 bytes
[30] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x7e258a00, 0xffffffff, 0x1c85b0c8, 0) + 876 bytes
[31] m_interpreter.dll:void __cdecl inRunMfile(int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_mp *,struct inWorkSpace_tag *)(0, 0x00c2ee14, 1, 0x00c2ee74) + 466 bytes
[32] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0, 0x00c2ee14, 1) + 23 bytes
[33] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2ee14, 1, 0x00c2ee74) + 25 bytes
[34] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2ee14, 1, 0x00c2ee74) + 249 bytes
[35] m_dispatcher.dll:public: void __thiscall Mfunction_handle::dispatch(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2ee14, 1, 0x00c2ee74) + 420 bytes
[36] m_interpreter.dll:int __cdecl inDispatchFromStack(int,char const *,int,int)(943, 0x0250a06c "couple_sim", 0, 1) + 626 bytes
[37] m_interpreter.dll:_inCallFcnFromReference(0x1d090ec0, 0x1d31a3a0, 0, 0) + 86 bytes
[38] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *,int *)(1, 0, 1, 0) + 6320 bytes
[39] m_interpreter.dll:int __cdecl protected_inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 0, 1, 0) + 39 bytes
[40] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 0, 1, 0) + 251 bytes
[41] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x1c8c8c01, 0xffffffff, 0x1c970620, 0) + 876 bytes
[42] m_interpreter.dll:void __cdecl inRunMfile(int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_mp *,struct inWorkSpace_tag *)(0, 0x00c2f8a4, 0, 0) + 466 bytes
[43] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0, 0x00c2f8a4, 0) + 23 bytes
[44] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2f8a4, 0, 0) + 25 bytes
[45] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,stru

Answers (1)

Walter Roberson
Walter Roberson on 4 Sep 2012
The error messages imply that there is a bug in the Field II mex code.
Without knowing more about the code, it is not possible to say with any certainty what the bug is. The most likely candidates include
  • an allocated section of memory is used after it is free()'d
  • an array is being written to past the allocated length for it
  • memory allocation was requested but could not be satisfied, and the code failed to check whether it was given the memory and instead went ahead and tried to use it.

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!