patchGNU Octave - Patches: patch #8768, new field for stack info in...


patch #8768: new field for stack info in structure passed to error handler of cellfun

Submitted by:  Olaf Till <i7tiol>
Submitted on:  Mon 12 Oct 2015 10:48:27 AM UTC  
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

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


Wed 06 Jul 2016 01:52:56 PM UTC, comment #1:

Olaf, if Matlab doesn't have this feature, do they have a way to solve the problems that you mentioned with parcellfun and netcellfun?

Lachlan Andrew <lachlan>
Mon 12 Oct 2015 10:48:27 AM UTC, original submission:

'cellfun' can be passed an error handler. In case the user function produces an error, the error handler is called with the arguments of the user function and an additional structure with error information. The return value of the error handler is returned as an element of the return values of cellfun.

The structure with error information, passed to the error handler, contains the fields 'identifier' (error identifier), 'message' (error message), and 'index' (index of argument set for user function). However, it does not contain the error stack. This hinders finding the erroneous code in the user function.

This is not a big issue if only cellfun is used, since one can call it without an error handler to see the error stack of the user function directly. But in parallel execution, as with parcellfun or the new netcellfun, the errors of the child processes are caught and their messages can only be seen by examining the output of the error handler. It's no great problem to pass stack information to the error handler in parcellfun and netcellfun. But in some cases (chunked evaluation) these functions internally call cellfun, so for consistency, stack information should also be passed to the error handler by cellfun, so that this information is available to parcellfun and netcellfun. The stack can be passed in the field 'stack', and can be the same as the corresponding field returned by the function 'lasterror'.

Matlabs cellfun does not set the field 'stack' for the error handler, so the main problem should be to decide if we want to set it or not. The implementation itself is only one line, so I barely see the need to provide a changeset, but here it is.

Olaf Till <i7tiol>
Project Member


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

Attach Files:

Attached Files
file #35164:  err_handler_stack_info.cset added by i7tiol (822B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by i7tiol (Submitted the item)

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-12 i7tiol Attached File- => Added err_handler_stack_info.cset, #35164

    Back to the top

    Powered by Savane 3.3