From: bf finance veirs on
i write a c++ mex code and run it in matlab
the firist time is ok, but when i run it again using the same argument , it crashed ,
and then error " matlab unknown software exception (0x40000015)" in a pop error window
before, i find : when i declare a GLOBAL variarbles out of the gateway 'mexFunction' ,, the mex file use to crashed but not pop this error message,
[ i think the global variables allways remain in the memory , maybe ]

then i verified it . it seemed worked well, but this time ,when i use a big data to test it (about 4M in txt files , SIZE 80000 * 5 matrix ) , it creshed just as i describled beyond !

if there are other rules in mex codeing , or some memmory problems with the mex file. i am appriciate if some one give tips.
thanks very much !!
From: James Tursa on
"bf finance veirs" <davidveirs(a)gmail.com> wrote in message <i1n22c$dd$1(a)fred.mathworks.com>...
> i write a c++ mex code and run it in matlab
> the firist time is ok, but when i run it again using the same argument , it crashed ,
> and then error " matlab unknown software exception (0x40000015)" in a pop error window
> before, i find : when i declare a GLOBAL variarbles out of the gateway 'mexFunction' ,, the mex file use to crashed but not pop this error message,
> [ i think the global variables allways remain in the memory , maybe ]
>
> then i verified it . it seemed worked well, but this time ,when i use a big data to test it (about 4M in txt files , SIZE 80000 * 5 matrix ) , it creshed just as i describled beyond !
>
> if there are other rules in mex codeing , or some memmory problems with the mex file. i am appriciate if some one give tips.
> thanks very much !!

You have a bug in your code that is corrupting memory. Fix the bug.

James Tursa