octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57284] Crash in MEX file when outputs are not


From: Guillaume
Subject: [Octave-bug-tracker] [bug #57284] Crash in MEX file when outputs are not used
Date: Thu, 21 Nov 2019 11:30:10 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #6, bug #57284 (project octave):

With the script below, I get that Octave crashes at 4 and Matlab crashes at
23.


for i=0:128
    fprintf('TESTING WITH %d OUTPUTS\n',i);
    fid = fopen('testmex.c','wt');
    fprintf(fid,'#include "mex.h"\n');
    fprintf(fid,'void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const
mxArray *prhs[]) {\n');
    fprintf(fid,'const mwSize dims[] = {1, 1, 1};\n');
    for j=0:i-1
        fprintf(fid,'plhs[%d] = mxCreateNumericArray(3, dims, mxDOUBLE_CLASS,
mxREAL);\n',j);
    end
    fprintf(fid,'}\n');
    fclose(fid);
    clear testmex
    %mkoctfile --mex testmex.c
    mex  testmex.c
    testmex
end


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57284>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]