From 016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 12 Jun 2018 12:50:28 +0200 Subject: use LOG_ABORT not just abort() * abort() has the unfortunate effect that nothing is seen in the log, just an event (which is usually not displayed); so ops people don't see that the program is crashing at all. * LOG_ABORT("message") will log an error with the message (and the file and line) before calling abort(), so it's easy to see what happened. * add or move include and LOG_SETUP lines before LOG_ABORT is used (or included). --- searchlib/src/apps/tests/btreestress_test.cpp | 6 ++-- .../vespa-fileheader-inspect.cpp | 2 +- .../vespa-index-inspect/vespa-index-inspect.cpp | 2 +- searchlib/src/tests/aggregator/attr_test.cpp | 3 ++ searchlib/src/tests/aggregator/perdocexpr.cpp | 4 +++ searchlib/src/tests/attribute/attribute_test.cpp | 2 +- .../attribute/benchmark/attributebenchmark.cpp | 11 ++++---- .../tests/attribute/benchmark/attributeupdater.h | 4 +-- .../document_weight_iterator_test.cpp | 3 ++ .../tests/attribute/postinglist/postinglist.cpp | 6 ++-- .../postinglistattribute_test.cpp | 5 ++-- .../attribute_searchable_adapter_test.cpp | 5 +++- .../attribute_weighted_set_blueprint_test.cpp | 3 +- .../searchable/attributeblueprint_test.cpp | 6 ++-- searchlib/src/tests/btree/frozenbtree_test.cpp | 8 +++--- searchlib/src/tests/btree/iteratespeed.cpp | 6 ++-- .../src/tests/diskindex/fusion/fusion_test.cpp | 3 ++ .../pagedict4_hugeword_cornercase_test.cpp | 2 +- .../max_reduce_prod_join_replacer_test.cpp | 5 +++- searchlib/src/tests/grouping/grouping_test.cpp | 3 ++ .../groupingengine/groupingengine_benchmark.cpp | 6 ++-- .../tests/groupingengine/groupingengine_test.cpp | 3 ++ .../memoryindex/dictionary/dictionary_test.cpp | 6 ++-- .../src/tests/predicate/simple_index_test.cpp | 7 +++-- searchlib/src/tests/queryeval/queryeval.cpp | 5 +++- searchlib/src/tests/util/bufferwriter/bm.cpp | 2 +- .../util/ioerrorhandler/ioerrorhandler_test.cpp | 8 +++--- .../util/sigbushandler/sigbushandler_test.cpp | 4 +-- .../attribute/attribute_blueprint_factory.cpp | 6 ++-- .../vespa/searchlib/attribute/attributefile.cpp | 4 +-- .../searchlib/attribute/attributeiterators.cpp | 4 +++ .../vespa/searchlib/attribute/attributevector.cpp | 12 ++++---- .../src/vespa/searchlib/attribute/attrvector.cpp | 4 ++- .../src/vespa/searchlib/attribute/attrvector.hpp | 2 +- .../vespa/searchlib/attribute/createarraystd.cpp | 2 ++ .../src/vespa/searchlib/attribute/createsetstd.cpp | 2 ++ .../searchlib/attribute/createsinglefastsearch.cpp | 3 ++ .../vespa/searchlib/attribute/createsinglestd.cpp | 4 +++ .../vespa/searchlib/attribute/enumattribute.cpp | 2 ++ .../vespa/searchlib/attribute/enumattribute.hpp | 2 +- .../vespa/searchlib/attribute/enumcomparator.cpp | 2 ++ .../src/vespa/searchlib/attribute/enumstore.cpp | 4 ++- .../src/vespa/searchlib/attribute/enumstore.hpp | 4 +-- .../vespa/searchlib/attribute/enumstorebase.cpp | 6 ++-- .../searchlib/attribute/extendableattributes.cpp | 3 ++ .../searchlib/attribute/fixedsourceselector.cpp | 2 ++ .../vespa/searchlib/attribute/flagattribute.cpp | 5 ++-- .../attribute/imported_search_context.cpp | 5 +++- .../searchlib/attribute/multinumericattribute.cpp | 2 ++ .../attribute/multinumericenumattribute.cpp | 2 ++ .../attribute/multistringpostattribute.cpp | 2 ++ .../attribute/postinglistsearchcontext.cpp | 2 ++ .../src/vespa/searchlib/attribute/postingstore.cpp | 2 ++ .../searchlib/attribute/predicate_attribute.cpp | 5 ++-- .../searchlib/attribute/reference_attribute.cpp | 2 ++ .../searchlib/attribute/singleenumattribute.cpp | 2 ++ .../searchlib/attribute/singlenumericattribute.cpp | 2 ++ .../attribute/singlenumericenumattribute.cpp | 2 ++ .../attribute/singlenumericpostattribute.cpp | 2 ++ .../attribute/singlesmallnumericattribute.cpp | 2 ++ .../searchlib/attribute/singlestringattribute.cpp | 2 ++ .../vespa/searchlib/bitcompression/pagedict4.cpp | 4 +-- .../searchlib/bitcompression/posocccompression.cpp | 8 +++--- .../src/vespa/searchlib/btree/btreeinserter.cpp | 4 +++ .../src/vespa/searchlib/btree/btreeiterator.cpp | 3 ++ .../src/vespa/searchlib/btree/btreeiterator.hpp | 6 ++-- searchlib/src/vespa/searchlib/btree/btreeroot.cpp | 4 +++ searchlib/src/vespa/searchlib/btree/btreestore.cpp | 2 ++ searchlib/src/vespa/searchlib/common/bitvector.cpp | 7 +++-- searchlib/src/vespa/searchlib/common/packets.cpp | 4 +-- .../vespa/searchlib/datastore/datastorebase.cpp | 7 +++-- .../src/vespa/searchlib/diskindex/fileheader.cpp | 2 +- searchlib/src/vespa/searchlib/diskindex/fusion.cpp | 6 ++-- .../src/vespa/searchlib/diskindex/indexbuilder.cpp | 6 ++-- .../vespa/searchlib/diskindex/pagedict4file.cpp | 2 +- .../src/vespa/searchlib/diskindex/zcposting.cpp | 2 +- .../memoryindex/compact_document_words_store.cpp | 2 +- .../src/vespa/searchlib/memoryindex/dictionary.cpp | 3 ++ .../searchlib/memoryindex/memoryfieldindex.cpp | 3 ++ .../memoryindex/ordereddocumentinserter.cpp | 2 ++ .../searchlib/memoryindex/postingiterator.cpp | 2 ++ .../searchlib/parsequery/simplequerystack.cpp | 2 +- .../predicate/document_features_store.cpp | 2 ++ .../vespa/searchlib/predicate/predicate_index.cpp | 2 ++ .../predicate/predicate_interval_store.cpp | 2 ++ .../predicate/predicate_tree_annotator.cpp | 5 ++-- .../predicate_zero_constraint_posting_list.cpp | 3 ++ .../src/vespa/searchlib/predicate/simple_index.cpp | 4 +-- .../searchlib/queryeval/predicate_blueprint.cpp | 4 +-- .../searchlib/tensor/dense_tensor_attribute.cpp | 4 ++- .../test/fakedata/fakeegcompr64filterocc.cpp | 4 ++- .../searchlib/test/fakedata/fakememtreeocc.cpp | 8 +++--- .../vespa/searchlib/transactionlog/domainpart.cpp | 2 +- .../searchlib/transactionlog/translogserverapp.cpp | 2 +- searchlib/src/vespa/searchlib/util/statebuf.cpp | 10 +++++-- searchlib/src/vespa/searchlib/util/statefile.cpp | 33 ++++++++++++---------- 96 files changed, 267 insertions(+), 136 deletions(-) (limited to 'searchlib') diff --git a/searchlib/src/apps/tests/btreestress_test.cpp b/searchlib/src/apps/tests/btreestress_test.cpp index ca92ad4865b..e0bdd5b406e 100644 --- a/searchlib/src/apps/tests/btreestress_test.cpp +++ b/searchlib/src/apps/tests/btreestress_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("btreestress_test"); + #include #include #include @@ -21,9 +24,6 @@ #include #include -#include -LOG_SETUP("btreestress_test"); - using MyTree = search::btree::BTree; using MyTreeIterator = typename MyTree::Iterator; using MyTreeConstIterator = typename MyTree::ConstIterator; diff --git a/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp b/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp index d1f5baa0531..e512cfcdffb 100644 --- a/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp +++ b/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp @@ -205,7 +205,7 @@ Application::getTypeString(const FileHeader::Tag &tag) return "string"; default: LOG_ASSERT(tag.getType() == FileHeader::Tag::TYPE_INTEGER); - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp index 469c8aeac4e..a746c6c1365 100644 --- a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp +++ b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp @@ -452,7 +452,7 @@ ShowPostingListSubApp::readPostings(const SchemaUtil::IndexIterator &index, r.read(); } if (!r.close()) - abort(); + LOG_ABORT("should not be reached"); } diff --git a/searchlib/src/tests/aggregator/attr_test.cpp b/searchlib/src/tests/aggregator/attr_test.cpp index f374f117f00..c57f335aceb 100644 --- a/searchlib/src/tests/aggregator/attr_test.cpp +++ b/searchlib/src/tests/aggregator/attr_test.cpp @@ -1,6 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include +#include +LOG_SETUP("attr_test"); + #include #include #include diff --git a/searchlib/src/tests/aggregator/perdocexpr.cpp b/searchlib/src/tests/aggregator/perdocexpr.cpp index 8a6e70de09a..9837deb0186 100644 --- a/searchlib/src/tests/aggregator/perdocexpr.cpp +++ b/searchlib/src/tests/aggregator/perdocexpr.cpp @@ -1,4 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +LOG_SETUP("per_doc_expr_test"); + #include #include #include diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp index 9134711773c..5fcc49fc228 100644 --- a/searchlib/src/tests/attribute/attribute_test.cpp +++ b/searchlib/src/tests/attribute/attribute_test.cpp @@ -2111,7 +2111,7 @@ AttributeTest::testCompactLidSpace(const Config &config) } break; default: - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp index 5722b7c90ca..0eb2dd2cbc4 100644 --- a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp +++ b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp @@ -1,4 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +LOG_SETUP("attributebenchmark"); + #include #include #include @@ -8,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -16,12 +21,6 @@ #include "attributeupdater.h" #include -#include - -LOG_SETUP("attributebenchmark"); - -#include - using std::shared_ptr; typedef std::vector NumVector; diff --git a/searchlib/src/tests/attribute/benchmark/attributeupdater.h b/searchlib/src/tests/attribute/benchmark/attributeupdater.h index 13360e58b2d..1b493dabcc7 100644 --- a/searchlib/src/tests/attribute/benchmark/attributeupdater.h +++ b/searchlib/src/tests/attribute/benchmark/attributeupdater.h @@ -25,7 +25,7 @@ public: if (!rc) { std::cout << "Assert " << _totalCnt << " failed: \"" << str << "\" (" << file << ":" << line << ")" << std::endl; - abort(); + LOG_ABORT("should not be reached"); } return true; } @@ -39,7 +39,7 @@ public: std::cout << aStr << ": " << a << std::endl; std::cout << bStr << ": " << b << std::endl; std::cout << "(" << file << ":" << line << ")" << std::endl; - abort(); + LOG_ABORT("should not be reached"); } return true; } diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp index 7b597930d0c..9df37e36b49 100644 --- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp @@ -1,6 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include +#include +LOG_SETUP("document_weight_iterator_test"); + #include #include #include diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp index fe79db163f8..eb8712b774c 100644 --- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp +++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("postinglist_test"); + #include #include #include @@ -11,9 +14,6 @@ #include #include -#include -LOG_SETUP("postinglist_test"); - namespace search { using vespalib::GenerationHandler; diff --git a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp index 9d9aaac9f62..ffdf01ce494 100644 --- a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp +++ b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("postinglistattribute_test"); + #include #include @@ -17,8 +20,6 @@ #include #include #include -#include -LOG_SETUP("postinglistattribute_test"); using std::shared_ptr; diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index e5af6931977..cbb8f18f9f8 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -1,6 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include +#include +LOG_SETUP("attribute_searchable_adapter_test"); + +#include #include #include #include diff --git a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp index 39bbb8fb5ad..c5805447d7f 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include +#include +LOG_SETUP("attribute_weighted_set_blueprint_test"); #include #include @@ -15,7 +17,6 @@ #include #include - #include using namespace search; diff --git a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp index dc7cf53d188..2b8279c6822 100644 --- a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("attributeblueprint_test"); + #include #include #include @@ -15,9 +18,6 @@ #include #include -#include -LOG_SETUP("attributeblueprint_test"); - using search::AttributeGuard; using search::AttributeVector; using search::IAttributeManager; diff --git a/searchlib/src/tests/btree/frozenbtree_test.cpp b/searchlib/src/tests/btree/frozenbtree_test.cpp index 399c20f53cc..871752b7a0d 100644 --- a/searchlib/src/tests/btree/frozenbtree_test.cpp +++ b/searchlib/src/tests/btree/frozenbtree_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("frozenbtree_test"); + #define DEBUG_FROZENBTREE #define LOG_FROZENBTREEXX #include @@ -10,9 +13,6 @@ #include #include -#include -LOG_SETUP("frozenbtree_test"); - using search::btree::BTreeRoot; using search::btree::BTreeNode; using search::btree::BTreeInternalNode; @@ -306,7 +306,7 @@ FrozenBTreeTest::sortRandomValues() } else if (*i == prevVal) okcnt++; else - abort(); + LOG_ABORT("should not be reached"); prevVal = *i; } EXPECT_TRUE(okcnt == sorted.size()); diff --git a/searchlib/src/tests/btree/iteratespeed.cpp b/searchlib/src/tests/btree/iteratespeed.cpp index 2f60b06d675..6e6029335e8 100644 --- a/searchlib/src/tests/btree/iteratespeed.cpp +++ b/searchlib/src/tests/btree/iteratespeed.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("iteratespeed"); + #include #include #include @@ -18,9 +21,6 @@ #include #include -#include -LOG_SETUP("iteratespeed"); - namespace search { namespace btree { diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp index 07c399b3092..12c9d52356a 100644 --- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp +++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("fusion_test"); + #include #include #include diff --git a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp index 400108e91b0..ea0f769cc51 100644 --- a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp +++ b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp @@ -129,7 +129,7 @@ PostingListCounts makeCounts(uint32_t wantLen) } } LOG(info, "Could not calculate counts with wanted compressed length"); - abort(); + LOG_ABORT("should not be reached"); } using StartOffset = search::bitcompression::PageDict4StartOffset; diff --git a/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp b/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp index 1c6c224cc79..c9c8124bb94 100644 --- a/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp +++ b/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp @@ -8,6 +8,9 @@ #include #include +#include +LOG_SETUP("max_reduce_prod_join_replacer_test"); + using search::features::MaxReduceProdJoinReplacer; using search::features::rankingexpression::ExpressionReplacer; using search::features::rankingexpression::FeatureNameExtractor; @@ -36,7 +39,7 @@ struct MyBlueprint : Blueprint { return true; } FeatureExecutor &createExecutor(const IQueryEnvironment &, vespalib::Stash &) const override { - abort(); + LOG_ABORT("should not be reached"); } }; diff --git a/searchlib/src/tests/grouping/grouping_test.cpp b/searchlib/src/tests/grouping/grouping_test.cpp index 32174ba7647..a10890fba5e 100644 --- a/searchlib/src/tests/grouping/grouping_test.cpp +++ b/searchlib/src/tests/grouping/grouping_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("grouping_test"); + #include #include #include diff --git a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp index 37aa9cc3268..f414e298869 100644 --- a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp +++ b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("grouping_benchmark"); + #include #include #include @@ -15,9 +18,6 @@ #include #include -#include -LOG_SETUP("grouping_benchmark"); - using namespace vespalib; using namespace search; using namespace search::attribute; diff --git a/searchlib/src/tests/groupingengine/groupingengine_test.cpp b/searchlib/src/tests/groupingengine/groupingengine_test.cpp index a90adc5e0c9..06daaaca10f 100644 --- a/searchlib/src/tests/groupingengine/groupingengine_test.cpp +++ b/searchlib/src/tests/groupingengine/groupingengine_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("grouping_engine_test"); + #include #include #include diff --git a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp index c926d1c2831..8e921712cf6 100644 --- a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp +++ b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP("dictionary_test"); + #include #include #include @@ -18,9 +21,6 @@ #include #include -#include -LOG_SETUP("dictionary_test"); - namespace search { using namespace btree; diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp index 52cf9c138c7..30cc0b2e4bb 100644 --- a/searchlib/src/tests/predicate/simple_index_test.cpp +++ b/searchlib/src/tests/predicate/simple_index_test.cpp @@ -1,12 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. // Unit tests for simple_index. -#include -#include -#include #include LOG_SETUP("simple_index_test"); +#include +#include +#include + using namespace search; using namespace search::predicate; using vespalib::GenerationHolder; diff --git a/searchlib/src/tests/queryeval/queryeval.cpp b/searchlib/src/tests/queryeval/queryeval.cpp index c6dd6a430cc..1ad0b643799 100644 --- a/searchlib/src/tests/queryeval/queryeval.cpp +++ b/searchlib/src/tests/queryeval/queryeval.cpp @@ -1,6 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include +#include +LOG_SETUP("query_eval_test"); + +#include #include #include #include diff --git a/searchlib/src/tests/util/bufferwriter/bm.cpp b/searchlib/src/tests/util/bufferwriter/bm.cpp index e5ff0f49973..3370860d2b6 100644 --- a/searchlib/src/tests/util/bufferwriter/bm.cpp +++ b/searchlib/src/tests/util/bufferwriter/bm.cpp @@ -46,7 +46,7 @@ callWork(size_t size, WorkFuncDispatch dispatch) workFunctor2(foo, writer); break; default: - abort(); + LOG_ABORT("should not be reached"); } double after = getTime(); double delta = (after - before); diff --git a/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp b/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp index f6055376907..aaa2a138353 100644 --- a/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp +++ b/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp @@ -214,7 +214,7 @@ TEST_F("Test that ioerror handler can process read error", Fixture) injectreadErrnoTrigger = 1; f.file->ReadBuf(buf, fileSize); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } catch (std::runtime_error &e) { LOG(info, "Caught std::runtime_error exception: %s", e.what()); EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr); @@ -254,7 +254,7 @@ TEST_F("Test that ioerror handler can process pread error", Fixture) injectpreadErrnoTrigger = 1; f.file->ReadBuf(buf, fileSize, 0); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } catch (std::runtime_error &e) { LOG(info, "Caught std::runtime_error exception: %s", e.what()); EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr); @@ -288,7 +288,7 @@ TEST_F("Test that ioerror handler can process write error", Fixture) injectwriteErrnoTrigger = 1; f.writeTestString(); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } catch (std::runtime_error &e) { LOG(info, "Caught std::runtime_error exception: %s", e.what()); EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr); @@ -323,7 +323,7 @@ TEST_F("Test that ioerror handler can process pwrite error", Fixture) injectpwriteErrnoTrigger = 1; f.writeTestString(); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } catch (std::runtime_error &e) { LOG(info, "Caught std::runtime_error exception: %s", e.what()); EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr); diff --git a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp index c86a1c86dbb..1253cab4a74 100644 --- a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp +++ b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp @@ -64,7 +64,7 @@ TEST("Test that sigbus handler can trap synthetic sigbus") sbh.setUnwind(&sjb); kill(getpid(), SIGBUS); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } EXPECT_TRUE(sbh.fired()); { @@ -101,7 +101,7 @@ TEST("Test that sigbus handler can trap normal sigbus") sbh.setUnwind(&sjb); r = *p; LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } EXPECT_TRUE(sbh.fired()); EXPECT_TRUE(r == '\0'); diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 712288f9a1c..a23c9b091c8 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "attribute_blueprint_factory.h" +#include +LOG_SETUP(".searchlib.attribute.attribute_blueprint_factory"); #include "attribute_weighted_set_blueprint.h" #include "i_document_weight_attribute.h" #include "iterator_pack.h" @@ -26,13 +28,9 @@ #include #include - #include #include -#include -LOG_SETUP(".searchlib.attribute.attribute_blueprint_factory"); - using search::attribute::IAttributeVector; using search::attribute::ISearchContext; using search::fef::TermFieldMatchData; diff --git a/searchlib/src/vespa/searchlib/attribute/attributefile.cpp b/searchlib/src/vespa/searchlib/attribute/attributefile.cpp index 6f18dd5fdd1..cf3ed0957b3 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefile.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefile.cpp @@ -74,7 +74,7 @@ AttributeFile::OpenReadOnly() if (!FileSizeCalculator::extractFileSize(datHeader, _datHeaderLen, _datFile->GetFileName(), _datFileSize)) { - abort(); + LOG_ABORT("should not be reached"); } if (_idxFile.get()) { if ( ! _idxFile->OpenReadOnly()) { @@ -93,7 +93,7 @@ AttributeFile::OpenReadOnly() if (!FileSizeCalculator::extractFileSize(idxHeader, _idxHeaderLen, _idxFile->GetFileName(), _idxFileSize)) { - abort(); + LOG_ABORT("should not be reached"); } if (_weightFile.get()) { if ( ! _weightFile->OpenReadOnly()) { diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp b/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp index 92c0fe5d37c..95e0c389393 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp @@ -1,5 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +LOG_SETUP(".searchlib.attribute.attribute_iterators"); + #include "attributeiterators.hpp" #include "postinglistattribute.h" diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 1ccc9923c99..3deed2ed33f 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -1,10 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include "attributevector.h" +#include +LOG_SETUP(".searchlib.attribute.attributevector"); + #include "attribute_read_guard.h" #include "attributefilesavetarget.h" #include "attributeiterators.hpp" #include "attributesaver.h" -#include "attributevector.h" #include "attributevector.hpp" #include "floatbase.h" #include "interlock.h" @@ -21,9 +24,6 @@ #include #include -#include -LOG_SETUP(".searchlib.attribute.attributevector"); - using vespalib::getLastErrorString; using document::ValueUpdate; @@ -216,7 +216,7 @@ AttributeVector::commit(uint64_t firstSyncToken, uint64_t lastSyncToken) if (firstSyncToken < getStatus().getLastSyncToken()) { LOG(error, "Expected first token to be >= %" PRIu64 ", got %" PRIu64 ".", getStatus().getLastSyncToken(), firstSyncToken); - abort(); + LOG_ABORT("should not be reached"); } commit(); _status.setLastSyncToken(lastSyncToken); @@ -446,7 +446,7 @@ AttributeVector::createAttributeHeader() const { getVersion()); } -void AttributeVector::onSave(IAttributeSaveTarget &) { abort(); } +void AttributeVector::onSave(IAttributeSaveTarget &) { LOG_ABORT("should not be reached"); } bool AttributeVector::hasLoadData() const { diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.cpp b/searchlib/src/vespa/searchlib/attribute/attrvector.cpp index f1be4db4675..09d8547ada0 100644 --- a/searchlib/src/vespa/searchlib/attribute/attrvector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attrvector.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "attrvector.h" +#include +LOG_SETUP(".searchlib.attribute.attr_vector"); #include "attrvector.hpp" #include "iattributesavetarget.h" @@ -172,7 +174,7 @@ bool StringDirectAttribute::onLoad() void StringDirectAttribute::onCommit() { - abort(); + LOG_ABORT("should not be reached"); } bool StringDirectAttribute::addDoc(DocId & doc) diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.hpp b/searchlib/src/vespa/searchlib/attribute/attrvector.hpp index 8f67d237a60..08b54e9d561 100644 --- a/searchlib/src/vespa/searchlib/attribute/attrvector.hpp +++ b/searchlib/src/vespa/searchlib/attribute/attrvector.hpp @@ -130,7 +130,7 @@ template void NumericDirectAttribute::onCommit() { B::_changes.clear(); - abort(); + LOG_ABORT("should not be reached"); } template diff --git a/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp b/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp index 6b9af6c5ec8..40a22d98533 100644 --- a/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp +++ b/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.attribute.create_array_std"); #include "attributefactory.h" #include "defines.h" #include "attributevector.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp b/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp index 8ea6e49ade6..80c03b42e57 100644 --- a/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp +++ b/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.attribute.create_set_std"); #include "attributefactory.h" #include "defines.h" #include "attributevector.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp b/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp index b02aed39444..d55f0ee8063 100644 --- a/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp +++ b/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.attribute.create_single_fast_search"); + #include "attributefactory.h" #include "integerbase.h" #include "floatbase.h" diff --git a/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp b/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp index feaf27da5e4..5a6bddb1cd5 100644 --- a/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp +++ b/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp @@ -1,5 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +LOG_SETUP(".searchlib.attribute.create_single_std"); + #include "attributefactory.h" #include "predicate_attribute.h" #include "singlesmallnumericattribute.h" diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp index 94d36a967ea..d8b6519ef5b 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "enumattribute.h" +#include +LOG_SETUP(".searchlib.attribute.enum_attribute"); #include "enumattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp index 9da670b2bd5..c3cd9d56717 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp @@ -109,7 +109,7 @@ EnumAttribute::insertNewUniqueValues(EnumStoreBase::IndexVector & newIndexes) this->_enumStore.fallbackResize(extraBytesNeeded); if (extraBytesNeeded > this->_enumStore.getRemaining()) { fprintf(stderr, "Cannot fallbackResize enumStore\n"); - abort(); + LOG_ABORT("should not be reached"); } break; // fallback resize performed instead of compaction. } diff --git a/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp b/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp index 314fb781185..ed482263566 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "enumcomparator.h" +#include +LOG_SETUP(".searchlib.attribute.enum_comparator"); #include "enumstore.hpp" #include diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp index 8100fd3f415..65ae627a192 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "enumstore.h" +#include +LOG_SETUP(".searchlib.attribute.enum_store"); #include "enumstore.hpp" #include @@ -130,7 +132,7 @@ EnumStoreT::deserialize(const void *src, uint32_t entrySize(alignEntrySize(EntryBase::size() + sz)); if (buffer.remaining() < entrySize) { fprintf(stderr, "Out of enumstore bufferspace\n"); - abort(); // not enough space + LOG_ABORT("should not be reached"); // not enough space } uint64_t offset = buffer.size(); char *dst(_store.getBufferEntry(activeBufferId, offset)); diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp index 21531e07861..95358beb11d 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp +++ b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp @@ -151,7 +151,7 @@ EnumStoreT::deserialize(const void *src, datastore::BufferState & buffer = _store.getBufferState(activeBufferId); uint32_t entrySize(alignEntrySize(EntryBase::size() + sz)); if (buffer.remaining() < entrySize) { - abort(); // not enough space + LOG_ABORT("should not be reached"); // not enough space } uint64_t offset = buffer.size(); char *dst(_store.getBufferEntry(activeBufferId, offset)); @@ -256,7 +256,7 @@ EnumStoreT::addEnum(Type value, buffer._deadElems, entrySize); #endif if (buffer.remaining() < entrySize) { - abort(); // not enough space + LOG_ABORT("should not be reached"); // not enough space } // check if already present diff --git a/searchlib/src/vespa/searchlib/attribute/enumstorebase.cpp b/searchlib/src/vespa/searchlib/attribute/enumstorebase.cpp index 568b1e7ecb5..c66432df245 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstorebase.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumstorebase.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "enumstorebase.h" +#include +LOG_SETUP(".searchlib.attribute.enumstorebase"); #include "enumstore.h" #include #include @@ -572,7 +574,7 @@ template <> EnumPostingTree & EnumStoreDict::getPostingDictionary() { - abort(); + LOG_ABORT("should not be reached"); } @@ -588,7 +590,7 @@ template <> const EnumPostingTree & EnumStoreDict::getPostingDictionary() const { - abort(); + LOG_ABORT("should not be reached"); } diff --git a/searchlib/src/vespa/searchlib/attribute/extendableattributes.cpp b/searchlib/src/vespa/searchlib/attribute/extendableattributes.cpp index ee984688594..9a69747870e 100644 --- a/searchlib/src/vespa/searchlib/attribute/extendableattributes.cpp +++ b/searchlib/src/vespa/searchlib/attribute/extendableattributes.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.attribute.extendable_attributes"); + #include "extendableattributes.h" #include "attrvector.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp index b359b74f46c..f2db7b5b47a 100644 --- a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "fixedsourceselector.h" +#include +LOG_SETUP(".searchlib.attribute.fixed_source_selector"); #include "singlenumericattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp index 1df7613013b..dde09761343 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "flagattribute.h" +#include +LOG_SETUP(".searchlib.attribute.flag_attribute"); #include "load_utils.hpp" #include "attributeiterators.h" #include "multinumericattribute.hpp" @@ -8,9 +10,6 @@ #include #include -#include -LOG_SETUP(".searchlib.attribute.flagattribute"); - namespace search { using queryeval::SearchIterator; diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp index c480eec5e88..4302725a8b7 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp @@ -1,7 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "bitvector_search_cache.h" #include "imported_search_context.h" +#include +LOG_SETUP(".searchlib.attribute.imported_search_context"); + +#include "bitvector_search_cache.h" #include "imported_attribute_vector.h" #include "reference_attribute.h" #include diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp index 4eb8447297e..38af12380a9 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "multinumericattribute.h" +#include +LOG_SETUP(".searchlib.attribute.multi_numeric_attribute"); #include "multinumericattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp index 3021a37b8cb..3875c563bab 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "multinumericenumattribute.h" +#include +LOG_SETUP(".searchlib.attribute.multi_numeric_enum_attribute"); #include "multinumericenumattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp index 8ea19f26190..32dd578fd4a 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "multistringpostattribute.h" +#include +LOG_SETUP(".searchlib.attribute.multi_string_post_attribute"); #include "multistringpostattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp index f9a638a6090..6f67a2162da 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "postinglistsearchcontext.h" +#include +LOG_SETUP(".searchlib.attribute.posting_list_search_context"); #include "postinglistsearchcontext.hpp" #include "attributeiterators.hpp" #include "diversity.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp index 68eda476df7..86f658a0be2 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "postingstore.h" +#include +LOG_SETUP(".searchlib.attribute.posting_store"); #include #include #include diff --git a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp index 40405d4f5d9..49dcb9297b6 100644 --- a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.attribute.predicate_attribute"); #include "predicate_attribute.h" #include #include @@ -8,9 +10,6 @@ #include "iattributesavetarget.h" #include "attribute_header.h" -#include -LOG_SETUP(".predicate_attribute"); - using document::Predicate; using document::PredicateFieldValue; using vespalib::DataBuffer; diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp index 1566ca47eb1..87fe4bd3a2b 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "reference_attribute.h" +#include +LOG_SETUP(".searchlib.attribute.reference_attribute"); #include "reference_attribute_saver.h" #include "attributesaver.h" #include "readerbase.h" diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp index b607bd52859..41cfb972ad0 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singleenumattribute.h" +#include +LOG_SETUP(".searchlib.attribute.single_enum_attribute"); #include "singleenumattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp index 661a7f388da..3f497f613a2 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singlenumericattribute.h" +#include +LOG_SETUP(".searchlib.attribute.single_numeric_attribute"); #include "singlenumericattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp index 9eea2773fb4..bedf3dc564f 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singlenumericenumattribute.h" +#include +LOG_SETUP(".searchlib.attribute.single_numeric_enum_attribute"); #include "singlenumericenumattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp index e47fd93dc65..d5626d1d092 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singlenumericpostattribute.h" +#include +LOG_SETUP(".searchlib.attribute.single_numeric_post_attribute"); #include "singlenumericpostattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp index 0be4972a4a7..ce02b9b4725 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singlesmallnumericattribute.h" +#include +LOG_SETUP(".searchlib.asingle_small_numeric_attribute"); #include "attributevector.hpp" #include "primitivereader.h" #include "attributeiterators.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp index 70070fd741b..54b9eb7ed81 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "singlestringattribute.h" +#include +LOG_SETUP(".searchlib.attribute.single_string_attribute"); #include "singlestringattribute.hpp" namespace search { diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp index 50abcca96a7..76f0325feae 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp @@ -1185,7 +1185,7 @@ lookup(const vespalib::stringref &key) break; // key < counts } LOG(error, "FATAL: Missing L7 entry for overflow entry"); - abort(); // counts < key, should not happen (missing L7 entry) + LOG_ABORT("should not be reached"); // counts < key, should not happen (missing L7 entry) } else { bool l6NotLessThanKey = !(word < key); if (l6NotLessThanKey) @@ -1477,7 +1477,7 @@ lookup(const SSReader &ssReader, bool l3NotLessThanKey = !(word < key); if (l3NotLessThanKey) break; - abort(); + LOG_ABORT("should not be reached"); _l3Word = word; } readStartOffset(dL3, diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp index 739018b99a5..e06c675be94 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp @@ -146,7 +146,7 @@ PosOccFieldParams::setSchemaParams(const Schema &schema, uint32_t fieldId) break; default: LOG(error, "Bad collection type"); - abort(); + LOG_ABORT("should not be reached"); } _avgElemLen = field.getAvgElemLen(); _name = field.getName(); @@ -180,7 +180,7 @@ PosOccFieldParams::readHeader(const vespalib::GenericHeader &header, break; default: LOG(error, "Bad collection type when reading field param in header"); - abort(); + LOG_ABORT("should not be reached"); } _avgElemLen = header.getTag(avgElemLenKey).asInteger(); } @@ -208,7 +208,7 @@ PosOccFieldParams::writeHeader(vespalib::GenericHeader &header, default: LOG(error, "Bad collection type when writing field param in header"); - abort(); + LOG_ABORT("should not be reached"); } header.putTag(GenericHeader::Tag(collKey, schema::getTypeName(ct))); header.putTag(GenericHeader::Tag(avgElemLenKey, _avgElemLen)); @@ -285,7 +285,7 @@ PosOccFieldsParams::setSchemaParams(const Schema &schema, cacheParamsRef(); const Schema::IndexField &field = schema.getIndexField(indexId); if (!SchemaUtil::validateIndexField(field)) - abort(); + LOG_ABORT("should not be reached"); _params[0].setSchemaParams(schema, indexId); } diff --git a/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp b/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp index 4607efd6673..d5ac368ce77 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp @@ -1,6 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "btreeinserter.h" + +#include +LOG_SETUP(".searchlib.btree.btreeinserter"); + #include "btreenodeallocator.h" #include "btreerootbase.hpp" #include "btreeinserter.hpp" diff --git a/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp b/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp index ae9d27d4c5d..b4ccbfed9e0 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include "btreeiterator.h" +#include +LOG_SETUP(".searchlib.btree.breeiterator"); #include "btreeroot.h" #include "btreenodeallocator.h" #include "btreeiterator.hpp" diff --git a/searchlib/src/vespa/searchlib/btree/btreeiterator.hpp b/searchlib/src/vespa/searchlib/btree/btreeiterator.hpp index 741121aebab..33bc228653d 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeiterator.hpp +++ b/searchlib/src/vespa/searchlib/btree/btreeiterator.hpp @@ -557,17 +557,17 @@ BTreeIteratorBase:: identical(const BTreeIteratorBase &rhs) const { if (_pathSize != rhs._pathSize || _leaf != rhs._leaf) { - abort(); + LOG_ABORT("should not be reached"); return false; } for (uint32_t level = 0; level < _pathSize; ++level) { if (_path[level] != rhs._path[level]) { - abort(); + LOG_ABORT("should not be reached"); return false; } } if (_leafRoot != rhs._leafRoot) { - abort(); + LOG_ABORT("should not be reached"); return false; } return true; diff --git a/searchlib/src/vespa/searchlib/btree/btreeroot.cpp b/searchlib/src/vespa/searchlib/btree/btreeroot.cpp index f233ea324d1..cce157c0cbc 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeroot.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeroot.cpp @@ -1,6 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "btreeroot.h" + +#include +LOG_SETUP(".searchlib.btree.btreeroot"); + #include "btreenodeallocator.h" #include "btreeiterator.hpp" #include "btreeroot.hpp" diff --git a/searchlib/src/vespa/searchlib/btree/btreestore.cpp b/searchlib/src/vespa/searchlib/btree/btreestore.cpp index 06c968eec1f..f183d4d4f15 100644 --- a/searchlib/src/vespa/searchlib/btree/btreestore.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreestore.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "btreestore.h" +#include +LOG_SETUP(".searchlib.btree.breestore"); #include "btreestore.hpp" #include "btreeiterator.hpp" diff --git a/searchlib/src/vespa/searchlib/common/bitvector.cpp b/searchlib/src/vespa/searchlib/common/bitvector.cpp index 9f78f6ff222..ece025454c9 100644 --- a/searchlib/src/vespa/searchlib/common/bitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/bitvector.cpp @@ -9,6 +9,9 @@ #include #include +#include +LOG_SETUP(".searchlib.common.bitvector"); + using vespalib::make_string; using vespalib::IllegalArgumentException; using vespalib::hwaccelrated::IAccelrated; @@ -275,12 +278,12 @@ BitVector::hasTrueBitsInternal() const void BitVector::resize(Index) { - abort(); + LOG_ABORT("should not be reached"); } GenerationHeldBase::UP BitVector::grow(Index, Index ) { - abort(); + LOG_ABORT("should not be reached"); } size_t diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp index 5004ba80913..b6b0baea92a 100644 --- a/searchlib/src/vespa/searchlib/common/packets.cpp +++ b/searchlib/src/vespa/searchlib/common/packets.cpp @@ -426,7 +426,7 @@ FS4Packet_Shared::Encode(FNET_DataBuffer *dst) { bool FS4Packet_Shared::Decode(FNET_DataBuffer *, uint32_t ) { - abort(); + LOG_ABORT("should not be reached"); } vespalib::string @@ -492,7 +492,7 @@ FS4Packet_PreSerialized::Encode(FNET_DataBuffer *dst) bool FS4Packet_PreSerialized::Decode(FNET_DataBuffer *, uint32_t) { - abort(); + LOG_ABORT("should not be reached"); } vespalib::string diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp index b405542292d..68e7155505f 100644 --- a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp +++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp @@ -4,6 +4,9 @@ #include #include +#include +LOG_SETUP(".searchlib.datastore.datastorebase"); + using vespalib::GenerationHeldBase; namespace search::datastore { @@ -324,7 +327,7 @@ DataStoreBase::getMemStats() const stats._deadBytes += bState.getDeadElems() * elementSize; stats._holdBytes += (bState.getHoldElems() * elementSize) + bState.getExtraHoldBytes(); } else { - abort(); + LOG_ABORT("should not be reached"); } } size_t genHolderHeldBytes = _genHolder.getHeldBytes(); @@ -353,7 +356,7 @@ DataStoreBase::getAddressSpaceUsage() const } else if (bState.isFree()) { limitClusters += _maxClusters; } else { - abort(); + LOG_ABORT("should not be reached"); } } return AddressSpace(usedClusters, deadClusters, limitClusters); diff --git a/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp b/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp index 7e479cb2905..b35c25fcfd3 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp @@ -90,7 +90,7 @@ FileHeader::taste(const vespalib::string &name, if (_completed && _fileBitSize > 8 * fileSize) { LOG(error, "FileHeader::taste(\"%s\"): fleBitSize(%" PRIu64 ") > 8 * fileSize(%" PRIu64 ")", name.c_str(), _fileBitSize, fileSize); - abort(); + LOG_ABORT("should not be reached"); } } else if (!_allowNoFileBitSize) { LOG(error, "FileHeader::taste(\"%s\"): Missing fileBitSize tag", name.c_str()); diff --git a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp index 5dc5af68a38..e61fe7bab17 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp @@ -214,7 +214,7 @@ Fusion::mergeField(uint32_t id) if (!res) { LOG(error, "Could not merge field postings for field %s dir %s", indexName.c_str(), indexDir.c_str()); - abort(); + LOG_ABORT("should not be reached"); } if (!FileKit::createStamp(indexDir + "/.mergeocc_done")) return false; @@ -324,7 +324,7 @@ Fusion::openFieldWriter(const SchemaUtil::IndexIterator &index, _fileHeaderContext)) { LOG(error, "Could not open output posocc + dictionary in %s", dir.c_str()); - abort(); + LOG_ABORT("should not be reached"); return false; } return true; @@ -375,7 +375,7 @@ Fusion::mergeFieldPostings(const SchemaUtil::IndexIterator &index) if (!fieldWriter.close()) { LOG(error, "Could not close output posocc + dictionary in %s/%s", _outDir.c_str(), indexName.c_str()); - abort(); + LOG_ABORT("should not be reached"); } return true; } diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp index 171e862f064..99eced5f97b 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp @@ -297,7 +297,7 @@ FileHandle::open(const vespalib::stringref &dir, tuneFileWrite, fileHeaderContext)) { LOG(error, "Could not open term writer %s for write (%s)", dir.c_str(), getLastErrorString().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -688,7 +688,7 @@ IndexBuilder::open(uint32_t docIdLimit, uint64_t numWordIds, vespalib::string schemaFile = appendToPrefix("schema.txt"); if (!_schema.saveToFile(schemaFile)) { LOG(error, "Cannot save schema to \"%s\"", schemaFile.c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -705,7 +705,7 @@ IndexBuilder::close() if (!docsummary::DocumentSummary::writeDocIdLimit(_prefix, _docIdLimit)) { LOG(error, "Could not write docsum count in dir %s: %s", _prefix.c_str(), getLastErrorString().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp index 72fd07e5752..791e41de497 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp @@ -23,7 +23,7 @@ void assertOpenWriteOnly(bool ok, const vespalib::string &fileName) LOG(error, "Could not open %s for write: %s", fileName.c_str(), vespalib::getOpenErrorString(osError, fileName.c_str()).c_str()); - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp index 17d4457a318..688e3ef59e1 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp @@ -697,7 +697,7 @@ Zc4PostingSeqWrite::readHeader(const vespalib::string &name) if (!res) { LOG(error, "Could not open %s for reading file header: %s", name.c_str(), getLastErrorString().c_str()); - abort(); + LOG_ABORT("should not be reached"); } drc.setFile(&file); diff --git a/searchlib/src/vespa/searchlib/memoryindex/compact_document_words_store.cpp b/searchlib/src/vespa/searchlib/memoryindex/compact_document_words_store.cpp index ef942986ca5..b7fb3307de6 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/compact_document_words_store.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/compact_document_words_store.cpp @@ -143,7 +143,7 @@ CompactDocumentWordsStore::insert(const Builder &builder) if (!insres.second) { LOG(error, "Failed inserting remove info for docid %u", builder.docId()); - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp b/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp index 6a42570da53..66fed0e4262 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp @@ -4,6 +4,9 @@ #include "fieldinverter.h" #include +#include +LOG_SETUP(".searchlib.memoryindex.dictionary"); + #include #include #include diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp index f6c3e5b5ea6..f201d4c2572 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp @@ -1,6 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "memoryfieldindex.h" +#include +LOG_SETUP(".searchlib.memoryindex.memory_field_index"); + #include #include diff --git a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp index 8cd74b7d630..3df56dd095c 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "ordereddocumentinserter.h" +#include +LOG_SETUP(".searchlib.memoryindex.ordered_document_inserter"); #include "i_document_insert_listener.h" #include diff --git a/searchlib/src/vespa/searchlib/memoryindex/postingiterator.cpp b/searchlib/src/vespa/searchlib/memoryindex/postingiterator.cpp index 4fdc164ecdb..f23fc380bbe 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/postingiterator.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/postingiterator.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "postingiterator.h" +#include +LOG_SETUP(".searchlib.memoryindex.postingiterator"); #include #include diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp index 6f49dc62686..ef85835d9b6 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp @@ -326,7 +326,7 @@ SimpleQueryStack::StackbufToString(const vespalib::stringref &theBuf) default: LOG(error, "Unhandled type %d", type); - abort(); + LOG_ABORT("should not be reached"); } } return result; diff --git a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp index 44b13e6bb2a..c22d05c5e32 100644 --- a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp +++ b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "document_features_store.h" +#include +LOG_SETUP(".searchlib.predicate.document_features_store"); #include "predicate_index.h" #include "predicate_range_expander.h" #include "predicate_tree_annotator.h" diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp index 2275f079c04..b83b66f997f 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.predicate.predicate_index"); #include "predicate_index.h" #include "predicate_hash.h" diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp index d2459e8d719..f84cbac2b95 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "predicate_interval_store.h" +#include +LOG_SETUP(".searchlib.predicate.predicate_interval_store"); #include "predicate_index.h" #include diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp index ddd657cbb4d..7dc5cca376e 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp @@ -1,14 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "predicate_tree_annotator.h" +#include +LOG_SETUP(".searchlib.predicate.predicate_tree_annotator"); #include "predicate_index.h" #include "predicate_range_expander.h" #include "predicate_tree_analyzer.h" #include -#include -LOG_SETUP(".predicate_tree_annotator"); - using document::Predicate; using std::map; using std::string; diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp index 28b1e2ab877..7a57699a494 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.predicate.predicate_zero_constraint_posting_list"); + #include "predicate_zero_constraint_posting_list.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp index d78d9d6533f..0e562681a3e 100644 --- a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp +++ b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp @@ -1,9 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.predicate.simple_index"); #include "simple_index.hpp" #include -#include -LOG_SETUP(".searchlib.simple_index"); namespace search { namespace predicate { diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp index a119823c0dd..7bac71552c6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".searchlib.predicate.predicate_blueprint"); #include "predicate_blueprint.h" #include #include @@ -8,8 +10,6 @@ #include #include -#include -LOG_SETUP(".predicate_blueprint"); #include using search::query::PredicateQuery; diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp index 18fda4d7d3d..02a9a339807 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "dense_tensor_attribute.h" +#include +LOG_SETUP(".searchlib.tensor.dense_tensor_attribute"); #include "dense_tensor_attribute_saver.h" #include "tensor_attribute.hpp" #include @@ -66,7 +68,7 @@ TensorReader::getNumCells() { return 0u; } if (detect != tensorIsPresent) { - abort(); + LOG_ABORT("should not be reached"); } size_t numCells = _numBoundCells; if (_numUnboundDims != 0) { diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp index 67e40fa5061..10f7c7c5326 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp @@ -4,6 +4,8 @@ #include "fpfactory.h" #include #include +#include +LOG_SETUP(".searchlib.test.fake_eg_compr64_filter_occ"); using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; @@ -1428,7 +1430,7 @@ FakeFilterOccEGCompressed64SkipArrayIterator::doSeek(uint32_t docId) oCacheInt, oPreRead, _l1SkipDocIdBitsOffset); - abort(); + LOG_ABORT("should not be reached"); } #if DEBUG_EGCOMPR64FILTEROCC_PRINTF printf("L1DecodeV docId=%d docIdPos=%d L1SkipPos=%d\n", diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp index c31a2096a2f..d6df63681ed 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp @@ -2,6 +2,8 @@ #include "fakememtreeocc.h" #include "fpfactory.h" +#include +LOG_SETUP(".fakememtreeocc"); #include #include #include @@ -10,8 +12,6 @@ #include #include #include -#include -LOG_SETUP(".fakememtreeocc"); using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; @@ -325,7 +325,7 @@ FakeMemTreeOccFactory::make(const FakeWord &fw) i(_mgr._fw2WordIdx.find(&fw)); if (i == _mgr._fw2WordIdx.end()) - abort(); + LOG_ABORT("should not be reached"); uint32_t wordIdx = i->second; @@ -395,7 +395,7 @@ FakeMemTreeOcc2Factory::make(const FakeWord &fw) i(_mgr._fw2WordIdx.find(&fw)); if (i == _mgr._fw2WordIdx.end()) - abort(); + LOG_ABORT("should not be reached"); uint32_t wordIdx = i->second; diff --git a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp index 35bdc71c963..47ab81f9b2e 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp @@ -662,7 +662,7 @@ int32_t DomainPart::calcCrc(Crc version, const void * buf, size_t sz) calculator.process_bytes(buf, sz); return calculator.checksum(); } else { - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp index 3c964c2a04d..0b02d10ffab 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp @@ -33,7 +33,7 @@ getCrc(searchlib::TranslogserverConfig::Crcmethod crcType) case searchlib::TranslogserverConfig::xxh64: return DomainPart::xxh64; } - abort(); + LOG_ABORT("should not be reached"); } } diff --git a/searchlib/src/vespa/searchlib/util/statebuf.cpp b/searchlib/src/vespa/searchlib/util/statebuf.cpp index 27ccb76d289..12d18599a41 100644 --- a/searchlib/src/vespa/searchlib/util/statebuf.cpp +++ b/searchlib/src/vespa/searchlib/util/statebuf.cpp @@ -2,6 +2,10 @@ #include "statebuf.h" +#include +LOG_SETUP(".searchlib.util.statebuf"); + + static const char *hexx = "0123456789abcdef"; namespace search { @@ -9,7 +13,7 @@ namespace search { void StateBuf::overflow() noexcept { - abort(); + LOG_ABORT("should not be reached"); } @@ -120,7 +124,7 @@ StateBuf::appendDecFraction(unsigned long val, unsigned int width) noexcept { char buf[22]; if (width > sizeof(buf)) { - abort(); + LOG_ABORT("should not be reached"); } char *p = buf; char *pe = buf + width; @@ -174,7 +178,7 @@ StateBuf::appendTimestamp() noexcept */ int gtres = clock_gettime(CLOCK_REALTIME, &ts); if (gtres != 0) { - abort(); + LOG_ABORT("should not be reached"); } appendTimestamp(ts); return *this; diff --git a/searchlib/src/vespa/searchlib/util/statefile.cpp b/searchlib/src/vespa/searchlib/util/statefile.cpp index 052a18ce97d..5cccc4c6d74 100644 --- a/searchlib/src/vespa/searchlib/util/statefile.cpp +++ b/searchlib/src/vespa/searchlib/util/statefile.cpp @@ -8,6 +8,9 @@ #include #include +#include +LOG_SETUP(".searchlib.util.statefile"); + using Mutex = std::mutex; using Guard = std::lock_guard; @@ -32,7 +35,7 @@ myopen(const char *name) noexcept std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not open %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } return fd; } @@ -45,7 +48,7 @@ myfstat(const char *name, int fd, struct stat &stbuf) noexcept if (fsres != 0) { std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not fstat %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -66,7 +69,7 @@ mypread(const char *name, int fd, void *buf, size_t bufLen, int64_t offset) noex "Could not read %zu bytes from %s offset %" PRId64 ": %s\n", bufLen, name, offset, ec.message().c_str()); } - abort(); + LOG_ABORT("should not be reached"); } } @@ -87,7 +90,7 @@ mypwrite(const char *name, int fd, const void *buf, size_t bufLen, "Could not write %zu bytes to %s offset %" PRId64 ": %s\n", bufLen, name, offset, ec.message().c_str()); } - abort(); + LOG_ABORT("should not be reached"); } } @@ -100,7 +103,7 @@ myclose(const char *name, int fd) noexcept std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not close %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -113,7 +116,7 @@ myfsync(const char *name, int fd) noexcept std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not fsync %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -126,7 +129,7 @@ myunlink(const char *name) noexcept std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not unlink %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } } @@ -279,7 +282,7 @@ StateFile::trimHistory(std::vector &history, const char *name, int hfd, std::error_code ec(errno, std::system_category()); fprintf(stderr, "Could not truncate %s: %s\n", name, ec.message().c_str()); - abort(); + LOG_ABORT("should not be reached"); } history.resize(newHistSize); } @@ -342,17 +345,17 @@ StateFile::checkState(const char *buf, size_t bufLen) noexcept if (*p == '\n') { if (p != buf + bufLen - 1) { mystderr("statefile state corrupted: early newline\n"); - abort(); + LOG_ABORT("should not be reached"); } return; } if (*p == '\0') { mystderr("statefile state corrupted: nul byte found\n"); - abort(); + LOG_ABORT("should not be reached"); } } mystderr("statefile state corrupted: missing newline at end\n"); - abort(); + LOG_ABORT("should not be reached"); } @@ -370,22 +373,22 @@ StateFile::internalAddSignalState(const char *buf, size_t bufLen, 0644); if (fd < 0) { mystderr(openerr); - abort(); + LOG_ABORT("should not be reached"); } ssize_t wres = write(fd, buf, bufLen); if (static_cast(wres) != bufLen) { mystderr(writeerr); - abort(); + LOG_ABORT("should not be reached"); } int fsyncres = fsync(fd); if (fsyncres != 0) { mystderr(fsyncerr); - abort(); + LOG_ABORT("should not be reached"); } int closeres = close(fd); if (closeres != 0) { mystderr(closeerr); - abort(); + LOG_ABORT("should not be reached"); } } -- cgit v1.2.3