BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / matlab / #4967同步于 2009/3/28
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Matlab机器人发帖

【求助】Matlab和vc混编mex的一个错误

xxxxxxX
2009/3/28镜像同步4 回复
编译完运行: ----------------------------------------------------------------------- Segmentation violation detected at Sat Mar 28 19:35:22 2009 ------------------------------------------------------------------------ Configuration: MATLAB Version: 7.1.0.246 (R14) Service Pack 3 MATLAB License: 161051 Operating System: Microsoft Windows XP Window System: Version 5.1 (Build 2600: Service Pack 3) Processor ID: x86 Family 15 Model 4 Stepping 4, GenuineIntel Virtual Machine: Java 1.5.0 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode Default Charset: GBK Register State: EAX = 00000000 EBX = 0f492270 ECX = 00000000 EDX = 00000000 ESI = 00cde6c0 EDI = 00cde660 EBP = 00cdde3c ESP = 00cdde34 EIP = 78502faf FLG = 00010202 Stack Trace: [0] libmx.dll:_mxGetScalar(0, 0x00cde660, 0, 0x0f492270) + 15 bytes [1] scm_mex_core.mexw32:0x0eba38c7(0, 0x00cde660, 0, 0x00cde6c0) [2] libmex.dll:_mexRunMexFile(0, 0x00cde660, 0, 0x00cde6c0) + 103 bytes [3] libmex.dll:private: void __thiscall Mfh_mex::runMexFileWithSignalProtection(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00cde660, 0, 0x00cde6c0) + 73 bytes [4] libmex.dll:public: virtual void __thiscall Mfh_mex::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00cde660, 0, 0x00cde6c0) + 169 bytes [5] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00cde660, 0, 0x00cde6c0) + 271 bytes [6] m_interpreter.dll:int __cdecl mdDispatch(int,char const *,int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_MATLAB_fn * *)(521, 0x0f49bca4 "scm_mex_core", 0, 0x00cde660) + 88 bytes [7] m_interpreter.dll:_inDispatchFromStack(521, 0x0f49bca4 "scm_mex_core", 0, 0) + 800 bytes [8] m_interpreter.dll:enum opcodes __cdecl inDispatchCall(char const *,int,int,int,int *,int *)(0x0f49bca4 "scm_mex_core", 521, 0, 0) + 145 bytes [9] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *,int *)(2, 0, 0, 0) + 2534 bytes [10] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(2, 0, 0, 0) + 282 bytes [11] m_interpreter.dll:_inInterPcode(2, 0x784d6e7c, 0, 0) + 81 bytes [12] m_interpreter.dll:enum inExecutionStatus __cdecl in_local_call_eval_function(int *,struct _pcodeheader *,int *,struct mxArray_tag * * const,enum inDebugCheck)(0x00cdf278, 0x00cdf370, 2, 1) + 153 bytes [13] m_interpreter.dll:$L74683(0x784d6e7c, 0x0f04bb20 "scm_mex_core\n", 0, 0) + 184 bytes [14] m_interpreter.dll:enum inExecutionStatus __cdecl inEvalCmdWithLocalReturnandtype(char const *,int *,enum inDebugCheck)(0x0f04bb20 "scm_mex_core\n", 0, 2, 0x00cdf3bc "D敉") + 69 bytes [15] m_interpreter.dll:_inEvalCmdNoEnd(0x0f04bb20 "scm_mex_core\n", 1, 255, 0) + 16 bytes [16] bridge.dll:enum inExecutionStatus __cdecl ThrowSignal(char const *)(0x0f04bb20 "scm_mex_core\n", 0x7c80b731, 0x01247740, 0x01247740) + 60 bytes [17] bridge.dll:$L86781(0, 0, 0x784d6e58, 0x7c36b71f) + 432 bytes [18] mcr.dll:public: void __thiscall mcrInstance::mnParser(void)(271289, 0x505c3a45, 0x72676f72, 0x46206d61) + 93 bytes [19] MATLAB.exe:0x00401ca9(4194304, 0, 271289, 0x01247740) [20] MATLAB.exe:0x00403d9f(594808, 0x7c93003d, 0x7ffd8000, 0x8054c6ed) [21] kernel32.dll:0x7c817067(0x00403c1a, 0, 0, 0) This error was detected while a MEX-file was running. If the MEX-file is not an official MathWorks function, please examine its source code for errors. Please consult the External Interfaces Guide for information on debugging MEX-files. If it is an official MathWorks function, 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\ADMINI~1\LOCALS~1\Temp\matlab_crash_dump.172 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 to the command window 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. 为什么无法运行???
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
zixu1986机器人#1 · 2009/3/28
他好像讲啦 If the MEX-file is not an official MathWorks function, please examine its source code for errors. Please consult the External Interfaces Guide for information on debugging MEX-files. 你的c source code呢?
xxxxxxX机器人#2 · 2009/3/28
这个肯定没错啊. 什么是Please consult the External Interfaces Guide for information on debugging MEX-files
zixu1986机器人#3 · 2009/3/28
就是说去调试一下你的c源程序 帮助里面说了如果借助visual studio的环境调试 其实我觉得你直接在一些地方mexPrintf 看看那些变量是怎么样的就可以调试了 你怎么得到这一大串东西的啊 我怎么没见过啊 不过我只弄过一些小的mex 这个mex是你自己写的吗? 【 在 XXXxXXX 的大作中提到: 】 : 这个肯定没错啊. : 什么是Please consult the External Interfaces Guide for information : on debugging MEX-files
zixu1986机器人#4 · 2009/3/28
我刚查了下 好像segmentation violation是你访问到别人的内存页去了 应该是你的源程序里指针指错了