summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-06-12 12:50:28 +0200
committerArne Juul <arnej@yahoo-inc.com>2018-06-12 13:51:45 +0200
commit016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 (patch)
tree869d4e4a4c4b8a9f9ef691b2980009017dece9e6
parent22796dddd3dc025018093783328ac87535ffecd9 (diff)
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 <vespa/log/log.h> include and LOG_SETUP lines before LOG_ABORT is used (or included).
-rw-r--r--config/src/vespa/config/print/fileconfigformatter.cpp5
-rw-r--r--document/src/vespa/document/base/globalid.cpp5
-rw-r--r--document/src/vespa/document/datatype/primitivedatatype.cpp7
-rw-r--r--document/src/vespa/document/repo/document_type_repo_factory.cpp5
-rw-r--r--document/src/vespa/document/select/result.h5
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/policies/errorpolicy.cpp4
-rw-r--r--eval/src/vespa/eval/eval/aggr.cpp5
-rw-r--r--eval/src/vespa/eval/eval/basic_nodes.h3
-rw-r--r--eval/src/vespa/eval/eval/llvm/compiled_function.cpp5
-rw-r--r--eval/src/vespa/eval/eval/tensor_function.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_add_dimension_optimizer.cpp3
-rw-r--r--eval/src/vespa/eval/tensor/serialization/typed_binary_format.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h5
-rw-r--r--eval/src/vespa/eval/tensor/wrapped_simple_tensor.cpp9
-rw-r--r--fastlib/src/vespa/fastlib/io/bufferedfile.h2
-rw-r--r--fnet/ethereal/packet-fnetrpc.c2
-rw-r--r--fnet/src/vespa/fnet/controlpacket.cpp7
-rw-r--r--fnet/src/vespa/fnet/dummypacket.cpp6
-rw-r--r--fnet/src/vespa/fnet/frt/invoker.cpp2
-rw-r--r--searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp2
-rw-r--r--searchcore/src/tests/applyattrupdates/applyattrupdates.cpp8
-rw-r--r--searchcore/src/tests/grouping/grouping.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_initializer/attribute_initializer_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp6
-rw-r--r--searchcore/src/tests/proton/common/cachedselect_test.cpp6
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp2
-rw-r--r--searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp10
-rw-r--r--searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/querynodes_test.cpp4
-rw-r--r--searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp5
-rw-r--r--searchcore/src/tests/proton/server/documentretriever_test.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_directory.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/attrupdate.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/hw_info_sampler.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/flushengine/tls_stats_map.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/attribute_utils.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h6
-rw-r--r--searchlib/src/apps/tests/btreestress_test.cpp6
-rw-r--r--searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp2
-rw-r--r--searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp2
-rw-r--r--searchlib/src/tests/aggregator/attr_test.cpp3
-rw-r--r--searchlib/src/tests/aggregator/perdocexpr.cpp4
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp11
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributeupdater.h4
-rw-r--r--searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp3
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp6
-rw-r--r--searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp5
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp5
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp3
-rw-r--r--searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp6
-rw-r--r--searchlib/src/tests/btree/frozenbtree_test.cpp8
-rw-r--r--searchlib/src/tests/btree/iteratespeed.cpp6
-rw-r--r--searchlib/src/tests/diskindex/fusion/fusion_test.cpp3
-rw-r--r--searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp2
-rw-r--r--searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp5
-rw-r--r--searchlib/src/tests/grouping/grouping_test.cpp3
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp6
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_test.cpp3
-rw-r--r--searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp6
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp7
-rw-r--r--searchlib/src/tests/queryeval/queryeval.cpp5
-rw-r--r--searchlib/src/tests/util/bufferwriter/bm.cpp2
-rw-r--r--searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp8
-rw-r--r--searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributefile.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attrvector.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attrvector.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createarraystd.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsetstd.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumattribute.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.hpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstorebase.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/extendableattributes.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/flagattribute.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postingstore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/btree/btreeinserter.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/btree/btreeiterator.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/btree/btreeiterator.hpp6
-rw-r--r--searchlib/src/vespa/searchlib/btree/btreeroot.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/btree/btreestore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/common/bitvector.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastorebase.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/fileheader.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/fusion.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/zcposting.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/compact_document_words_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/postingiterator.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/predicate/document_features_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_index.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/predicate/simple_index.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/util/statebuf.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/util/statefile.cpp33
-rw-r--r--searchsummary/src/tests/docsummary/positionsdfw_test.cpp10
-rw-r--r--slobrok/src/vespa/slobrok/sbmirror.cpp6
-rw-r--r--slobrok/src/vespa/slobrok/server/cmd.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp2
-rw-r--r--storage/src/tests/bucketdb/judymultimaptest.cpp2
-rw-r--r--storage/src/tests/bucketdb/lockablemaptest.cpp2
-rw-r--r--storage/src/vespa/storage/bucketdb/judymultimap.hpp5
-rw-r--r--storage/src/vespa/storage/bucketdb/storbucketdb.cpp2
-rw-r--r--storage/src/vespa/storage/bucketmover/bucketmover.cpp5
-rw-r--r--storage/src/vespa/storage/distributor/maintenance/maintenancescheduler.cpp5
-rw-r--r--storage/src/vespa/storage/frameworkimpl/thread/appkiller.cpp2
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp5
-rw-r--r--storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp3
-rw-r--r--storage/src/vespa/storage/storageserver/mergethrottler.cpp2
-rw-r--r--storageframework/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp4
-rw-r--r--storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp3
-rw-r--r--streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp4
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp6
-rw-r--r--vdslib/src/vespa/vdslib/distribution/distribution.cpp4
-rw-r--r--vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp5
-rw-r--r--vespalib/src/tests/delegatelist/delegatelist.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/binary_format.cpp7
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/inject.cpp5
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/json_format.cpp5
-rw-r--r--vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp5
-rw-r--r--vespalib/src/vespa/vespalib/net/selector.cpp3
-rw-r--r--vespalib/src/vespa/vespalib/stllike/asciistream.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_master.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/testkit/time_bomb.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/util/hashmap.h2
-rw-r--r--vsm/src/vespa/vsm/searcher/fold.cpp4
-rw-r--r--vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp4
176 files changed, 488 insertions, 248 deletions
diff --git a/config/src/vespa/config/print/fileconfigformatter.cpp b/config/src/vespa/config/print/fileconfigformatter.cpp
index 507e1440bae..e4071474760 100644
--- a/config/src/vespa/config/print/fileconfigformatter.cpp
+++ b/config/src/vespa/config/print/fileconfigformatter.cpp
@@ -7,6 +7,9 @@
#include <cmath>
#include <vector>
+#include <vespa/log/log.h>
+LOG_SETUP(".config.print.fileconfigformatter");
+
using namespace vespalib::slime::convenience;
using vespalib::slime::ArrayTraverser;
@@ -128,7 +131,7 @@ struct ConfigEncoder : public ArrayTraverser,
case vespalib::slime::OBJECT::ID: return encodeOBJECT(inspector);
case vespalib::slime::NIX::ID: return;
}
- abort(); // should not be reached
+ LOG_ABORT("should not be reached"); // should not be reached
}
void entry(size_t idx, const Inspector &inspector) override;
void field(const Memory &symbol_name, const Inspector &inspector) override;
diff --git a/document/src/vespa/document/base/globalid.cpp b/document/src/vespa/document/base/globalid.cpp
index 354e6ce67aa..5211647e848 100644
--- a/document/src/vespa/document/base/globalid.cpp
+++ b/document/src/vespa/document/base/globalid.cpp
@@ -7,6 +7,9 @@
#include <vespa/vespalib/stllike/hash_set.hpp>
#include <cassert>
+#include <vespa/log/log.h>
+LOG_SETUP(".document.base.globalid");
+
namespace {
bool
@@ -29,7 +32,7 @@ getHexVal(char c)
return (c - 'A' + 10);
}
assert(validateHex(c));
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/document/src/vespa/document/datatype/primitivedatatype.cpp b/document/src/vespa/document/datatype/primitivedatatype.cpp
index fef0e532e44..aa8879e299e 100644
--- a/document/src/vespa/document/datatype/primitivedatatype.cpp
+++ b/document/src/vespa/document/datatype/primitivedatatype.cpp
@@ -6,6 +6,9 @@
#include <vespa/vespalib/util/stringfmt.h>
#include <sstream>
+#include <vespa/log/log.h>
+LOG_SETUP(".document.datatype.primitivedatatype");
+
namespace document {
IMPLEMENT_IDENTIFIABLE_ABSTRACT(PrimitiveDataType, DataType);
@@ -64,10 +67,10 @@ PrimitiveDataType::createFieldValue() const
case T_BYTE: return FieldValue::UP(new ByteFieldValue);
case T_PREDICATE: return FieldValue::UP(new PredicateFieldValue);
case T_TENSOR: return std::make_unique<TensorFieldValue>();
- abort();
+ LOG_ABORT("should not be reached");
}
assert(!"getId() returned value out of range");
- abort();
+ LOG_ABORT("should not be reached");
}
void
diff --git a/document/src/vespa/document/repo/document_type_repo_factory.cpp b/document/src/vespa/document/repo/document_type_repo_factory.cpp
index 208b64dc77c..e60c4c976a9 100644
--- a/document/src/vespa/document/repo/document_type_repo_factory.cpp
+++ b/document/src/vespa/document/repo/document_type_repo_factory.cpp
@@ -5,6 +5,9 @@
#include <vespa/document/config/config-documenttypes.h>
#include <iostream>
+#include <vespa/log/log.h>
+LOG_SETUP(".document.repo.document_type_repo_factory");
+
namespace document {
std::mutex DocumentTypeRepoFactory::_mutex;
@@ -22,7 +25,7 @@ EmptyFactoryCheck::~EmptyFactoryCheck()
{
if (!DocumentTypeRepoFactory::empty()) {
std::cerr << "DocumentTypeRepoFactory not empty at shutdown" << std::endl;
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/document/src/vespa/document/select/result.h b/document/src/vespa/document/select/result.h
index bdfb6c8c0ee..157121b43dd 100644
--- a/document/src/vespa/document/select/result.h
+++ b/document/src/vespa/document/select/result.h
@@ -19,6 +19,7 @@
#pragma once
+#include <assert.h>
#include <vespa/document/util/printable.h>
namespace document::select {
@@ -48,7 +49,7 @@ public:
return 1u;
if (this == &Result::True)
return 2u;
- abort();
+ assert(false); abort();
}
static const Result &fromEnum(uint32_t val) {
@@ -58,7 +59,7 @@ public:
return Result::False;
if (val == 2u)
return Result::True;
- abort();
+ assert(false); abort();
}
private:
diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/errorpolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/errorpolicy.cpp
index 1e9911ecf77..7b87e7df834 100644
--- a/documentapi/src/vespa/documentapi/messagebus/policies/errorpolicy.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/policies/errorpolicy.cpp
@@ -3,6 +3,8 @@
#include "errorpolicy.h"
#include <vespa/documentapi/messagebus/documentprotocol.h>
#include <vespa/messagebus/emptyreply.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".documentapi.messagebus.policies.error_policy");
namespace documentapi {
@@ -19,7 +21,7 @@ ErrorPolicy::select(mbus::RoutingContext &ctx)
void
ErrorPolicy::merge(mbus::RoutingContext &)
{
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/eval/src/vespa/eval/eval/aggr.cpp b/eval/src/vespa/eval/eval/aggr.cpp
index f6f04cde6be..8aacac64041 100644
--- a/eval/src/vespa/eval/eval/aggr.cpp
+++ b/eval/src/vespa/eval/eval/aggr.cpp
@@ -3,6 +3,9 @@
#include "aggr.h"
#include <vespa/vespalib/util/stash.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.eval.aggr");
+
namespace vespalib {
namespace eval {
@@ -117,7 +120,7 @@ Aggregator::create(Aggr aggr, Stash &stash)
case Aggr::MAX: return stash.create<Max>();
case Aggr::MIN: return stash.create<Min>();
}
- abort();
+ LOG_ABORT("should not be reached");
}
} // namespace vespalib::eval
diff --git a/eval/src/vespa/eval/eval/basic_nodes.h b/eval/src/vespa/eval/eval/basic_nodes.h
index ebf65178b99..e6caf052367 100644
--- a/eval/src/vespa/eval/eval/basic_nodes.h
+++ b/eval/src/vespa/eval/eval/basic_nodes.h
@@ -2,6 +2,7 @@
#pragma once
+#include <vespa/log/log.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/util/string_hash.h>
@@ -80,7 +81,7 @@ const T *as(const Node &node) { return dynamic_cast<const T *>(&node); }
struct Leaf : public Node {
size_t num_children() const override { return 0; }
const Node &get_child(size_t) const override {
- abort();
+ LOG_ABORT("should not be reached");
}
void detach_children(NodeHandler &) override {}
};
diff --git a/eval/src/vespa/eval/eval/llvm/compiled_function.cpp b/eval/src/vespa/eval/eval/llvm/compiled_function.cpp
index a696f16f849..4c911ee6e44 100644
--- a/eval/src/vespa/eval/eval/llvm/compiled_function.cpp
+++ b/eval/src/vespa/eval/eval/llvm/compiled_function.cpp
@@ -10,6 +10,9 @@
#include <vespa/vespalib/util/benchmark_timer.h>
#include <vespa/vespalib/util/approx.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.eval.llvm.compiled_function");
+
namespace vespalib {
namespace eval {
@@ -113,7 +116,7 @@ CompiledFunction::estimate_cost_us(const std::vector<double> &params, double bud
auto baseline = [&](){empty(params[0], params[1], params[2], params[3], params[4]);};
return BenchmarkTimer::benchmark(actual, baseline, budget) * 1000.0 * 1000.0;
}
- abort();
+ LOG_ABORT("should not be reached");
}
Function::Issues
diff --git a/eval/src/vespa/eval/eval/tensor_function.cpp b/eval/src/vespa/eval/eval/tensor_function.cpp
index 3f79ac848ce..10e589c832c 100644
--- a/eval/src/vespa/eval/eval/tensor_function.cpp
+++ b/eval/src/vespa/eval/eval/tensor_function.cpp
@@ -9,6 +9,9 @@
#include "visit_stuff.h"
#include <vespa/vespalib/objects/objectdumper.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.eval.tensor_function");
+
namespace vespalib {
namespace eval {
@@ -292,7 +295,7 @@ If::compile_self(Stash &) const
{
// 'if' is handled directly by compile_tensor_function to enable
// lazy-evaluation of true/false sub-expressions.
- abort();
+ LOG_ABORT("should not be reached");
}
void
diff --git a/eval/src/vespa/eval/tensor/dense/dense_add_dimension_optimizer.cpp b/eval/src/vespa/eval/tensor/dense/dense_add_dimension_optimizer.cpp
index 9baaa596d9f..cd874186e46 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_add_dimension_optimizer.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_add_dimension_optimizer.cpp
@@ -6,6 +6,9 @@
#include <vespa/eval/eval/operation.h>
#include <vespa/eval/eval/value.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.tensor.dense.add_dimension_optimizer");
+
namespace vespalib::tensor {
using eval::ValueType;
diff --git a/eval/src/vespa/eval/tensor/serialization/typed_binary_format.cpp b/eval/src/vespa/eval/tensor/serialization/typed_binary_format.cpp
index 5db4f0aeb12..fe35ce4c831 100644
--- a/eval/src/vespa/eval/tensor/serialization/typed_binary_format.cpp
+++ b/eval/src/vespa/eval/tensor/serialization/typed_binary_format.cpp
@@ -10,6 +10,9 @@
#include <vespa/eval/eval/simple_tensor.h>
#include <vespa/eval/tensor/wrapped_simple_tensor.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.tensor.serialization.typed_binary_format");
+
using vespalib::nbostream;
namespace vespalib {
@@ -48,7 +51,7 @@ TypedBinaryFormat::deserialize(nbostream &stream)
stream.adjustReadPos(read_pos - stream.rp());
return std::make_unique<WrappedSimpleTensor>(eval::SimpleTensor::decode(stream));
}
- abort();
+ LOG_ABORT("should not be reached");
}
diff --git a/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h b/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
index 9ec98b2c11d..341e443b218 100644
--- a/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
+++ b/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
@@ -2,6 +2,7 @@
#pragma once
+#include <vespa/log/log.h>
#include <vespa/eval/tensor/direct_tensor_builder.h>
#include "sparse_tensor.h"
#include "sparse_tensor_address_builder.h"
@@ -105,7 +106,7 @@ public:
void insertCell(SparseTensorAddressRef address, double value) {
// This address should not already exist and a new cell should be inserted.
- insertCell(address, value, [](double, double) -> double { abort(); });
+ insertCell(address, value, [](double, double) -> double { LOG_ABORT("should not be reached"); });
}
template <class Function>
@@ -116,7 +117,7 @@ public:
void insertCell(SparseTensorAddressBuilder &address, double value) {
// This address should not already exist and a new cell should be inserted.
- insertCell(address.getAddressRef(), value, [](double, double) -> double { abort(); });
+ insertCell(address.getAddressRef(), value, [](double, double) -> double { LOG_ABORT("should not be reached"); });
}
eval::ValueType &fast_type() { return _type; }
diff --git a/eval/src/vespa/eval/tensor/wrapped_simple_tensor.cpp b/eval/src/vespa/eval/tensor/wrapped_simple_tensor.cpp
index 463105b7c1f..84ed393823e 100644
--- a/eval/src/vespa/eval/tensor/wrapped_simple_tensor.cpp
+++ b/eval/src/vespa/eval/tensor/wrapped_simple_tensor.cpp
@@ -7,6 +7,9 @@
#include <vespa/eval/eval/tensor_spec.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".eval.tensor.wrapped_simple_tensor");
+
namespace vespalib::tensor {
bool
@@ -59,21 +62,21 @@ WrappedSimpleTensor::clone() const
Tensor::UP
WrappedSimpleTensor::apply(const CellFunction &) const
{
- abort();
+ LOG_ABORT("should not be reached");
return Tensor::UP();
}
Tensor::UP
WrappedSimpleTensor::join(join_fun_t, const Tensor &) const
{
- abort();
+ LOG_ABORT("should not be reached");
return Tensor::UP();
}
Tensor::UP
WrappedSimpleTensor::reduce(join_fun_t, const std::vector<vespalib::string> &) const
{
- abort();
+ LOG_ABORT("should not be reached");
return Tensor::UP();
}
diff --git a/fastlib/src/vespa/fastlib/io/bufferedfile.h b/fastlib/src/vespa/fastlib/io/bufferedfile.h
index db96d0d6a42..a1f69404896 100644
--- a/fastlib/src/vespa/fastlib/io/bufferedfile.h
+++ b/fastlib/src/vespa/fastlib/io/bufferedfile.h
@@ -87,7 +87,7 @@ public:
* or reads as much as possible if the (rest of) the file
* is smaller than the buffer.
* Caution: If the amount read is smaller than the expected
- * amount, the method will abort().
+ * amount, the method will LOG_ABORT("should not be reached").
*/
void fillReadBuf(void);
/**
diff --git a/fnet/ethereal/packet-fnetrpc.c b/fnet/ethereal/packet-fnetrpc.c
index d2ca9e7a8e8..5f071836e30 100644
--- a/fnet/ethereal/packet-fnetrpc.c
+++ b/fnet/ethereal/packet-fnetrpc.c
@@ -385,5 +385,5 @@ decode_params_litend(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
void
decode_params_bigend(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
- abort();
+ LOG_ABORT("should not be reached");
}
diff --git a/fnet/src/vespa/fnet/controlpacket.cpp b/fnet/src/vespa/fnet/controlpacket.cpp
index 53c23f444ab..f4d10e48353 100644
--- a/fnet/src/vespa/fnet/controlpacket.cpp
+++ b/fnet/src/vespa/fnet/controlpacket.cpp
@@ -4,6 +4,9 @@
#include "context.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".fnet.controlpacket");
+
void
FNET_ControlPacket::Free()
{
@@ -60,13 +63,13 @@ FNET_ControlPacket::GetLength()
void
FNET_ControlPacket::Encode(FNET_DataBuffer *)
{
- abort();
+ LOG_ABORT("should not be reached");
}
bool
FNET_ControlPacket::Decode(FNET_DataBuffer *, uint32_t)
{
- abort(); return false;
+ LOG_ABORT("should not be reached");
}
vespalib::string
diff --git a/fnet/src/vespa/fnet/dummypacket.cpp b/fnet/src/vespa/fnet/dummypacket.cpp
index 9e7ce37236b..0c2c2ee883d 100644
--- a/fnet/src/vespa/fnet/dummypacket.cpp
+++ b/fnet/src/vespa/fnet/dummypacket.cpp
@@ -4,6 +4,8 @@
#include "context.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".fnet.controlpacket");
FNET_DummyPacket::FNET_DummyPacket()
{
@@ -36,13 +38,13 @@ FNET_DummyPacket::GetLength()
void
FNET_DummyPacket::Encode(FNET_DataBuffer *)
{
- abort();
+ LOG_ABORT("should not be reached");
}
bool
FNET_DummyPacket::Decode(FNET_DataBuffer *, uint32_t)
{
- abort(); return false;
+ LOG_ABORT("should not be reached");
}
vespalib::string
diff --git a/fnet/src/vespa/fnet/frt/invoker.cpp b/fnet/src/vespa/fnet/frt/invoker.cpp
index ce4daa988de..f2dc331c707 100644
--- a/fnet/src/vespa/fnet/frt/invoker.cpp
+++ b/fnet/src/vespa/fnet/frt/invoker.cpp
@@ -142,7 +142,7 @@ void
FRT_HookInvoker::HandleReturn()
{
// hooks cannot be detached
- abort();
+ LOG_ABORT("should not be reached");
}
diff --git a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
index f40502e14d1..e6b7b34903b 100644
--- a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
+++ b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
@@ -71,7 +71,7 @@ shafile(const string &baseDir,
bool openres = f.OpenReadOnly(fullFile.c_str());
if (!openres) {
LOG(error, "Could not open %s for sha256 checksum", fullFile.c_str());
- abort();
+ LOG_ABORT("should not be reached");
}
int64_t flen = f.GetSize();
int64_t remainder = flen;
diff --git a/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp b/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp
index 4c4027da6d6..da1a7cdaa01 100644
--- a/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp
+++ b/searchcore/src/tests/applyattrupdates/applyattrupdates.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 <vespa/log/log.h>
+LOG_SETUP("applyattrupdates_test");
+
#include <vespa/document/base/testdocrepo.h>
#include <vespa/document/fieldvalue/arrayfieldvalue.h>
#include <vespa/document/fieldvalue/bytefieldvalue.h>
@@ -20,10 +24,6 @@
#include <vespa/searchlib/attribute/reference_attribute.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-
-LOG_SETUP("applyattrupdates_test");
-
using namespace document;
using search::attribute::BasicType;
using search::attribute::Config;
diff --git a/searchcore/src/tests/grouping/grouping.cpp b/searchcore/src/tests/grouping/grouping.cpp
index b159be5288c..7c396d6d281 100644
--- a/searchcore/src/tests/grouping/grouping.cpp
+++ b/searchcore/src/tests/grouping/grouping.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 <vespa/log/log.h>
+LOG_SETUP("grouping_test");
+
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/aggregation/grouping.h>
#include <vespa/searchlib/aggregation/sumaggregationresult.h>
diff --git a/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp
index 3ef2461c682..b700bf45820 100644
--- a/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.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 <vespa/log/log.h>
+LOG_SETUP("attibute_aspect_delayer_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/searchcore/proton/test/attribute_utils.h>
diff --git a/searchcore/src/tests/proton/attribute/attribute_initializer/attribute_initializer_test.cpp b/searchcore/src/tests/proton/attribute/attribute_initializer/attribute_initializer_test.cpp
index 7958d05d825..e95543dab69 100644
--- a/searchcore/src/tests/proton/attribute/attribute_initializer/attribute_initializer_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_initializer/attribute_initializer_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 <vespa/log/log.h>
+LOG_SETUP("attribute_initializer_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/attribute/attribute_directory.h>
#include <vespa/searchcore/proton/attribute/attribute_factory.h>
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index c41b6bdcb97..5954932bbaf 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_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 <vespa/log/log.h>
+LOG_SETUP("attribute_test");
+
#include <vespa/config-attributes.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/predicate/predicate_slime_builder.h>
@@ -44,9 +47,6 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcommon/attribute/iattributevector.h>
-#include <vespa/log/log.h>
-LOG_SETUP("attribute_test");
-
namespace vespa { namespace config { namespace search {}}}
using namespace config;
diff --git a/searchcore/src/tests/proton/common/cachedselect_test.cpp b/searchcore/src/tests/proton/common/cachedselect_test.cpp
index dcba8fda1c6..5de2728fa59 100644
--- a/searchcore/src/tests/proton/common/cachedselect_test.cpp
+++ b/searchcore/src/tests/proton/common/cachedselect_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 <vespa/log/log.h>
+LOG_SETUP("cachedselect_test");
+
#include <vespa/document/base/documentid.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/fieldvalue/document.h>
@@ -23,9 +26,6 @@
#include <vespa/searchlib/test/mock_attribute_manager.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cachedselect_test");
-
using document::DataType;
using document::Document;
using document::DocumentId;
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 7eae1c9d12d..79d38e2dc56 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -213,7 +213,7 @@ public:
_tuneFileDocumentDB, _hwInfo);
_configMgr.forwardConfig(b);
_configMgr.nextGeneration(0);
- if (! FastOS_File::MakeDirectory((std::string("tmpdb/") + docTypeName).c_str())) { abort(); }
+ if (! FastOS_File::MakeDirectory((std::string("tmpdb/") + docTypeName).c_str())) { LOG_ABORT("should not be reached"); }
_ddb.reset(new DocumentDB("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter, _clock,
DocTypeName(docTypeName), makeBucketSpace(),
*b->getProtonConfigSP(), *this, _summaryExecutor, _summaryExecutor,
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
index a7512b41f30..4e66b9a8589 100644
--- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
+++ b/searchcore/src/tests/proton/document_iterator/document_iterator_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 <vespa/log/log.h>
+LOG_SETUP("document_iterator_test");
+
#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/fieldvalue/fieldvalues.h>
#include <vespa/document/datatype/documenttype.h>
diff --git a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp b/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
index b5cf1733ba9..0af15f0bd05 100644
--- a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
@@ -1,4 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("cluster_state_handler_test");
+
#include <vespa/searchcore/proton/server/clusterstatehandler.h>
#include <vespa/searchcore/proton/server/iclusterstatechangedhandler.h>
#include <vespa/searchcore/proton/test/test.h>
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
index 11e9aa8c3ec..7daab40c40f 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_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 <vespa/log/log.h>
+LOG_SETUP("document_bucket_mover_test");
+
#include <vespa/searchcore/proton/bucketdb/bucketdbhandler.h>
#include <vespa/searchcore/proton/bucketdb/bucket_create_notifier.h>
#include <vespa/searchcore/proton/test/bucketfactory.h>
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index c7790f9c507..3ddcebbc428 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_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 <vespa/log/log.h>
+LOG_SETUP("maintenancecontroller_test");
+
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/test/make_bucket_space.h>
#include <vespa/searchcore/proton/attribute/attribute_usage_filter.h>
@@ -38,9 +41,6 @@
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <unistd.h>
-#include <vespa/log/log.h>
-LOG_SETUP("maintenancecontroller_test");
-
using namespace proton;
using namespace vespalib::slime;
using document::BucketId;
@@ -153,14 +153,14 @@ struct MyDocumentRetriever : public DocumentRetrieverBaseForTest
virtual const document::DocumentTypeRepo &
getDocumentTypeRepo() const override
{
- abort();
+ LOG_ABORT("should not be reached");
}
virtual void
getBucketMetaData(const storage::spi::Bucket &,
DocumentMetaData::Vector &) const override
{
- abort();
+ LOG_ABORT("should not be reached");
}
virtual DocumentMetaData
getDocumentMetaData(const DocumentId &) const override
diff --git a/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp b/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
index d56340be2b2..df411ea0346 100644
--- a/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
@@ -113,7 +113,7 @@ public:
virtual const RawDocumentMetaData &getRawMetaData(DocId) const override
{
- abort();
+ LOG_ABORT("should not be reached");
}
virtual bool getFreeListActive() const override
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 76e3b3e4af9..0280f377549 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.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 <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("matching_test");
#include <vespa/document/base/globalid.h>
#include <initializer_list>
@@ -33,8 +35,6 @@
#include <vespa/searchcore/proton/matching/match_params.h>
#include <vespa/searchcore/proton/matching/match_tools.h>
#include <vespa/searchcore/proton/matching/match_context.h>
-#include <vespa/log/log.h>
-LOG_SETUP("matching_test");
using namespace proton::matching;
using namespace proton;
diff --git a/searchcore/src/tests/proton/matching/querynodes_test.cpp b/searchcore/src/tests/proton/matching/querynodes_test.cpp
index 6607019cccc..3b8b85924c2 100644
--- a/searchcore/src/tests/proton/matching/querynodes_test.cpp
+++ b/searchcore/src/tests/proton/matching/querynodes_test.cpp
@@ -31,11 +31,11 @@
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/searchlib/attribute/singlenumericattribute.hpp>
-
#include <vespa/log/log.h>
LOG_SETUP("querynodes_test");
+#include <vespa/searchlib/attribute/singlenumericattribute.hpp>
+
using search::fef::FieldInfo;
using search::fef::FieldType;
using search::fef::MatchData;
diff --git a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
index fc9d2d770cd..18ee8667ecc 100644
--- a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
+++ b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
@@ -1,5 +1,7 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("document_db_reference_test");
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/reference/document_db_reference.h>
@@ -7,9 +9,6 @@
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
-#include <vespa/log/log.h>
-LOG_SETUP("document_db_reference_test");
-
using namespace proton;
using search::AttributeFactory;
diff --git a/searchcore/src/tests/proton/server/documentretriever_test.cpp b/searchcore/src/tests/proton/server/documentretriever_test.cpp
index 69e90a6fdf8..6f74596b538 100644
--- a/searchcore/src/tests/proton/server/documentretriever_test.cpp
+++ b/searchcore/src/tests/proton/server/documentretriever_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.
// Unit tests for documentretriever.
+#include <vespa/log/log.h>
+LOG_SETUP("document_retriever_test");
+
#include <vespa/document/base/documentid.h>
#include <vespa/document/bucket/bucketid.h>
#include <vespa/document/datatype/datatype.h>
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_directory.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_directory.cpp
index f775f4443f8..a00ec759647 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_directory.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_directory.cpp
@@ -95,7 +95,7 @@ AttributeDirectory::saveSnapInfo()
LOG(warning,
"Could not save meta-info file for attribute vector '%s' to disk",
dirName.c_str());
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
index 239f91b449f..0a0ecbda21c 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.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 <vespa/log/log.h>
+LOG_SETUP(".proton.attribute.attribute_writer");
+
#include "attribute_writer.h"
#include "ifieldupdatecallback.h"
#include "attributemanager.h"
@@ -15,9 +18,6 @@
#include <vespa/searchlib/common/idestructorcallback.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.server.attributeadapter");
-
using namespace document;
using namespace search;
using search::attribute::ImportedAttributeVector;
diff --git a/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp b/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
index 6fa19f0f35e..8faa6e03401 100644
--- a/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
@@ -4,6 +4,8 @@
#include "selectcontext.h"
#include <vespa/searchcommon/attribute/attributecontent.h>
#include <vespa/searchlib/attribute/attributevector.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".proton.common.attribute_field_value_node");
namespace proton {
@@ -80,7 +82,7 @@ getValue(const Context &context) const
} while (0);
break;
default:
- abort();
+ LOG_ABORT("should not be reached");
}
return Value::UP();
diff --git a/searchcore/src/vespa/searchcore/proton/common/attrupdate.cpp b/searchcore/src/vespa/searchcore/proton/common/attrupdate.cpp
index 7c0a1815019..f3ef4856631 100644
--- a/searchcore/src/vespa/searchcore/proton/common/attrupdate.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/attrupdate.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 <vespa/log/log.h>
+LOG_SETUP(".proton.common.attrupdate");
#include "attrupdate.h"
#include <vespa/document/fieldvalue/arrayfieldvalue.h>
#include <vespa/document/fieldvalue/predicatefieldvalue.h>
@@ -22,9 +24,6 @@
#include <vespa/searchlib/attribute/changevector.hpp>
#include <sstream>
-#include <vespa/log/log.h>
-LOG_SETUP(".attrupdate");
-
using namespace document;
using vespalib::make_string;
using search::tensor::TensorAttribute;
diff --git a/searchcore/src/vespa/searchcore/proton/common/hw_info_sampler.cpp b/searchcore/src/vespa/searchcore/proton/common/hw_info_sampler.cpp
index c9bf81d1310..190e904ad68 100644
--- a/searchcore/src/vespa/searchcore/proton/common/hw_info_sampler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/hw_info_sampler.cpp
@@ -10,6 +10,8 @@
#include <vespa/vespalib/io/fileutil.h>
#include <experimental/filesystem>
#include <thread>
+#include <vespa/log/log.h>
+LOG_SETUP(".proton.common.hw_info_sampler");
using config::ConfigHandle;
using config::ConfigSubscriber;
@@ -70,7 +72,7 @@ void writeConfig(const vespalib::string &path,
builder.disk.sampletime = std::chrono::duration_cast<std::chrono::seconds>(sampleTime.time_since_epoch()).count();
config::FileConfigWriter writer(path + "/hwinfo.cfg");
if (!writer.write(builder)) {
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp
index d2bbde1eadd..b81cfae0ee7 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.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 <vespa/log/log.h>
+LOG_SETUP(".proton.documentmetastore");
+
#include "documentmetastore.h"
#include "search_context.h"
#include "documentmetastoresaver.h"
@@ -77,7 +80,7 @@ public:
_headerLen = _header.readFile(*_datFile);
_datFile->SetPosition(_headerLen);
if (!search::ReaderBase::extractFileSize(_header, *_datFile, _datFileSize)) {
- abort();
+ LOG_ABORT("should not be reached");
}
_docIdLimit = _header.getTag(DOCID_LIMIT).asInteger();
_version = _header.getTag(VERSION).asInteger();
diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/tls_stats_map.cpp b/searchcore/src/vespa/searchcore/proton/flushengine/tls_stats_map.cpp
index 088e202c027..c9ba495aa82 100644
--- a/searchcore/src/vespa/searchcore/proton/flushengine/tls_stats_map.cpp
+++ b/searchcore/src/vespa/searchcore/proton/flushengine/tls_stats_map.cpp
@@ -2,6 +2,8 @@
#include "tls_stats_map.h"
#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <vespa/log/log.h>
+LOG_SETUP(".proton.flushengine.tls_stats_map");
namespace proton {
namespace flushengine {
@@ -18,7 +20,7 @@ TlsStatsMap::getTlsStats(const vespalib::string &domain) const {
if (itr != _map.end()) {
return itr->second;
}
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
index 805c4a94c3b..fa43ce370ae 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
#include <vespa/log/log.h>
-LOG_SETUP(".searchcore.matching.match_tools");
+LOG_SETUP(".proton.matching.match_tools");
#include <vespa/searchlib/query/tree/querytreecreator.h>
using search::attribute::IAttributeContext;
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
index 987218beefa..87735dfef5d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
@@ -27,7 +27,7 @@ getRepo(const std::vector<IFeedView::SP> &views)
continue;
return view->getDocumentTypeRepo();
}
- abort();
+ LOG_ABORT("should not be reached");
return std::shared_ptr<const DocumentTypeRepo>();
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
index ec22d3293c4..f91892114ea 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
@@ -292,7 +292,7 @@ DocumentDBConfigManager::update(const ConfigSnapshot &snapshot)
search::index::SchemaBuilder::build(*newIndexschemaConfig, schema);
if (!search::index::SchemaUtil::validateSchema(schema)) {
LOG(error, "Cannot use bad index schema, validation failed");
- abort();
+ LOG_ABORT("should not be reached");
}
}
if (snapshot.isChanged<AttributesConfig>(_configId, currentGeneration)) {
diff --git a/searchcore/src/vespa/searchcore/proton/test/attribute_utils.h b/searchcore/src/vespa/searchcore/proton/test/attribute_utils.h
index 6229e989cba..6270b8b3a89 100644
--- a/searchcore/src/vespa/searchcore/proton/test/attribute_utils.h
+++ b/searchcore/src/vespa/searchcore/proton/test/attribute_utils.h
@@ -24,7 +24,7 @@ struct AttributeUtils
search::IntegerAttribute &ia = static_cast<search::IntegerAttribute &>(*attr);
while (ia.getNumDocs() < to) {
uint32_t docId;
- if (!ia.addDoc(docId)) { abort(); }
+ if (!ia.addDoc(docId)) { LOG_ABORT("should not be reached"); }
}
for (uint32_t i = from; i < to; ++i) {
ia.update(i, value);
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h
index 9dad0d32b61..9385c160927 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h
@@ -54,16 +54,16 @@ public:
virtual void pruneRemovedFields(search::SerialNum) override {
}
virtual const IAttributeFactory::SP &getFactory() const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual search::ISequencedTaskExecutor &getAttributeFieldWriter() const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual search::AttributeVector *getWritableAttribute(const vespalib::string &) const override {
return nullptr;
}
virtual const std::vector<search::AttributeVector *> &getWritableAttributes() const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual void asyncForEachAttribute(std::shared_ptr<IAttributeFunctor>) const override {
}
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 <vespa/log/log.h>
+LOG_SETUP("btreestress_test");
+
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/btree/btreeroot.h>
#include <vespa/searchlib/btree/btreebuilder.h>
@@ -21,9 +24,6 @@
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/lambdatask.h>
-#include <vespa/log/log.h>
-LOG_SETUP("btreestress_test");
-
using MyTree = search::btree::BTree<uint32_t, uint32_t>;
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 <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attr_test");
+
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
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 <vespa/log/log.h>
+LOG_SETUP("per_doc_expr_test");
+
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/aggregation/expressioncountaggregationresult.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
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 <vespa/log/log.h>
+LOG_SETUP("attributebenchmark");
+
#include <vespa/searchlib/util/randomgenerator.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributeguard.h>
@@ -8,6 +12,7 @@
#include <vespa/searchlib/attribute/singlestringattribute.h>
#include <vespa/searchlib/attribute/multistringattribute.h>
#include <vespa/searchlib/attribute/attrvector.h>
+#include <vespa/searchlib/attribute/attributevector.hpp>
#include <vespa/fastos/thread.h>
#include <vespa/fastos/app.h>
#include <iostream>
@@ -16,12 +21,6 @@
#include "attributeupdater.h"
#include <sys/resource.h>
-#include <vespa/log/log.h>
-
-LOG_SETUP("attributebenchmark");
-
-#include <vespa/searchlib/attribute/attributevector.hpp>
-
using std::shared_ptr;
typedef std::vector<uint32_t> 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 <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("document_weight_iterator_test");
+
#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/attribute/attribute.h>
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 <vespa/log/log.h>
+LOG_SETUP("postinglist_test");
+
#include <vespa/searchlib/datastore/datastore.h>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <vespa/searchlib/btree/btreenode.hpp>
@@ -11,9 +14,6 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <set>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP("postinglistattribute_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -17,8 +20,6 @@
#include <vespa/searchlib/fef/termfieldmatchdata.h>
#include <vespa/fastos/file.h>
#include <iostream>
-#include <vespa/log/log.h>
-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 <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attribute_searchable_adapter_test");
+
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attributefactory.h>
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 <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attribute_weighted_set_blueprint_test");
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attribute_weighted_set_blueprint.h>
@@ -15,7 +17,6 @@
#include <vespa/searchlib/queryeval/weighted_set_term_search.h>
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
-
#include <vespa/searchlib/attribute/enumstore.hpp>
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 <vespa/log/log.h>
+LOG_SETUP("attributeblueprint_test");
+
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attributecontext.h>
@@ -15,9 +18,6 @@
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP("frozenbtree_test");
+
#define DEBUG_FROZENBTREE
#define LOG_FROZENBTREEXX
#include <vespa/vespalib/testkit/testapp.h>
@@ -10,9 +13,6 @@
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <map>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP("iteratespeed");
+
#include <vespa/searchlib/btree/btreeroot.h>
#include <vespa/searchlib/btree/btreebuilder.h>
#include <vespa/searchlib/btree/btreenodeallocator.h>
@@ -18,9 +21,6 @@
#include <vespa/fastos/app.h>
#include <vespa/fastos/timestamp.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP("fusion_test");
+
#include <vespa/searchlib/diskindex/fusion.h>
#include <vespa/searchlib/diskindex/indexbuilder.h>
#include <vespa/searchlib/diskindex/zcposoccrandread.h>
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 <vespa/searchlib/fef/test/indexenvironment.h>
#include <vespa/searchlib/fef/blueprint.h>
+#include <vespa/log/log.h>
+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 <vespa/log/log.h>
+LOG_SETUP("grouping_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
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 <vespa/log/log.h>
+LOG_SETUP("grouping_benchmark");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
@@ -15,9 +18,6 @@
#include <vespa/vespalib/util/rusage.h>
#include <csignal>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP("grouping_engine_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
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 <vespa/log/log.h>
+LOG_SETUP("dictionary_test");
+
#include <vespa/searchlib/diskindex/fusion.h>
#include <vespa/searchlib/diskindex/indexbuilder.h>
#include <vespa/searchlib/diskindex/zcposoccrandread.h>
@@ -18,9 +21,6 @@
#include <vespa/searchlib/test/searchiteratorverifier.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-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 <vespa/searchlib/predicate/simple_index.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/searchlib/attribute/predicate_attribute.h>
#include <vespa/log/log.h>
LOG_SETUP("simple_index_test");
+#include <vespa/searchlib/predicate/simple_index.hpp>
+#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/searchlib/attribute/predicate_attribute.h>
+
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 <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("query_eval_test");
+
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/test/initrange.h>
#include <vespa/searchlib/common/bitvectoriterator.h>
#include <vespa/searchlib/queryeval/andnotsearch.h>
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 <vespa/log/log.h>
+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 <vespa/searchlib/queryeval/weighted_set_term_blueprint.h>
#include <vespa/searchlib/queryeval/get_weight_from_node.h>
-
#include <vespa/vespalib/util/regexp.h>
#include <sstream>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+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 <typename B>
void NumericDirectAttribute<B>::onCommit()
{
B::_changes.clear();
- abort();
+ LOG_ABORT("should not be reached");
}
template <typename B>
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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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<B>::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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.enum_comparator");
#include "enumstore.hpp"
#include <vespa/searchlib/util/foldedstringcompare.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.enum_store");
#include "enumstore.hpp"
#include <iomanip>
@@ -130,7 +132,7 @@ EnumStoreT<StringEntryType>::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<char>(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<EntryType>::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<char>(activeBufferId, offset));
@@ -256,7 +256,7 @@ EnumStoreT<EntryType>::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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.enumstorebase");
#include "enumstore.h"
#include <vespa/searchlib/datastore/datastore.hpp>
#include <vespa/vespalib/util/exceptions.h>
@@ -572,7 +574,7 @@ template <>
EnumPostingTree &
EnumStoreDict<EnumTree>::getPostingDictionary()
{
- abort();
+ LOG_ABORT("should not be reached");
}
@@ -588,7 +590,7 @@ template <>
const EnumPostingTree &
EnumStoreDict<EnumTree>::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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.flag_attribute");
#include "load_utils.hpp"
#include "attributeiterators.h"
#include "multinumericattribute.hpp"
@@ -8,9 +10,6 @@
#include <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/searchlib/common/bitvectoriterator.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.imported_search_context");
+
+#include "bitvector_search_cache.h"
#include "imported_attribute_vector.h"
#include "reference_attribute.h"
#include <vespa/searchlib/common/bitvectoriterator.h>
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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.posting_store");
#include <vespa/searchlib/datastore/datastore.hpp>
#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/searchlib/common/growablebitvector.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.attribute.predicate_attribute");
#include "predicate_attribute.h"
#include <vespa/searchlib/util/fileutil.h>
#include <vespa/document/fieldvalue/predicatefieldvalue.h>
@@ -8,9 +10,6 @@
#include "iattributesavetarget.h"
#include "attribute_header.h"
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>::
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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/vespalib/objects/nbostream.h>
#include <vespa/fastos/file.h>
+#include <vespa/log/log.h>
+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 <vespa/vespalib/util/array.hpp>
#include <limits>
+#include <vespa/log/log.h>
+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 <vespa/searchlib/bitcompression/posocccompression.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".searchlib.memoryindex.dictionary");
+
#include <vespa/searchlib/btree/btreenode.hpp>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <vespa/searchlib/btree/btreenodestore.hpp>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.memoryindex.memory_field_index");
+
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/util/exceptions.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.memoryindex.ordered_document_inserter");
#include "i_document_insert_listener.h"
#include <vespa/searchlib/index/docidandfeatures.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.memoryindex.postingiterator");
#include <vespa/searchlib/btree/btreenode.hpp>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.predicate.predicate_interval_store");
#include "predicate_index.h"
#include <vespa/searchlib/datastore/bufferstate.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.predicate.predicate_tree_annotator");
#include "predicate_index.h"
#include "predicate_range_expander.h"
#include "predicate_tree_analyzer.h"
#include <vespa/document/predicate/predicate.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.predicate.simple_index");
#include "simple_index.hpp"
#include <vespa/vespalib/util/array.hpp>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.predicate.predicate_blueprint");
#include "predicate_blueprint.h"
#include <vespa/searchlib/predicate/predicate_bounds_posting_list.h>
#include <vespa/searchlib/predicate/predicate_interval_posting_list.h>
@@ -8,8 +10,6 @@
#include <vespa/searchlib/predicate/predicate_hash.h>
#include <vespa/searchlib/query/tree/termnodes.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_blueprint");
#include <vespa/searchlib/predicate/predicate_range_term_expander.h>
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 <vespa/log/log.h>
+LOG_SETUP(".searchlib.tensor.dense_tensor_attribute");
#include "dense_tensor_attribute_saver.h"
#include "tensor_attribute.hpp"
#include <vespa/eval/tensor/tensor.h>
@@ -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 <vespa/searchlib/queryeval/iterators.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".searchlib.test.fake_eg_compr64_filter_occ");
using search::fef::TermFieldMatchData;
using search::fef::TermFieldMatchDataPosition;
@@ -1428,7 +1430,7 @@ FakeFilterOccEGCompressed64SkipArrayIterator<doSkip>::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 <vespa/log/log.h>
+LOG_SETUP(".fakememtreeocc");
#include <vespa/searchlib/queryeval/iterators.h>
#include <vespa/searchlib/btree/btreeroot.hpp>
#include <vespa/searchlib/btree/btreeiterator.hpp>
@@ -10,8 +12,6 @@
#include <vespa/searchlib/btree/btreenodestore.hpp>
#include <vespa/searchlib/memoryindex/postingiterator.h>
#include <vespa/searchlib/util/postingpriorityqueue.h>
-#include <vespa/log/log.h>
-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 <vespa/log/log.h>
+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 <fcntl.h>
#include <sys/stat.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".searchlib.util.statefile");
+
using Mutex = std::mutex;
using Guard = std::lock_guard<Mutex>;
@@ -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<char> &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<size_t>(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");
}
}
diff --git a/searchsummary/src/tests/docsummary/positionsdfw_test.cpp b/searchsummary/src/tests/docsummary/positionsdfw_test.cpp
index 7e1da35bd75..ce184fd328a 100644
--- a/searchsummary/src/tests/docsummary/positionsdfw_test.cpp
+++ b/searchsummary/src/tests/docsummary/positionsdfw_test.cpp
@@ -63,9 +63,9 @@ public:
return &_attr;
}
virtual const IAttributeVector *
- getAttributeStableEnum(const string &) const override { abort(); }
+ getAttributeStableEnum(const string &) const override { LOG_ABORT("should not be reached"); }
virtual void getAttributeList(vector<const IAttributeVector *> &) const override
- { abort(); }
+ { LOG_ABORT("should not be reached"); }
};
class MyAttributeManager : public IAttributeManager {
@@ -74,13 +74,13 @@ public:
MyAttributeManager(const IAttributeVector &attr) : _attr(attr) {}
virtual AttributeGuard::UP getAttribute(const string &) const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual std::unique_ptr<attribute::AttributeReadGuard> getAttributeReadGuard(const string &, bool) const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual void getAttributeList(vector<AttributeGuard> &) const override {
- abort();
+ LOG_ABORT("should not be reached");
}
virtual IAttributeContext::UP createContext() const override {
return IAttributeContext::UP(new MyAttributeContext(_attr));
diff --git a/slobrok/src/vespa/slobrok/sbmirror.cpp b/slobrok/src/vespa/slobrok/sbmirror.cpp
index 39f103173c5..d36e456995c 100644
--- a/slobrok/src/vespa/slobrok/sbmirror.cpp
+++ b/slobrok/src/vespa/slobrok/sbmirror.cpp
@@ -319,11 +319,11 @@ MirrorAPI::makeRequest()
if (_target == 0) return;
if (_reqPending) {
LOG(error, "cannot make new request, one is pending already");
- abort();
+ LOG_ABORT("should not be reached");
}
if (_scheduled) {
LOG(error, "cannot make new request, re-schedule is pending");
- abort();
+ LOG_ABORT("should not be reached");
}
_req = _orb.AllocRPCRequest(_req);
@@ -343,7 +343,7 @@ MirrorAPI::reSched(double seconds)
{
if (_scheduled) {
LOG(error, "already scheduled when asked to re-schedule in %f seconds", seconds);
- abort();
+ LOG_ABORT("should not be reached");
}
Schedule(seconds);
_scheduled = true;
diff --git a/slobrok/src/vespa/slobrok/server/cmd.cpp b/slobrok/src/vespa/slobrok/server/cmd.cpp
index bcb8c4ab711..6ba4f9a6e98 100644
--- a/slobrok/src/vespa/slobrok/server/cmd.cpp
+++ b/slobrok/src/vespa/slobrok/server/cmd.cpp
@@ -117,7 +117,7 @@ RegRpcSrvCommand::doneHandler(OkState result)
goto alldone;
}
// no other state should be possible
- abort();
+ LOG_ABORT("should not be reached");
alldone:
cleanupReservation();
delete _data;
diff --git a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
index b94e35407a1..138e7a25803 100644
--- a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
@@ -83,7 +83,7 @@ std::string getLineHeader(const std::string &line)
}
++len;
}
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/storage/src/tests/bucketdb/judymultimaptest.cpp b/storage/src/tests/bucketdb/judymultimaptest.cpp
index db368ac83b5..28504e3abed 100644
--- a/storage/src/tests/bucketdb/judymultimaptest.cpp
+++ b/storage/src/tests/bucketdb/judymultimaptest.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 <vespa/log/log.h>
+LOG_SETUP(".judy_multi_map_test");
#include <vespa/storage/bucketdb/judymultimap.h>
#include <vespa/storage/bucketdb/judymultimap.hpp>
#include <vespa/vdstestlib/cppunit/macros.h>
diff --git a/storage/src/tests/bucketdb/lockablemaptest.cpp b/storage/src/tests/bucketdb/lockablemaptest.cpp
index 6f36e0be711..46928ee51ae 100644
--- a/storage/src/tests/bucketdb/lockablemaptest.cpp
+++ b/storage/src/tests/bucketdb/lockablemaptest.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 <vespa/log/log.h>
+LOG_SETUP(".lockable_map_test");
#include <vespa/vespalib/util/document_runnable.h>
#include <vespa/storage/bucketdb/judymultimap.h>
#include <vespa/storage/bucketdb/judymultimap.hpp>
diff --git a/storage/src/vespa/storage/bucketdb/judymultimap.hpp b/storage/src/vespa/storage/bucketdb/judymultimap.hpp
index 06d553d38bc..81a58582073 100644
--- a/storage/src/vespa/storage/bucketdb/judymultimap.hpp
+++ b/storage/src/vespa/storage/bucketdb/judymultimap.hpp
@@ -2,6 +2,7 @@
#pragma once
#include "judymultimap.h"
+#include <vespa/log/log.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/array.hpp>
#include <set>
@@ -150,7 +151,7 @@ JudyMultiMap<T0, T1, T2, T3>::operator[](key_type key)
case 1: return _values1[getIndex(it.value())];
case 2: return _values2[getIndex(it.value())];
case 3: return _values3[getIndex(it.value())];
- default: assert(false);
+ default: LOG_ABORT("should not be reached");
}
return T0(); // Avoid warning of no return
}
@@ -290,7 +291,7 @@ JudyMultiMap<T0, T1, T2, T3>::ConstIterator::operator*() const
_iterator.key(), _parent->_values3[getIndex(_iterator.value())]);
default:
assert(false);
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/storage/src/vespa/storage/bucketdb/storbucketdb.cpp b/storage/src/vespa/storage/bucketdb/storbucketdb.cpp
index 81d07319358..83787bde55f 100644
--- a/storage/src/vespa/storage/bucketdb/storbucketdb.cpp
+++ b/storage/src/vespa/storage/bucketdb/storbucketdb.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 "storbucketdb.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".storage.bucketdb.stor_bucket_db");
#include "judymultimap.hpp"
namespace storage {
diff --git a/storage/src/vespa/storage/bucketmover/bucketmover.cpp b/storage/src/vespa/storage/bucketmover/bucketmover.cpp
index b47b3b59b4f..822cb0b16ae 100644
--- a/storage/src/vespa/storage/bucketmover/bucketmover.cpp
+++ b/storage/src/vespa/storage/bucketmover/bucketmover.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 "bucketmover.h"
+#include <vespa/log/bufferedlogger.h>
+LOG_SETUP(".bucketmover");
#include "htmltable.h"
#include <vespa/storage/config/config-stor-server.h>
#include <vespa/storage/common/bucketmessages.h>
@@ -12,9 +14,6 @@
#include <vespa/document/bucket/fixed_bucket_spaces.h>
#include <thread>
-#include <vespa/log/bufferedlogger.h>
-LOG_SETUP(".bucketmover");
-
namespace storage::bucketmover {
BucketMover::BucketMover(const config::ConfigUri & configUri,
diff --git a/storage/src/vespa/storage/distributor/maintenance/maintenancescheduler.cpp b/storage/src/vespa/storage/distributor/maintenance/maintenancescheduler.cpp
index c158b499ebb..d8b7ee81ba7 100644
--- a/storage/src/vespa/storage/distributor/maintenance/maintenancescheduler.cpp
+++ b/storage/src/vespa/storage/distributor/maintenance/maintenancescheduler.cpp
@@ -5,6 +5,9 @@
#include <vespa/storage/distributor/operationstarter.h>
#include <vespa/storage/distributor/operations/idealstate/idealstateoperation.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".storage.distributor.maintenance.maintenance_scheduler");
+
namespace storage::distributor {
MaintenanceScheduler::MaintenanceScheduler(
@@ -84,7 +87,7 @@ MaintenanceScheduler::convertToOperationPriority(MaintenancePriority::Priority p
return OperationStarter::Priority(0);
default:
assert(false);
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/storage/src/vespa/storage/frameworkimpl/thread/appkiller.cpp b/storage/src/vespa/storage/frameworkimpl/thread/appkiller.cpp
index ba1ce957a0f..f2c5c7cf981 100644
--- a/storage/src/vespa/storage/frameworkimpl/thread/appkiller.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/thread/appkiller.cpp
@@ -12,7 +12,7 @@ void RealAppKiller::kill() {
LOG(info, "Aborting the server to dump core, as we're "
"most likely deadlocked and want a core file "
"to view the stack traces.");
- abort();
+ LOG_ABORT("should not be reached");
}
} // storage
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index 06dfc073f61..a01881b6fbe 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -419,8 +419,7 @@ namespace {
return static_cast<const api::RemoveCommand&>(msg).getDocumentId();
break;
default:
- assert(false);
- abort();
+ LOG_ABORT("should not be reached");
}
}
uint32_t findCommonBits(document::BucketId a, document::BucketId b) {
@@ -544,7 +543,7 @@ FileStorHandlerImpl::remapMessage(api::StorageMessage& msg, const document::Buck
} else {
LOG(debug, "Did not remap %s with bucket %s from bucket %s",
cmd.toString().c_str(), cmd.getBucketId().toString().c_str(), source.toString().c_str());
- assert(false);
+ LOG_ABORT("should not be reached");
}
break;
}
diff --git a/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp b/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp
index b4c7d1e3e80..01a84177e43 100644
--- a/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp
+++ b/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp
@@ -40,8 +40,7 @@ namespace {
case SchedulingOptions::CONTINUE:
return "Continuing any existing run";
default:
- assert(false);
- abort();
+ LOG_ABORT("should not be reached");
}
}
}
diff --git a/storage/src/vespa/storage/storageserver/mergethrottler.cpp b/storage/src/vespa/storage/storageserver/mergethrottler.cpp
index a15b1b98d63..370f1c85241 100644
--- a/storage/src/vespa/storage/storageserver/mergethrottler.cpp
+++ b/storage/src/vespa/storage/storageserver/mergethrottler.cpp
@@ -1211,7 +1211,7 @@ MergeThrottler::handleOutdatedMerges(const api::SetSystemStateCommand& cmd)
markActiveMergesAsAborted(minimumVersion);
} catch (std::exception& e) {
LOG(error, "Received exception during merge aborting: %s", e.what());
- abort();
+ LOG_ABORT("should not be reached");
}
// Rendezvous released on scope exit
diff --git a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
index 09c805b2b85..affeae44c04 100644
--- a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
+++ b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
@@ -4,6 +4,8 @@
#include "threadimpl.h"
#include <vespa/vespalib/util/exceptions.h>
#include <thread>
+#include <vespa/log/log.h>
+LOG_SETUP(".storageframework.thread_pool_impl");
using namespace std::chrono_literals;
using vespalib::IllegalStateException;
@@ -36,7 +38,7 @@ ThreadPoolImpl::~ThreadPoolImpl()
if (i > 1000) {
fprintf(stderr, "Failed to kill thread pool. Threads won't die. (And if allowing thread pool object"
" to be deleted this will create a segfault later)\n");
- abort();
+ LOG_ABORT("should not be reached");
}
std::this_thread::sleep_for(10ms);
}
diff --git a/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp b/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp
index 2ca29223254..48d0b833063 100644
--- a/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp
+++ b/storageserver/src/vespa/storageserver/app/servicelayerprocess.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 <vespa/log/log.h>
+LOG_SETUP(".storageserver.service_layer_process");
+
#include "servicelayerprocess.h"
#include <vespa/storage/storageserver/servicelayernode.h>
#include <vespa/searchvisitor/searchvisitor.h>
diff --git a/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp
index 67b662fb16b..19d67b623eb 100644
--- a/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/tests/searchvisitor/searchvisitor.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 <vespa/log/log.h>
+LOG_SETUP("searchvisitor_test");
+
#include <vespa/document/base/testdocrepo.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/vespalib/testkit/testapp.h>
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
index f42dfe5af98..f10d934bd2d 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.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 <vespa/log/log.h>
+LOG_SETUP(".visitor.instance.searchvisitor");
+
#include "querytermdata.h"
#include "searchenvironment.h"
#include "searchvisitor.h"
@@ -16,9 +19,6 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".visitor.instance.searchvisitor");
-
namespace storage {
using vsm::DocsumFilter;
diff --git a/vdslib/src/vespa/vdslib/distribution/distribution.cpp b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
index 9b31d10d8e8..5a834929981 100644
--- a/vdslib/src/vespa/vdslib/distribution/distribution.cpp
+++ b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
@@ -124,7 +124,7 @@ namespace {
case ConfigDiskDistribution::MODULO_INDEX : return Distribution::MODULO_INDEX;
case ConfigDiskDistribution::MODULO_KNUTH : return Distribution::MODULO_KNUTH;
}
- abort();
+ LOG_ABORT("should not be reached");
}
ConfigDiskDistribution toConfig(Distribution::DiskDistribution cfg) {
switch (cfg) {
@@ -133,7 +133,7 @@ namespace {
case Distribution::MODULO_INDEX : return ConfigDiskDistribution::MODULO_INDEX;
case Distribution::MODULO_KNUTH : return ConfigDiskDistribution::MODULO_KNUTH;
}
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp b/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
index 6e23bd46d71..d15b925d31a 100644
--- a/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
+++ b/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
@@ -4,6 +4,9 @@
#include <stdlib.h>
#include <algorithm>
+#include <vespa/log/log.h>
+LOG_SETUP("make_fixture_macros");
+
void out(const char *str) { fprintf(stdout, "%s", str); }
void out_n(const char *str, int n) { fprintf(stdout, str, n); }
void out_nn(const char *str, int n) { fprintf(stdout, str, n, n); }
@@ -24,7 +27,7 @@ void out_list(const char *pre, const char *str, const char *sep, const char *pos
case 0: out(str); break;
case 1: out_n(str, i + 1); break;
case 2: out_nn(str, i + 1); break;
- default: abort();
+ default: LOG_ABORT("should not be reached");
}
}
out_if(post, n > 0);
diff --git a/vespalib/src/tests/delegatelist/delegatelist.cpp b/vespalib/src/tests/delegatelist/delegatelist.cpp
index 8ee68b80ed0..ba1a2049794 100644
--- a/vespalib/src/tests/delegatelist/delegatelist.cpp
+++ b/vespalib/src/tests/delegatelist/delegatelist.cpp
@@ -290,7 +290,7 @@ Actor::perform(int cnt, int start, const CmdList &cmdList)
return cmdList.size();
break;
default:
- abort(); // that does not seem to work
+ LOG_ABORT("should not be reached"); // that does not seem to work
}
}
}
diff --git a/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp b/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
index 39ee8a40d4a..d6e12c7ab59 100644
--- a/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
@@ -4,6 +4,9 @@
#include "slime.h"
#include <vespa/vespalib/data/memory_input.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.data.slime.binary_format");
+
namespace vespalib {
namespace slime {
@@ -55,7 +58,7 @@ struct BinaryEncoder : public ArrayTraverser,
case ARRAY::ID: return encodeArray(inspector);
case OBJECT::ID: return encodeObject(inspector);
}
- abort(); // should not be reached
+ LOG_ABORT("should not be reached"); // should not be reached
}
void encodeSymbolTable(const Slime &slime) {
size_t numSymbols = slime.symbols();
@@ -170,7 +173,7 @@ struct BinaryDecoder : SymbolHandler<remap_symbols>::type {
case ARRAY::ID: return decodeArray(inserter, meta);
case OBJECT::ID: return decodeObject(inserter, meta);
}
- abort(); // code should not be reached
+ LOG_ABORT("should not be reached"); // code should not be reached
}
void decodeValue(const Inserter &inserter) {
diff --git a/vespalib/src/vespa/vespalib/data/slime/inject.cpp b/vespalib/src/vespa/vespalib/data/slime/inject.cpp
index de1bd840c5a..febd9058b00 100644
--- a/vespalib/src/vespa/vespalib/data/slime/inject.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/inject.cpp
@@ -6,6 +6,9 @@
#include "object_traverser.h"
#include <cstdlib>
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.data.slime.inject");
+
namespace vespalib {
namespace slime {
@@ -48,7 +51,7 @@ void injectValue(const Inserter &inserter, const Inspector &inspector, const Ins
case ARRAY::ID: return injectArray(inserter, inspector, guard);
case OBJECT::ID: return injectObject(inserter, inspector, guard);
}
- abort(); // should not be reached
+ LOG_ABORT("should not be reached"); // should not be reached
}
void
diff --git a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
index 72b494e2479..29ab55143e0 100644
--- a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
@@ -9,6 +9,9 @@
#include <cmath>
#include <sstream>
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.data.slime.json_format");
+
namespace vespalib::slime {
namespace {
@@ -133,7 +136,7 @@ struct JsonEncoder : public ArrayTraverser,
case ARRAY::ID: return encodeARRAY(inspector);
case OBJECT::ID: return encodeOBJECT(inspector);
}
- abort(); // should not be reached
+ LOG_ABORT("should not be reached"); // should not be reached
}
void entry(size_t idx, const Inspector &inspector) override;
void field(const Memory &symbol_name, const Inspector &inspector) override;
diff --git a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
index d2ef5297d72..aae277b48d8 100644
--- a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
+++ b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
@@ -7,6 +7,9 @@
#include "avx2.h"
#include "avx512.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.hwaccelrated");
+
namespace vespalib::hwaccelrated {
namespace {
@@ -57,7 +60,7 @@ void verifyAccelrator(const IAccelrated & accel)
T hwComputedSum(accel.dotProduct(&a[j], &b[j], testLength - j));
if (sum != hwComputedSum) {
fprintf(stderr, "Accelrator is not computing dotproduct correctly.\n");
- abort();
+ LOG_ABORT("should not be reached");
}
}
delete [] a;
diff --git a/vespalib/src/vespa/vespalib/net/selector.cpp b/vespalib/src/vespa/vespalib/net/selector.cpp
index e59638b6144..5d73396bc7d 100644
--- a/vespalib/src/vespa/vespalib/net/selector.cpp
+++ b/vespalib/src/vespa/vespalib/net/selector.cpp
@@ -7,6 +7,7 @@
#include <cstring>
#include <unistd.h>
#include <fcntl.h>
+#include <vespa/log/log.h>
namespace vespalib {
@@ -19,7 +20,7 @@ uint32_t maybe(uint32_t value, bool yes) { return yes ? value : 0; }
void check(int res) {
if (res == -1) {
if (errno == ENOMEM) {
- abort();
+ LOG_ABORT("out of memory");
}
}
}
diff --git a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
index 7b895f3eb73..cf7fdebb401 100644
--- a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
+++ b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
@@ -10,6 +10,8 @@
#include <limits>
#include <stdexcept>
#include <cassert>
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.stllike.asciistream");
namespace vespalib {
@@ -521,7 +523,7 @@ void asciistream::write(const void * buf, size_t len)
if (_wbuf.empty()) {
_wbuf = _rbuf; // Read only to RW
} else {
- abort(); // Impossible
+ LOG_ABORT("should not be reached"); // Impossible
}
}
_wbuf.append(buf, len);
diff --git a/vespalib/src/vespa/vespalib/testkit/test_master.cpp b/vespalib/src/vespa/vespalib/testkit/test_master.cpp
index d5309845dfd..49ee3d6da94 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_master.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_master.cpp
@@ -3,6 +3,8 @@
#include "test_master.h"
#include <vespa/vespalib/util/barrier.h>
#include <cstring>
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.testkit.test_master");
namespace vespalib {
@@ -111,7 +113,7 @@ TestMaster::handleFailure(const vespalib::LockGuard &guard, bool fatal)
}
fprintf(stderr, "%s: ERROR: vital check failed, aborting\n",
_name.c_str());
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp b/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp
index a9191a8fc4f..cbefa285384 100644
--- a/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/time_bomb.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 "time_bomb.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".vespalib.testkit.time_bomb");
namespace vespalib {
@@ -20,7 +22,7 @@ void bomb(Gate &gate, size_t seconds) {
}
}
fprintf(stderr, "BOOM!\n");
- abort();
+ LOG_ABORT("should not be reached");
}
} // namespace vespalib::<unnamed>
diff --git a/vespalib/src/vespa/vespalib/util/hashmap.h b/vespalib/src/vespa/vespalib/util/hashmap.h
index ed686497458..44db499f372 100644
--- a/vespalib/src/vespa/vespalib/util/hashmap.h
+++ b/vespalib/src/vespa/vespalib/util/hashmap.h
@@ -4,6 +4,7 @@
#include "hashmapdata.h"
#include <cstring>
#include <cstdlib>
+#include <assert.h>
/**
* @brief namespace for generic Vespa library
@@ -350,6 +351,7 @@ HashMap<T>::maxDepth() const
}
if (d > ret) ret = d;
}
+ assert(cnt == _entryCnt);
if (cnt != _entryCnt) abort();
return ret;
}
diff --git a/vsm/src/vespa/vsm/searcher/fold.cpp b/vsm/src/vespa/vsm/searcher/fold.cpp
index 8974e669eba..903b1e43f79 100644
--- a/vsm/src/vespa/vsm/searcher/fold.cpp
+++ b/vsm/src/vespa/vsm/searcher/fold.cpp
@@ -48,7 +48,7 @@ const unsigned char * sse2_foldaa(const unsigned char * toFoldOrg, size_t sz, un
folded[i] = __builtin_ia32_por128(_0_9, _a_z);
#else
# warning "Intel's icc compiler does not like __builtin_ia32_pxor128"
- abort();
+ LOG_ABORT("should not be reached");
#endif
}
return toFoldOrg+i*16;
@@ -98,7 +98,7 @@ const unsigned char * sse2_foldua(const unsigned char * toFoldOrg, size_t sz, un
folded[i] = __builtin_ia32_por128(_0_9, _a_z);
#else
# warning "Intel's icc compiler does not like __builtin_ia32_pxor128"
- abort();
+ LOG_ABORT("should not be reached");
#endif
}
return toFoldOrg+i*16;
diff --git a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
index ffbc43104e6..b388507aed5 100644
--- a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
+++ b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
@@ -95,7 +95,7 @@ inline const char * advance(const char * n, const v16qi zero)
charMap = __builtin_ia32_pmovmskb128(tmp0); // 1 in charMap equals to '\0' in input buffer
#else
# warning "Intel's icc compiler does not like __builtin_ia32_xxxxx"
- abort();
+ LOG_ABORT("should not be reached");
#endif
zeroCountSum += 16;
} while (!charMap);
@@ -112,7 +112,7 @@ inline const char * advance(const char * n, const v16qi zero)
zeroMap = __builtin_ia32_pmovmskb128(tmpCurrent); // 1 in zeroMap equals to word character in input buffer
#else
# warning "Intel's icc compiler does not like __builtin_ia32_xxxxx"
- abort();
+ LOG_ABORT("should not be reached");
#endif
zeroCountSum += 16;
} while(!zeroMap);