f



Segmentation violation in C S-function

Hi friend,

Here is a Segmentation violation in C S-function. Following is the
messages:


-----------------------------------------------------------------------
       Segmentation violation detected at Mon Oct 13 21:16:54 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 15 Model 2 Stepping 7, GenuineIntel
  Virtual Machine:  Java 1.3.1_01 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM
    (mixed mode)

Register State:
  EAX = 00000000  EBX = 019ec1c8
  ECX = 00000000  EDX = 00000000
  ESI = 1e7300c8  EDI = 01b5c008
  EBP = 00df9a44  ESP = 00df9748
  EIP = 264e33b6  FLG = 00010206

Stack Trace:
  [0] NN_robotmex_sat1.dll:0x264e33b6(0x1e7300c8, 0x1e709748,
0x01b5c008, 0)
  [1] simulink.dll:struct slErrMsg_tag * __cdecl
CMexSFcnDerivFcn(struct slSFcnInfo_tag *)(0x01b5127f, 0x7a371500,
0x1e709748, 0x019ec1c8) + 100 bytes
  [2] simulink.dll:struct slErrMsg_tag * __cdecl SFcnDerivFcn(struct
slBlock_tag *,struct slSimBlock_tag *)(0x7a371500, 0x1e94b428,
0x1e94b898, 0x01a3308c) + 117 bytes
  [3] simulink.dll:_BlockDeriv(0x1e94b428, 0x1e860a80, 0x1e87ec28,
0x1e94b500) + 80 bytes
  [4] simulink.dll:_BdSystemDerivatives(0x1e860a80, 0x01b59be0,
0x1e94b880, 86) + 115 bytes
  [5] simulink.dll:struct slErrMsg_tag * __cdecl BdDerivFcn(struct
slModel_tag *)(0x01b59be0, 0x0a95abe8, 0x1e860a80, 0x1e87ec28) + 61
bytes
  [6] simulink.dll:_UpdateContinuousStates(0x0a95abe8, 0x00df9b60,
0x7a28fc9c, 0x0a95abe8) + 164 bytes
  [7] simulink.dll:_ModelUpdateContinuousStates(0x0a95abe8,
0x1e860a80, 0x0a95abe8, 0) + 36 bytes
  [8] simulink.dll:_slIntegrate(0x0095abe8, 0x00df9bb0, 0, 0xffffffff)
+ 172 bytes
  [9] simulink.dll:_StepMenuSim(0x1e87ec28, 0, 0x1e87ec28, 0x00df9bb4)
+ 372 bytes
  [10] simulink.dll:_sleModelExecutionInterface(0x1e87ec28, 5,
0x00df9bb0, 0x01a949b4) + 153 bytes
  [11] simulink.dll:void __cdecl sluiWorkProcSimStep(void
*)(0x1e87ec28, 0, 0x77e12906, 0x1e6dd500) + 27 bytes
  [12] uiw.dll:_UIW_CallWorkProcs(0x00df9cf0, 0x1e6dd598, 0x1e6dd598,
0x6c6f6f54) + 105 bytes
  [13] uiw.dll:_getCommand(0x1e6dd5d0, 4096, 255, 0x1e725ef8) + 131
bytes
  [14] matlab.exe:_ioReadLine(255, 0x7803bb48, 0x1e725ef8, 4096) + 302
bytes
  [15] matlab.exe:void __cdecl mnGetFullLine(char * *,unsigned int
*,unsigned int *,int)(0x00dfdd5c, 0x00dfdd58, 0x00dfdd54, 255) + 55
bytes
  [16] matlab.exe:_mnGetCommandLineBuffer(255, 0, 0, 1) + 95 bytes
  [17] matlab.exe:_mnParser(0x0061006d, 0x00e062bc, 0, 48) + 955 bytes
  [18] matlab.exe:_WinMain@16(4194304, 0, 0x00e062bc, 1) + 3872 bytes
  [19] matlab.exe:_WinMainCRTStartup(0x0061006d, 0x006c0074,
0x7ffdf000, 0x00650078) + 308 bytes
  [20] KERNEL32.dll:0x77e8d326(0x0047172c, 0, 200, 256)

Please follow these steps in reporting this problem to The MathWorks
so
that we have the best chance of correcting it:

  1. Send this crash report to segv@mathworks.com for automated
analysis.
     For your convenience, this information has been recorded in:
       C:\DOCUME~1\WENZHI~1\LOCALS~1\TEMP_~1\matlab_crash_dump.1016

  2. Also, if the problem is reproducible, send the crash report to
     support@mathworks.com along with:
       - A specific list of steps that will reproduce the problem
       - Any M, MEX, MDL or other files required to reproduce the
problem
       - Any error messages displayed prior to this crash report
     A technical support engineer will contact you with further
information.

Thank you for your assistance.  Please save your workspace and restart
MATLAB before continuing your work.

	-------------------------------------------------------------
	This segmentation violation occurred while executing the 
	S-function 'NN_robotmex_sat1' in block
'nn_pd_robotmex_sat_temp2/S-Function1'.
	A common cause of this segmentation violation is an incorrect
	input port direct feedthrough setting. Each input port of the
	S-function that is read (accessed) in mdlOutputs and/or
	mdlGetTimeOfNextVarHit must specify that it needs its input
	signal in these routines by setting direct feedthrough for
	these input ports.
	1) To debug your C-MEX S-function, you can enable diagnostics
	   by compiling the S-function source with the -g flag, e.g.,
	      mex -g sfunction_name.c
	2) You can ask Simulink to try assuming your S-function has
	   direct feedthrough using:
	      set_param('modelname','TryForcingSFcnDF','on')
	   If Simulink can find a valid sorting mode that does not
	   result in algebraic loops involving your S-function, your
	   model will execute (assuming that the cause of this
	   segmentation violation is an incorrect direct feedthrough
	   setting on an input port).
	See matlabroot/simulink/src/sfuntmpl_directfeed.txt
	-------------------------------------------------------------

Thanks and Best Regards,

George

0
wenzhigao (1)
10/14/2003 2:43:51 AM
comp.soft-sys.matlab 211266 articles. 17 followers. lunamoonmoon (258) is leader. Post Follow

0 Replies
741 Views

Similar Articles

[PageSpeed] 52

Reply: