Why do I receive a segmentation violation when I try to run my Stateflow 5.1 (R13.0.1) model after adding one more variable?

1 view (last 30 days)
My Simulink model contains a Stateflow chart. When I add one more variable to my Stateflow chart and try to run the model, the following segmentation violation occurs:
------------------------------------------------------------------------
Segmentation violation detected at Fri Jun 20 15:22:59 2003
------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.5.0.180913a (R13)
Operating System: Microsoft Windows 2000
Window System: Version 5.0 (Build 2195: Service Pack 2)
Processor ID: x86 Family 6 Model 8 Stepping 6, GenuineIntel
Virtual Machine: Java 1.3.1_01 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
(mixed mode)
Register State:
EAX = 14aa0021 EBX = 00000001
ECX = 00000000 EDX = 00000200
ESI = 00df392c EDI = 00df392c
EBP = 00df35f0 ESP = 00df35e8
EIP = 2acc7257 FLG = 00010206
Stack Trace:
[0] nqa_sfun.dll:0x2acc7257(0x00df392c, 3, 0x01aeed00, 0x14dc9118)
[1] nqa_sfun.dll:0x2ac4161b(1, 0x00df392c, 3, 0x00df39f8)
[2] nqa_sfun.dll:0x2ac41851(1, 0x00df392c, 3, 0x00df39f8)
[3] nqa_sfun.dll:0x2ac4189a(1, 0x00df392c, 3, 0x00df39f8)
[4] nqa_sfun.dll:0x2ac43b07(1, 0x00df392c, 3, 0x00df39f8)
[5] libmex.dll:_mexRunMexFile(1, 0x00df392c, 3, 0x00df39f8) + 71 bytes
[6] m_interpreter.dll:void __cdecl inCallMexFunction(int,struct mxArray_tag * * const,int,struct mxArray_tag * * const,void (__cdecl*)(int,struct mxArray_tag * * const,int,struct mxArray_tag * * const),struct _mex_context *,struct mexfiles *)(1, 0x00df392c, 3, 0x00df39f8) + 476 bytes
<snip>

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This problem has been fixed in Stateflow 5.1.1 (R13SP1). If you are using a previous version, read the following:
Stateflow, by default, relies on the LCC C compiler to compile Stateflow generated C code on a Microsoft Windows-based system. There is a bug in the LCC C compiler that is encountered when trying to compile very large C files. This bug causes large Stateflow models to crash during simulation. The bug in LCC is triggered by the number of relocations in the generated object file. While this number is not directly related to the number of states, models exhibiting this problem usually had more than 500 states and generated C files in excess of 1MB.
Use one of the following methods to work around this problem:
1. Configure Stateflow to use a different C compiler. Use
mex -setup
from the MATLAB command line to choose another C compiler.
2. Disable debugging in Stateflow. From the target menu select Coder Options and uncheck the debugging check box.
3. Split large charts into multiple smaller charts.

More Answers (0)

Categories

Find more on Stateflow 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!