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

Submitted by:  John W. Eaton <jwe>
Submitted on:  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:  John W. Eaton <jwe>
Originator Name:  jwe Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

(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)
  •  

    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 project 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.5