フィルターのクリア

C++ Mex File Crashing Intermittently

1 回表示 (過去 30 日間)
Kevin
Kevin 2012 年 3 月 16 日
I am compiling and using a C++ mex function in Matlab 2011b.
The mex file is acting very strangely. About half of the time it crashes while the other half it does not crash and runs all of the way through.
Does anyone have any ideas what would cause a Mex file to work intermittently that is called from the same place and the same way?
Thanks,
Kevin

採用された回答

Geoff
Geoff 2012 年 3 月 16 日
Sounds to me like you're doing something dodgey inside the C++ code. Specifically, a buffer overrun or invalid pointer access. These have a habit of causing intermittent problems. If your code is not too lengthy or commercially sensitive, feel free to post it.
  4 件のコメント
Kevin
Kevin 2012 年 3 月 16 日
This is exactly what happened. Thanks Geoff.
Geoff
Geoff 2012 年 3 月 19 日
Hehe, I thought so =) No worries, and glad you got it sorted.

サインインしてコメントする。

その他の回答 (1 件)

Jan
Jan 2012 年 3 月 16 日
It is impossible to guess the reason without seeing the code.
You can use a debugger to find the problem. Even some print commands allow to find the line, which causes the crash.

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by