Blame SOURCES/0001-Make-sure-to-return-value-from-non-void-function.patch

21ead4
From 44cc1d696b6528712d92d33660dd8017dcd0b3e2 Mon Sep 17 00:00:00 2001
21ead4
From: Stephan Bergmann <sbergman@redhat.com>
21ead4
Date: Wed, 31 Jul 2019 16:57:31 +0200
21ead4
Subject: [PATCH 1/2] Make sure to return value from non-void function
21ead4
21ead4
This had been commented out with 92145f058c88a9607341d8a20c3944a96ec00cf8
21ead4
"All remaining memory leaks int tests removed. Fixes made by Veit and Anthony
21ead4
Novatsis are incorporated" for no apparent reason---presumably by accident.
21ead4
21ead4
The effect (besides a -Wreturn-type warning) when building e.g. RelWithDebInfo
21ead4
(i.e., with optimizations) on Fedora 30 (with GCC 9.1) was that the implicit
21ead4
call to ~WhitespaceAnalyzer at the end of searchDocs was directly followed
21ead4
(lacking the code sequence corresponding to "return 0;") by some compiler-
21ead4
generated code to jump into some _Z10searchDocsPv.cold code (which is apparently
21ead4
meant as an optimization, to be called from certain cold conditions) which
21ead4
happened to also call ~WhitespaceAnalyzer.  The net effect was that the
21ead4
21ead4
    WhitespaceAnalyzer an;
21ead4
21ead4
object was deleted twice, causing a SIGSEGV.
21ead4
---
21ead4
 src/test/search/TestIndexSearcher.cpp | 2 +-
21ead4
 1 file changed, 1 insertion(+), 1 deletion(-)
21ead4
21ead4
diff --git a/src/test/search/TestIndexSearcher.cpp b/src/test/search/TestIndexSearcher.cpp
21ead4
index 5c410ff4..02c21aaf 100644
21ead4
--- a/src/test/search/TestIndexSearcher.cpp
21ead4
+++ b/src/test/search/TestIndexSearcher.cpp
21ead4
@@ -28,7 +28,7 @@ _LUCENE_THREAD_FUNC(searchDocs, _searcher) {
21ead4
     _CLLDELETE(query);
21ead4
 
21ead4
     CONDITION_WAIT(deleteMutex, deleteCondition);
21ead4
-//    _LUCENE_THREAD_FUNC_RETURN(0);
21ead4
+    _LUCENE_THREAD_FUNC_RETURN(0);
21ead4
 }
21ead4
 
21ead4
 void testEndThreadException(CuTest *tc) {
21ead4
-- 
21ead4
2.21.0
21ead4