Matlab crashed
5 views (last 30 days)
Show older comments
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 Comments
Answers (3)
James Tursa
on 26 Mar 2012
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 Comments
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!