bugGNU Octave - Bugs: bug #48640, gzip/bzip errors in destructors...

 
 

bug #48640: gzip/bzip errors in destructors will cause Octave to crash

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Tue 26 Jul 2016 07:08:08 PM UTC  
 
Category: Octave FunctionSeverity: 4 - Important
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 27 Jul 2016 09:26:30 PM UTC, comment #4:

Pushed http://hg.savannah.gnu.org/hgweb/octave/rev/2aae8894885b

Carnë Draug <carandraug>
Project Member
Wed 27 Jul 2016 09:10:46 PM UTC, comment #3:

Looks good to me, this change gets rid of the GCC warning messages and makes sense to me.

Mike Miller <mtmiller>
Project Administrator
Wed 27 Jul 2016 03:43:24 PM UTC, comment #2:

Could you review this change?

https://bitbucket.org/carandraug/octave/commits/e53bd08a19e0868eee2c4237e8212f0a16d468b2?at=bug-48640

I went with the use of a close method instead of warnings since warnings wouldn't add anything useful. The only error handling this function should do is skip files that caused errors and not include them in the list of output files.

I also realized that if the destructor is called as part of exception handling, we have nothing to do about a new error. So we just do our best to free any resources. In other cases, then we call close() which would throw as expected.

Carnë Draug <carandraug>
Project Member
Tue 26 Jul 2016 07:09:42 PM UTC, comment #1:

Cc carandraug, convert to warnings as in http://hg.savannah.gnu.org/hgweb/octave/rev/63c806042c27, or handle stream termination errors some other way?

Mike Miller <mtmiller>
Project Administrator
Tue 26 Jul 2016 07:08:08 PM UTC, original submission:

The recent change to move gzip and bzip to C++ adds some classes to handle the various compression streams. The destructors throw runtime_error exceptions, but these should be changed into warnings instead of errors. As it is now, these throws will simply call terminate and Octave will crash immediately.

According to http://en.cppreference.com/w/cpp/language/destructor#Exceptions, throwing exceptions from a destructor is disabled by default, unless the destructor is declared "noexcept(false)", but is bad practice in general.

GCC 6 emits the warnings:

Mike Miller <mtmiller>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller
  • -unavailable- added by mtmiller (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 27 Jul 2016 09:26:30 PM UTCcarandraugStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 27 Jul 2016 09:10:46 PM UTCmtmillerStatusNone=>Patch Submitted
    Tue 26 Jul 2016 07:09:42 PM UTCmtmillerCarbon-Copy-=>Added carandraug

    Back to the top


    Powered by Savane 3.1-cleanup1