bugGNU Octave - Bugs: bug #58280, cellfun with...

 
 

bug #58280: cellfun with "ErrorHandler"

Submitter:  Muhali <muhali>
Submitted:  Thu 30 Apr 2020 04:56:33 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 May 2020 04:56:22 PM UTC, comment #3: 

one additional note: if the function foo is replaced with


function varargout = foo (S, varargin)
   for i = 1 : nargout
      varargout{i} = NaN ;
   endfor
endfunction


one gets fairly erratic behavior:

octave:11> cellfun ("factorial", {-1,2,-3}, "ErrorHandler", @foo)
ans =

   0   2

octave:12> cellfun ("factorial", {1,2,-3}, "ErrorHandler", @foo)
ans =

    1.0000e+00    2.0000e+00   6.9511e-310


Am I missing something?

Muhali <muhali>
Thu 30 Apr 2020 09:46:46 PM UTC, comment #2: 

Happily, this has been fixed on the stable branch that will become version 6.1.  You'll need to wait for that release or download the code and build from scratch.

Marking as fixed and closing report.


Rik <rik5>
Group administrator
Thu 30 Apr 2020 09:16:11 PM UTC, comment #1: 

Confirmmed.  This is a regression that was introduced back in version 4.2.1.  Version 4.0.3 worked correctly.

Rik <rik5>
Group administrator
Thu 30 Apr 2020 04:56:33 PM UTC, original submission:  

From the cellfun help:


function y = foo (s, x), y = NaN; endfunction
cellfun ("factorial", {-1,2}, "ErrorHandler", @foo)


That function returns (as documented)

ans =

   NaN     2


But when I add one more (incorrect) input


cellfun ("factorial", {-1,2,-1}, "ErrorHandler", @foo)


it throws an extra error:

error: factorial: all N must be real non-negative integers
ans =

   NaN     2     NaN

Muhali <muhali>

 

(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 (Posted a comment)
  • -email is unavailable- added by muhali (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-04-30 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2020-04-30 rik5 CategoryNone Interpreter
        Item GroupNone Regression
        StatusNone Confirmed
        Release5.1.0 6.0.90

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code