bugGNU Octave - Bugs: bug #40027, crash when returning from mex...

 
 

bug #40027: crash when returning from mex because of sizeof(bool) != sizeof(mxLogical)

Submitted by:  Jens Restemeier <jens_restemeier>
Submitted on:  Sat 14 Sep 2013 08:51:11 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Jens RestemeierOpen/Closed: Closed
Release: 3.6.4Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 17 Sep 2013 04:04:10 AM UTC, comment #1:

This seems like reasonable behavior so I committed your changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/84d195e050fd). It will be a part of the next major release (3.8.0) or you can build from Mercurial sources to see the fix.

Rik <rik5>
Project Administrator
Sat 14 Sep 2013 08:51:11 AM UTC, original submission:

On my platform (MacOS/PPC) sizeof(bool) is 4, while sizeof(mxLogical) is 1, and this caused a crash when mapping a logical array from matlab to octave.
The patch should be safe across all platforms.
You could probably do some template magic to automatically derive the correct target type, or some test to assert on a size mismatch, but I don't know enough about Octave internals to do that.

Jens Restemeier <jens_restemeier>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #29132:  mex.cc.patch added by jens_restemeier (356B - application/octet-stream)

 

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 jens_restemeier (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 project members 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
    Tue 17 Sep 2013 04:04:10 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat 14 Sep 2013 08:51:11 AM UTCjens_restemeierAttached File-=>Added mex.cc.patch, #29132

    Back to the top


    Powered by Savane 3.1-cleanup1