Bug 998477 - Bad throwspec in ~LuceneBase destructor (g++-4.8 error)
Summary: Bad throwspec in ~LuceneBase destructor (g++-4.8 error)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clucene09
Version: 19
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: qt5-qttools
TreeView+ depends on / blocked
 
Reported: 2013-08-19 12:10 UTC by Kevin Kofler
Modified: 2014-10-25 22:17 UTC (History)
3 users (show)

Fixed In Version: clucene09-0.9.21b-8.fc19
Clone Of:
Environment:
Last Closed: 2013-09-12 01:59:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
proposed fix (607 bytes, patch)
2013-08-19 12:25 UTC, Dan Horák
no flags Details | Diff
more intrusive version (6.84 KB, patch)
2013-08-27 18:21 UTC, Rex Dieter
no flags Details | Diff

Description Kevin Kofler 2013-08-19 12:10:36 UTC
Description of problem:
When attempting to unbundle clucene09 from qt5-qttools, we ran into the following build error:

In file included from /usr/include/clucene09/CLucene/index/IndexReader.h:15:0,
                 from /usr/include/clucene09/CLucene.h:14,
                 from qtokenstream.cpp:20:
/usr/include/clucene09/CLucene/store/FSDirectory.h:92:5: error: looser throw specifier for ‘virtual lucene::store::FSDirectory::FSIndexInput::SharedHandle::~SharedHandle() throw (CLuceneError&)’
     ~SharedHandle() throw(CLuceneError&);
     ^
In file included from /usr/include/clucene09/CLucene/debug/mem.h:14:0,
                 from /usr/include/clucene09/CLucene/StdHeader.h:440,
                 from /usr/include/clucene09/CLucene.h:11,
                 from qtokenstream.cpp:20:
/usr/include/clucene09/CLucene/debug/lucenebase.h:61:13: error:   overriding ‘virtual lucene::debug::LuceneBase::~LuceneBase() noexcept (true)’
     virtual ~LuceneBase(){};

Version-Release number of selected component (if applicable):
clucene09-0.9.21b-5.fc19

How reproducible:
Always

Steps to Reproduce:
1. Try to build qt5-qttools on F19 or Rawhide with the patch from https://bugzilla.redhat.com/show_bug.cgi?id=915005#c36

Actual results:
FTBFS with the above error.

Expected results:
Successful build.

Additional info:
The problem is that the virtual ~LuceneBase() destructor must not be noexcept because at least 1 subclass does throw exceptions in the destructor. So I think that noexcept in lucenebase.h needs to go away.

Comment 1 Robert Scheck 2013-08-19 12:15:18 UTC
Unfortunately, I am not a C++ programmer, thus I would like to see a patch
proposed - which also does not break something else.

Comment 2 Dan Horák 2013-08-19 12:18:30 UTC
If my repoquery was correct, then only zarafa depends on clucene09.

Comment 3 Dan Horák 2013-08-19 12:25:29 UTC
Created attachment 788030 [details]
proposed fix

I think Kevin meant this change instead my original idea of dropping the throw() in the child class.

Comment 4 Kevin Kofler 2013-08-20 18:11:50 UTC
Yes, this change should be right.

I guess g++ 4.8 now assumes that destructors with no throwspec are throw() (i.e. throw nothing) rather than "throw anything". (There must be some obscure clause somewhere in the C++ standard which says that.)

Comment 5 Rex Dieter 2013-08-27 16:32:52 UTC
I need this fix to finish qt5-qttools review, so will take a crack at applying the proposed patch for rawhide and how it goes.

Comment 6 Rex Dieter 2013-08-27 16:51:19 UTC
%changelog
* Tue Aug 27 2013 Rex Dieter <rdieter> 0.9.21b-7
- Bad throwspec in ~LuceneBase destructor (#998477)

Comment 7 Rex Dieter 2013-08-27 17:38:52 UTC
I botched -7, in that it didnt actually apply the patch, -8 on the way.

Comment 8 Rex Dieter 2013-08-27 18:09:10 UTC
Arg, build failed,
http://koji.fedoraproject.org/koji/buildinfo?buildID=459668

started adding more throw items to more headers,
src/CLucene/index/Term.h
src/CLucene/store/Directory.h
src/CLucene/store/FSDirectory.h
...

now hit:

../src/CLucene/index/CompoundFile.cpp:97:41: error: declaration of ‘virtual lucene::index::CompoundFileReader::~CompoundFileReader()’ has a different exception specifier
../src/CLucene/index/CompoundFile.h:98:2: error: from previous declaration ‘virtual lucene::index::CompoundFileReader::~CompoundFileReader() throw (CLuceneError&)’
../src/CLucene/index/Term.cpp:84:13: error: declaration of ‘virtual lucene::index::Term::~Term()’ has a different exception specifier
../src/CLucene/index/Term.h:71:2: error: from previous declaration ‘virtual lucene::index::Term::~Term() throw (CLuceneError&)’
../src/CLucene/store/FSDirectory.cpp:371:29: error: declaration of ‘virtual lucene::store::FSDirectory::~FSDirectory()’ has a different exception specifier
../src/CLucene/store/FSDirectory.h:158:3: error: from previous declaration ‘virtual lucene::store::FSDirectory::~FSDirectory() throw (CLuceneError&)’
../src/CLucene/store/RAMDirectory.cpp:222:31: error: declaration of ‘virtual lucene::store::RAMDirectory::~RAMDirectory()’ has a different exception specifier
../src/CLucene/store/RAMDirectory.h:134:11: error: from previous declaration ‘virtual lucene::store::RAMDirectory::~RAMDirectory() throw (CLuceneError&)’
../src/CLucene/store/TransactionalRAMDirectory.cpp:19:57: error: declaration of ‘virtual lucene::store::TransactionalRAMDirectory::~TransactionalRAMDirectory()’ has a different exception specifier
../src/CLucene/store/TransactionalRAMDirectory.h:47:13: error: from previous declaration ‘virtual lucene::store::TransactionalRAMDirectory::~TransactionalRAMDirectory() throw (CLuceneError&)’

I suppose I need to figure out how to change the declarations accordingly in the .cpp files too?

Comment 9 Rex Dieter 2013-08-27 18:21:03 UTC
Created attachment 791139 [details]
more intrusive version

Here's a more intrusive version I needed to use to get things to build.

Comment 10 Fedora Update System 2013-09-03 13:24:39 UTC
clucene09-0.9.21b-8.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/clucene09-0.9.21b-8.fc19

Comment 11 Fedora Update System 2013-09-03 22:24:52 UTC
Package clucene09-0.9.21b-8.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing clucene09-0.9.21b-8.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-15706/clucene09-0.9.21b-8.fc19
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2013-09-12 01:59:21 UTC
clucene09-0.9.21b-8.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Kevin Kofler 2014-10-25 22:17:10 UTC
For the record, it seems that g++ ≥ 4.8 only assumes noexcept(true) in C++11 mode, and in that mode, it is possible to write noexcept(false) to disable that, so I changed the patch to do that:
http://pkgs.fedoraproject.org/cgit/clucene09.git/tree/clucene-core-0.9.21b-gcc48.patch


Note You need to log in before you can comment on or make changes to this bug.