bugGNU Octave - Bugs: bug #49516, mexCallMatlab returns 0 when...

 
 

bug #49516: mexCallMatlab returns 0 when called with non valid name

Submitter:  John Donoghue <lostbard>
Submitted:  Wed 02 Nov 2016 04:53:03 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  JohnD Open/Closed:  * Closed
Release:  * 4.2.0-rc3 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 03 Nov 2016 03:28:35 PM UTC, comment #5: 

I checked in a change to fix the regression in feval (http://hg.savannah.gnu.org/hgweb/octave/rev/e07fa946f763).  This change also fixes this bug report.  Marking as fixed and closing.

Rik <rik5>
Group administrator
Wed 02 Nov 2016 10:16:21 PM UTC, comment #4: 

The cset that caused this was


changeset:   20547:52ce821a52fd
user:        John W. Eaton <jwe@octave.org>
date:        Sat Oct 03 16:21:58 2015 -0400
files:       libinterp/parse-tree/lex.ll libinterp/parse-tree/oct-parse.in.yy
description:
eliminate simple uses of error_state in parser and lexer

* lex.ll, oct-parse.in.yy: Eliminate simple uses of global error_state
variable.


Marking bus as a regression and adding jwe to the CC list.

The behavior under 4.0.3, to issue an error, seems like the right action.

Rik <rik5>
Group administrator
Wed 02 Nov 2016 09:43:02 PM UTC, comment #3: 

Messed comment 2 up:

4.0.3:


>> feval('flag_accuracy_level')
error: feval: function 'flag_accuracy_level' not found
>> m = feval('flag_accuracy_level')
error: feval: function 'flag_accuracy_level' not found



4.2.0:


octave:1> feval('flag_accuracy_level')
octave:2> feval('flag_accuracy_level')
octave:3> m = feval('flag_accuracy_level')
error: value on right hand side of assignment is undefined
octave:3>


John Donoghue <lostbard>
Group Member
Wed 02 Nov 2016 09:39:16 PM UTC, comment #2: 

Also it behaves a little differently in 4.0.3 vs 4.2.0 vs with/without return variable:

4.0.3:

>> feval('flag_accuracy_level')
error: feval: function 'flag_accuracy_level' not found
>> m = feval('flag_accuracy_level')
error: feval: function 'flag_accuracy_level' not found
>>
verbatim-

4.2.0:
+verbatim+
octave:2> feval('flag_accuracy_level')
octave:3> m = feval('flag_accuracy_level')
error: value on right hand side of assignment is undefined
octave:3>


John Donoghue <lostbard>
Group Member
Wed 02 Nov 2016 09:25:34 PM UTC, comment #1: 

I have a workaround in mex.cc, but this brings up a larger question.  What should feval() do when it fails.  Currently, it is utterly silent which is what leads mexCallMATLAB to report that all is well.

Example:


octave:1> feval ('sin', 1)
ans =  0.84147
octave:2> feval ('sinABC', 1)
octave:3>


I'll ask on the octave-maintainers list.

Rik <rik5>
Group administrator
Wed 02 Nov 2016 04:53:03 PM UTC, original submission:  


Not sure what matlab does, but it appears that something lie:


mxArray *result= NULL;

int s = mexCallMATLAB(1, &result, 0, NULL, "function_that_doesnt_exist");


returns 0 which means the function worked ok.

John Donoghue <lostbard>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by lostbard (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 group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-03 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-11-02 rik5 Item GroupIncorrect Result Regression
        Carbon-Copy- Added jwe
    2016-11-02 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code