MATLAB crash with BEX error

2 views (last 30 days)
Chandrasekar
Chandrasekar on 18 Jul 2014
Commented: Andreas Goser on 22 Jul 2014
I am trying to simulate an SFunction that has callbacks to a DLL. When I run this model in 32-bit MATLAB 2012b/2013a/2013b, the model simulates to completion, but crashes immediately after mdlTerminate is called.
To test for completion, we recorded some output signals to the toFile block in Simulink and the resulting file had data from the start to end simulation time. Also, please refer to the attached screenshot that shows the debug & verbose logs printed in the command prompt when simulating the FMU. Note that the logs show that the Simulink model simulates to completion, unloads the binary and calls mdlTerminate() before the crash happens.
Also, it is worth noting that on certain computers (such as a colleagues), the FMU simulates without crashes and seems to be fine. This lead me to suspect if the cause is due to some system settings and as I investigated further, I found an xml file (in AppData/Local/Temp) created at the time of crash (but gets deleted when MATLAB is closed). This xml has the following message:
<ProblemSignatures>
<EventType>BEX</EventType>
<Parameter0>MATLAB.exe</Parameter0>
<Parameter1>8.1.0.0</Parameter1>
<Parameter2>50f76dc7</Parameter2>
<Parameter3>simpleSpringWithInput.dll_unloaded</Parameter3>
<Parameter4>0.0.0.0</Parameter4>
<Parameter5>53ac7cd4</Parameter5>
<Parameter6>3aacd9f0</Parameter6>
<Parameter7>c0000005</Parameter7>
<Parameter8>00000008</Parameter8>
</ProblemSignatures>
This could be an issue with buffer overflows or a DEP exception (see table in the link for more details). Note that Parameter3 in the above log is the module that seems to have caused the crash, but the screenshot from MATLAB clearly shows it has been unloaded. Also, this error is only encountered in certain Windows computers. AFAIK, the configuration of the computers that encountered the crash were similar to those that did not see the crash.
I would like to understand the problem signature (as shown above and in the attached xml) and verify if this is indeed a DEP exception and how to resolve it.
As I dug deeper, I disabled the nxBit in bcdedit.exe to disable DEP, but that did not resolve the crash.
Pls. accept my apologies for not being able to share the SFuncs or the model (due to IP restrictions) for debugging.
Any suggestions or solutions is much appreciated.
Thanks and Regards, Chandrasekar Sureshkumar.
  1 Comment
Andreas Goser
Andreas Goser on 22 Jul 2014
I tried helping this user by (tyring) to find out more specifically about the "<EventType>BEX</EventType>" message, but unsuccessful. Any ideas from the community?

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!