MATLAB Micro-Manager core.getImage Crash


I am acquiring data with MATLAB/Micro-Manager using the standard sequence:

# Initialize core
import mmcorej.*;
core = CMMCore;

# Get image
im = core.getImage;

# Process image...

About every one in four calls to core.getImage, MATLAB becomes unresponsive and has to be stopped with task manager. I have been unable to find a log that records the error and would welcome any suggestion.

I have no issues – no crashing – when I use the non-MATLAB Micro-Manager interface, but I need MATLAB for experimental control and analysis.

I am using:

  • MATLAB 2019a,
  • Micro-Manager-1.4,
  • AxioCam MRm,
  • AxioCam MR Interf. Rev. A PCI framegrabber,
  • AxioVision 4.9.1 (specifically, the associated drivers for the AxioCam),
  • The standard Zeiss AxioCam .cfg file generated with Micro-Manager,
  • Windows 10 Enterprise.

Thanks much for any help!

Does the withdrawal mean that your solution of matching Visual Studio versions did not work and you are back to the original question?

Hi @nicost,

That is correct. I spoke too soon about it solving the issue: the random crashes appeared eventually in my ‘solved’ configuration. I tried debugging in a similar vein, where I uninstalled, restarted, reinstalled, and restarted for many versions of Visual C++ at once, without success.

Regardless, thinking more about it, the withdrawn solution doesn’t make sense, because the .dll that is breaking is associated with Visual C++ 2005 (version 8.0 ==> vc80). I don’t immediately see how more modern versions of Visual C++ affect this.

My best guesses of how to debug this in the future are:

  • Take out the framegrabber and clean the PCI pins with IPA. Maybe this .dll memcpy function is failing occasionally because the board is having connectivity issues or something. (I’m grasping at straws.)
  • Try everything on a completely fresh installation of Windows to isolate the problem from Visual C++ versions installed from or related to non-micro-manager things.
  • Look into the source code differences between the non-MATLAB micro-manager GUI (which is working fine) and the MATLAB / micro-manager interface (which is breaking). My lack of familiarity with the source will make this difficult.
  • Sacrifice a goat to Microsoft Visual C++ 2005.
  • However, the above guesses are based largely in ignorance of how this .dll chain functions and fails.

Below is the full MATLAB crash report which I probably should have attached originally. The big issue is that the nature of this error prohibits try/catch'ing it; MATLAB must instead be restarted, thus making the workflow completely unusable.

  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : windows-1252
  Deployed                 : false
  Graphics Driver          : NVIDIA Corporation GeForce GT 730/PCIe/SSE2 Version 4.6.0 NVIDIA 391.35
  Graphics card 1          : NVIDIA ( 0x10de ) NVIDIA GeForce GT 730 Version (2018-3-23)
  Java Version             : Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
  MATLAB Architecture      : win64
  MATLAB Entitlement ID    : 4172684
  MATLAB Root              : C:\Program Files\MATLAB\R2019a
  MATLAB Version           : (R2019a)
  OpenGL                   : hardware
  Operating System         : Microsoft Windows 10 Enterprise
  Process ID               : 9220
  Processor ID             : x86 Family 6 Model 45 Stepping 7, GenuineIntel
  Session Key              : 6d2398bc-bc02-4a3d-88dd-f3a8be0b9f51
  Window System            : Version 10.0 (Build 17763)

Fault Count: 1

Abnormal termination:
Access violation

Register State (from fault):
  RAX = 0000000000000009  RBX = 0000000000000000
  RCX = 00000000fd62e000  RDX = ffffffffffff1000
  RSP = 000000033401fcc8  RBP = 0000000000000000
  RSI = 00000000fd61f040  RDI = 0000000028bb0298
   R8 = 000000000000fd80   R9 = 00000001bd2ce000
  R10 = 0000000000080110  R11 = 00000000fd61f040
  R12 = 0000000000000000  R13 = 0000000000000000
  R14 = 0000000000000000  R15 = 0000000000000000
  RIP = 00000000fff1e460  EFL = 00010206
   CS = 0033   FS = 0053   GS = 002b

Stack Trace (from fault):
[  0] 0x00000000fff1e460 C:\WINDOWS\WinSxS\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.9554_none_88e038cb2fae7c50\MSVCR80.dll+00124000 memcpy+00000704
[  1] 0x00000001aa7d4173                   C:\WINDOWS\SYSTEM32\mcammr64.dll+00082291 StartImageAcquisitionRect+00000867
[  2] 0x00000001aa7d475b                   C:\WINDOWS\SYSTEM32\mcammr64.dll+00083803 IsImageReady+00001499
[  3] 0x00000001aa7da696                   C:\WINDOWS\SYSTEM32\mcammr64.dll+00108182 McamIsFastAcquisitionReady+00000454
[  4] 0x00000001aa7da72d                   C:\WINDOWS\SYSTEM32\mcammr64.dll+00108333 McammIsFastAcquisitionReady+00000045
[  5] 0x00007ffa795048ce C:\Program Files\Micro-Manager-1.4\mmgr_dal_AxioCam.dll+00018638 DeleteDevice+00014174
[  6] 0x00007ffa7950f350 C:\Program Files\Micro-Manager-1.4\mmgr_dal_AxioCam.dll+00062288 CreateDevice+00000880
[  7] 0x00007ffa94687974                   C:\WINDOWS\System32\KERNEL32.DLL+00096628 BaseThreadInitThunk+00000020
[  8] 0x00007ffa9497a271                      C:\WINDOWS\SYSTEM32\ntdll.dll+00434801 RtlUserThreadStart+00000033