bugGNU Octave - Bugs: bug #50707, exit in a script file causes abort...

 
 

bug #50707: exit in a script file causes abort from unhandled exception

Submitter:  Mike Miller <mtmiller>
Submitted:  Sun 02 Apr 2017 10:10:53 PM UTC
   
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 05 Apr 2017 05:42:15 PM UTC, comment #4: 

I agree, that looks like a big overhaul, closing this as won't fix. If anyone can suggest a workaround that would allow something like


octave script.m arg1 arg2 arg3 arg4


to work, and allow an exit status to be reflected, with Octave 4.2, that would be helpful.

Mike Miller <mtmiller>
Group Member
Wed 05 Apr 2017 12:13:34 PM UTC, comment #3: 

Though exit in a script is a different case, I think it is the same problem that was reported in bug #50068.

I didn't see a way to fix this on stable without changing external interfaces.

John W. Eaton <jwe>
Group administrator
Wed 05 Apr 2017 12:00:50 PM UTC, comment #2: 

I can confirm this for the latest stable branch, but on dev everything works fine for me with your example. Maybe one of these solved the issue unintentionally?

https://hg.savannah.gnu.org/hgweb/octave/log?rev=exit

Kai Torben Ohlhus <siko1056>
Group Member
Sun 02 Apr 2017 11:36:44 PM UTC, comment #1: 

The example shows this, but I guess I should be explicit, I mean a script file that is running from the command shell, what the user manual calls a self-contained Octave script, in the section "Executable Octave Programs".

Starting Octave interactively and calling a script file by name or with the run() function does not show this error.

There is no simple workaround for this, because a self-contained script that takes command-line arguments cannot be combined with the --eval option.

Mike Miller <mtmiller>
Group Member
Sun 02 Apr 2017 10:10:53 PM UTC, original submission:  

Calling the exit() function in a script file results in a SIGABRT because of an uncaught octave::exit_exception in the interpreter:


$ cat foo.m
exit(0);
$ octave-cli foo.m
terminate called after throwing an instance of 'octave::exit_exception'
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted
$ echo $?
134


This is particularly bad for script files that intend to return a success or failure via the exit status using the exit function as intended.

This works correctly on the default branch, and worked in Octave 4.0, bug affects 4.2.1 and the current stable branch.

Mike Miller <mtmiller>
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 jwe (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by mtmiller (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-05 mtmiller StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2017-04-05 siko1056 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code