octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48640] gzip/bzip errors in destructors will c


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #48640] gzip/bzip errors in destructors will cause Octave to crash
Date: Tue, 26 Jul 2016 19:08:10 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

URL:
  <http://savannah.gnu.org/bugs/?48640>

                 Summary: gzip/bzip errors in destructors will cause Octave to
crash
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Tue 26 Jul 2016 12:08:08 PM PDT
                Category: Octave Function
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

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:


../libinterp/dldfcn/xzip.cc: In destructor ‘CFile::~CFile()’:
../libinterp/dldfcn/xzip.cc:92:55: warning: throw will always call terminate()
[-Wterminate]
       throw std::runtime_error ("unable to close file");
                                                       ^
../libinterp/dldfcn/xzip.cc:92:55: note: in C++11 destructors default to
noexcept
../libinterp/dldfcn/xzip.cc: In destructor ‘bz2::zipper::~zipper()’:
../libinterp/dldfcn/xzip.cc:140:65: warning: throw will always call
terminate() [-Wterminate]
         throw std::runtime_error ("failed to close bzip2 stream");
                                                                 ^
../libinterp/dldfcn/xzip.cc:140:65: note: in C++11 destructors default to
noexcept
../libinterp/dldfcn/xzip.cc: In destructor
‘gz::gzip_stream::~gzip_stream()’:
../libinterp/dldfcn/xzip.cc:219:64: warning: throw will always call
terminate() [-Wterminate]
         throw std::runtime_error ("failed to close zlib stream");
                                                                ^
../libinterp/dldfcn/xzip.cc:219:64: note: in C++11 destructors default to
noexcept





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48640>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]