3
$\begingroup$

I started using MATLink and find it extremely useful (Windows 7, MATLAB R2016a). I now run Simulink models from Mathematica. I use Mathematica's Table to vary parameters and run simulations hundred of times.

The issue I have is that under heavy use, I frequently (not always) get this error:

MATLink has lost connection to the MATLAB engine; please restart MATLink to create a new connection. If this was a crash, then please try to reproduce it and open a new issue, making sure to provide all the details necessary to reproduce it.

After this, MATLAB still runs, but a process named mengine(255t9_shm) is unresponsive.

So my questions are:

  1. Is there a log or any way to help debug this?
  2. If this is a known issue, are there any recommendation to help reduce the probability of happening?

This additional info may help:

Description:
  A problem caused this program to stop interacting with Windows.

Problem signature:
  Problem Event Name:   AppHangB1
  Application Name: mengine.exe
  Application Version:  0.0.0.0
  Application Timestamp:    53ed4362
  Hang Signature:   d307
  Hang Type:    0
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:    1033
  Additional Hang Signature 1:  d307cfb0fa1a7b068e527ae7638aaff9
  Additional Hang Signature 2:  9d83
  Additional Hang Signature 3:  9d83477c1d6f0fd43ba72dee10f37eb2
  Additional Hang Signature 4:  d307
  Additional Hang Signature 5:  d307cfb0fa1a7b068e527ae7638aaff9
  Additional Hang Signature 6:  9d83
  Additional Hang Signature 7:  9d83477c1d6f0fd43ba72dee10f37eb2

UPDATE: When connecting directly to MATLAB using enableservice('AutomationServer', true), and after couple hundred simulations MATLAB crashed:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: MATLAB.exe
  Application Version:  9.0.0.0
  Application Timestamp:    5681c359
  Fault Module Name:    nvoglv64.DLL
  Fault Module Version: 9.18.13.2063
  Fault Module Timestamp:   51dd4126
  Exception Code:   c0000005
  Exception Offset: 00000000009e7448
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:    1033
  Additional Information 1: b136
  Additional Information 2: b136ebd8fc0cb0735d6c2535ce1a5373
  Additional Information 3: e255
  Additional Information 4: e255aab41a076985e53d70c88b0b9f6d

This makes me thing that the problem may be with MATLAB and not with MATLink.

$\endgroup$
  • 1
    $\begingroup$ This is not a known issue. There is a log in $UserBaseDirectory/ApplicationData/MATLink, but it is unlikely to be helpful in this case. Can you at least show the basic calling syntax you are using, so we can have some idea about what data structures are being transferred? You could also try this method to be able to keep interacting with MATLAB directly, and check what it is doing: mathematica.stackexchange.com/a/69937/12 $\endgroup$ – Szabolcs Apr 28 '17 at 13:12
  • $\begingroup$ As an unrelated side note, you could have a look at the Wolfram System Modeler in stead of simulink. $\endgroup$ – user21 Apr 28 '17 at 13:36
  • $\begingroup$ @user21 Thanks for the idea, but the models are not made by me. They are made by different suppliers. $\endgroup$ – Gustavo Delfino Apr 28 '17 at 13:47
  • $\begingroup$ @Szabolcs I'll try with that method to "keep interacting with MATLAB directly". BTW, I had to restart my PC in order to be able to reestablish the connection. If that does not provide clues I'll update the question with mode details on how I am using MATLink. $\endgroup$ – Gustavo Delfino Apr 28 '17 at 13:52
  • $\begingroup$ OK, so it seems mengine hangs (?). The problem is that the only way we can fix this is if we can reproduce the problem. $\endgroup$ – Szabolcs Apr 28 '17 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.