bugGNU Octave - Bugs: bug #48574, With GCC 6.x, an error in an...

 
 

bug #48574: With GCC 6.x, an error in an onCleanup function causes Octave to crash

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 20 Jul 2016 11:28:45 PM UTC
   
 
Category:  Interpreter Severity:  5 - Blocker
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  jwe
Originator Name:  jwe Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 22 Jul 2016 04:28:29 PM UTC, comment #1: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/63c806042c27

John W. Eaton <jwe>
Group administrator
Wed 20 Jul 2016 11:28:45 PM UTC, original submission:  

GCC 6 now warns


../libinterp/octave-value/ov-oncleanup.cc: In destructor 'virtual octave_oncleanup::~octave_oncleanup()':
../libinterp/octave-value/ov-oncleanup.cc:92:7: warning: throw will always call terminate() [-Wterminate]
       throw;
       ^~~~~
../libinterp/octave-value/ov-oncleanup.cc:92:7: note: in C++11 destructors default to noexcept


and an error in an onCleanup function can trigger this problem.  The following is sufficient to demonstrate the bug:


function foo ()
  onCleanup (@() error ('oops!'));
end
foo


A possible fix is attached.

Maybe we should also display the message from the last error along with the new warning about an error in the cleanup function?

What does Matlab do for something like this?

John W. Eaton <jwe>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #37966:  diffs.txt added by jwe (888B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (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
    2016-07-22 jwe StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-07-20 jwe Attached File- Added diffs.txt, #37966

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code