Matlab crashed
5 次查看(过去 30 天)
显示 更早的评论
Hello, I am experiencing crashes from Matlab while running mex programs. Below is the scenario of the crashes.
A.mexw32 runs properly in the beginning. So I started working on B.cpp which will later be used to generate B.mexw32. However, while working on B.cpp, there were several memory allocation problems and Matlab crashed a few times. Then when I tried to execute A.mexw32 which had not at all been modified, the execution crashed too. I was guessing that this was due to some cache memory leakage so I restarted the computer. But the crashes still happen while executing A.mexw32. After a several attempts, the crashes still continue.
I then used another computer to execute the same A.mexw32. It works perfectly.
My only guess is that some memory blocs are corrupted while I was working on B.cpp. But why is A.mexw32 still not working after restarting the computer?
0 个评论
回答(3 个)
James Tursa
2012-3-26
You very likely have coding errors in A.mexw32 and B.mexw32 and it is corrupting memory and causing crashes. The reason it is intermittent is because the corruption itself does not immediately cause a crash ... it is only when downstream code (either in the mex routine itself or in MATLAB after you returned from the mex routine) accesses that corrupted memory that you get the seg fault. Memory leaks will not cause a crash ... they will simply use up memory and leave it inaccessible to your process. If the code is short enough you can post it and we can look for coding errors. If it is not short enough, try to reduce it to a small program that reproduces the crash and post that.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!