patchGNU Octave - Patches: patch #8152, classdef: Fix crash when indexing...

 
 

patch #8152: classdef: Fix crash when indexing classdef object with empty parentheses.

Submitted by:  Philipp Kutin <pkutin>
Submitted on:  Mon Aug 5 11:19:35 2013  
 
Category: NonePriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon Apr 27 15:44:23 2015, comment #5:

I filed a bug report about the Matlab incompatibility of not copying the object over when using empty indexing '()'. See https://savannah.gnu.org/bugs/index.php?44940.

Rik <rik5>
Project Administrator
Sun Apr 26 16:21:52 2015, comment #4:

I checked in Matlab and indeed, empty indexing should return the object and not throw an error:

Carnë Draug <carandraug>
Project Member
Sat Apr 25 17:26:49 2015, comment #3:

No problem. I'm going to mark this as done and close it. If the segfaults return we can investigate further.

Rik <rik5>
Project Administrator
Sat Apr 25 16:54:47 2015, comment #2:

I saw your changeset 20125:274b52724931 and to me it looks like what I intended back then: to prevent "something bad" happening (on reaching "Array<cdef_object> ires = array.index (iv, auto_add);"?) when the index vector is empty.

> Another consideration, shouldn't null indexing just return the object itself rather than generate an error?


Unfortunately I can't test this, since I don't have access to MATLAB anymore.

Philipp Kutin <pkutin>
Tue Apr 21 16:24:12 2015, comment #1:

@Philipp: Could you re-generate your patch against a more recent version of the Mercurial source tree? I used hg import and the patch applied, but at a fuzzy offset of 450 lines. And when I went to test I still got a segfault so I don't think the patch applied cleanly.

Test object in foo.m

Test code

Another consideration, shouldn't null indexing just return the object itself rather than generate an error?

For matrices this is the case

Rik <rik5>
Project Administrator
Mon Aug 5 11:19:35 2013, original submission:
  • ov-classdef.cc: check whether 'ival' is empty and generate an error in that case instead of continuing and crashing.

--

The crash is easy to reproduce: just create any classdef object, e.g. "o=TestClass()", then do "o()". Btw, the parent commit won't make sense -- it's my own (in classdef-pk), changing .hgignore for my setup (build subdir inside octave dir). But as far as I can see, "hg import" is pretty liberal...

Philipp Kutin <pkutin>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pkutin (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Apr 25 17:26:49 2015rik5StatusNone=>Done
      Open/ClosedOpen=>Closed
    Mon Aug 5 11:19:35 2013pkutinAttached File-=>Added classdef-fix-crash-empty-idxparen.patch, #28762

    Back to the top


    Powered by Savane 3.1-cleanup