patchGNU Octave - Patches: patch #9829, Access of a nested structure...

 
 

patch #9829: Access of a nested structure memory leak in mex function

Submitter:  Evangelos Rozos <vrozos>
Submitted:  Wed 10 Jul 2019 09:52:05 AM UTC
   
 
Category:  Core : other Priority:  5 - Normal
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 16 Jul 2019 04:53:50 PM UTC, comment #2: 

Closing as duplicate

Mike Miller <mtmiller>
Group Member
Tue 16 Jul 2019 07:23:18 AM UTC, comment #1: 

This was intended to be created as a bug. I create one with id #56637.

Evangelos Rozos <vrozos>
Wed 10 Jul 2019 09:52:05 AM UTC, original submission:  

The access of a nested structure passed to a mex function seems to create memory leak.

Example code (snippet):
...
 mxArray* pmx1=NULL;
 mxArray* pmxid=NULL;
 pmx1= mxGetField(prhs[0], 0, "InsDmd");
 pmxid= mxGetField(pmx1, 0, "id");        // <-- memory leak stops when commenting this out
...

This problem has been witnessed in Octave 5.1.0/win64 and Octave 4.2.2/Linux (I believe exists in every platform and recent Octave version). The same code does not create leak when compiled in MATLAB.

Apparently, the indicated line of code above does not create directly the leak, but somehow mixes up the memory management (a dynamic allocation somewhere else in the code is not freed by free() ). The leak is noticeable only after numerous calls of the mex function (7.6 MB/100000 calls).

Evangelos Rozos

Evangelos Rozos <vrozos>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by vrozos (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-16 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #56637

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code