bugGNU Octave - Bugs: bug #50050, MEX mxAssert macro expands wrongly.

 
 

bug #50050: MEX mxAssert macro expands wrongly.

Submitted by:  Kai Torben Ohlhus <siko1056>
Submitted on:  Fri 13 Jan 2017 04:54:33 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: Kai Torben Ohlhus <siko1056>
Originator Name: Open/Closed: Closed
Release: 4.2.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 13 Jan 2017 11:11:47 PM UTC, comment #2:

Done: http://hg.savannah.gnu.org/hgweb/octave/rev/0412dc701e28

@Rik: You are right about the -g flag. It seems to be in my default settings, independent of SeDuMi.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Fri 13 Jan 2017 05:45:27 PM UTC, comment #1:

@Kai: Your analysis is correct. There should be '(' and ')' around "expr". Go ahead and make a changeset for stable.

As for why MxAssert is getting compiled in, either there is a '-g' being added (maybe from the user's own CFLAGS?) or someone is defining "-DMEX_DEBUG". My guess is the former. To debug, try

The code in mkoctfile.cc is looking for '-g' somewhere in ALL_CFLAGS to indicated debug mode. Maybe there is something like "optionabc-gxyz" and the '-g' is being found in the middle of a word. Maybe the search should be for ' -g' with a space in front.

Rik <rik5>
Project Administrator
Fri 13 Jan 2017 04:54:33 PM UTC, original submission:

The SeDuMi bug tracker filed a bug https://github.com/sqlp/sedumi/issues/24 that seems to be more an issue of Octave. I assume the source of the error to lie inside the if statement of lines 311 and 328 in http://hg.savannah.gnu.org/hgweb/octave/file/tip/libinterp/corefcn/mexproto.h

namely

I created the following MCVE mex file to check my assumption. Basically, it does the same as the erroneous file from the SeDuMi-Tracker, namely checking that there is at least one input and at most one output:

Matlab R2016b does:

and Octave 4.2.0:

Do you agree, that the Macros expand in a wrong fashion?

My suggested fix is

in the two lines, what works for me. I would also like to apply this patch to stable for 4.2.1.

Another issue is, that why is mxAssert expanded anyways? I thought it was only available with "mex -g", but SeDuMi compiles without "-g". Maybe another bug?

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 siko1056 (Submitted the item)
  • -unavailable- added by siko1056 (Knows more about mex.)
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 13 Jan 2017 11:11:47 PM UTCsiko1056StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri 13 Jan 2017 05:45:27 PM UTCrik5StatusNeed Info=>In Progress
    Fri 13 Jan 2017 04:54:33 PM UTCsiko1056Carbon-Copy-=>Added rik5

    Back to the top


    Powered by Savane 3.1-cleanup1