mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
... re-enable only the assertions (not full debug mode)
This commit is contained in:
parent
b9b7a1091b
commit
23fcefadc8
@ -1,17 +1,17 @@
|
||||
if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
|
||||
# Enable libcxx debug mode:
|
||||
# --> https://releases.llvm.org/15.0.0/projects/libcxx/docs/DesignDocs/DebugMode.html
|
||||
# Enable libcxx debug mode: https://releases.llvm.org/15.0.0/projects/libcxx/docs/DesignDocs/DebugMode.html
|
||||
# The docs say the debug mode violates complexity guarantees, so do this only for Debug builds.
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_ENABLE_DEBUG_MODE=1")
|
||||
# set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_ENABLE_DEBUG_MODE=1")
|
||||
# ^^ Crashes the database upon startup, needs investigation.
|
||||
# Besides that, the implementation looks like a poor man's MSAN specific to libcxx. Since CI tests MSAN
|
||||
# anyways, we can keep the debug mode disabled.
|
||||
|
||||
# Also, enable randomization of unspecified behavior, e.g. the order of equal elements in std::sort.
|
||||
# "Randomization" means that Debug and Release builds use different seeds.
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=12345678")
|
||||
|
||||
# Note: Libcxx also has provides extra assertions:
|
||||
# Libcxx also provides extra assertions:
|
||||
# --> https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#assertions-mode
|
||||
# These look orthogonal to the debug mode but the debug mode imlicitly enables them:
|
||||
# These look orthogonal to the debug mode but the debug mode enables them implicitly:
|
||||
# --> https://github.com/llvm/llvm-project/blob/release/15.x/libcxx/include/__assert#L29
|
||||
# They are cheap and straightforward, so enable them in debug builds:
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_ENABLE_ASSERTIONS=1")
|
||||
|
||||
# TODO Once we upgrade to LLVM 18+, reconsider all of the above as they introduced "hardening modes":
|
||||
# https://libcxx.llvm.org/Hardening.html
|
||||
|
@ -428,7 +428,7 @@ bool DNSResolver::updateCacheImpl(
|
||||
{
|
||||
updated = true;
|
||||
String deleted_elements;
|
||||
for (auto & it : elements_to_drop)
|
||||
for (auto it : elements_to_drop)
|
||||
{
|
||||
if (!deleted_elements.empty())
|
||||
deleted_elements += ", ";
|
||||
|
@ -23,7 +23,7 @@ RefreshSet::Handle & RefreshSet::Handle::operator=(Handle && other) noexcept
|
||||
id = std::move(other.id);
|
||||
inner_table_id = std::move(other.inner_table_id);
|
||||
dependencies = std::move(other.dependencies);
|
||||
iter = std::move(other.iter); /// NOLINT(performance-move-const-arg)
|
||||
iter = std::move(other.iter);
|
||||
inner_table_iter = std::move(other.inner_table_iter);
|
||||
metric_increment = std::move(other.metric_increment);
|
||||
return *this;
|
||||
|
@ -604,7 +604,7 @@ MergeTask::StageRuntimeContextPtr MergeTask::ExecuteAndFinalizeHorizontalPart::g
|
||||
new_ctx->rows_sources_temporary_file = std::move(ctx->rows_sources_temporary_file);
|
||||
new_ctx->column_sizes = std::move(ctx->column_sizes);
|
||||
new_ctx->compression_codec = std::move(ctx->compression_codec);
|
||||
new_ctx->it_name_and_type = std::move(ctx->it_name_and_type); /// NOLINT(performance-move-const-arg)
|
||||
new_ctx->it_name_and_type = std::move(ctx->it_name_and_type);
|
||||
new_ctx->read_with_direct_io = std::move(ctx->read_with_direct_io);
|
||||
new_ctx->need_sync = std::move(ctx->need_sync);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user