Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable libcpp hardening #24227

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bazel/internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ def redpanda_copts():
# this workaround macro was removed. so we'll need to rewrite the format
# handling for >1000 types.
copts.append("-DFMT_DEPRECATED_OSTREAM")
copts.append("-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG")

return copts
1 change: 1 addition & 0 deletions src/v/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_compile_options(-Wall)
add_compile_definitions(FMT_DEPRECATED_OSTREAM)
add_compile_definitions(_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)

#
# When enabled clang-tidy will be invoked along side the compiler, and
Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/topic_table_probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace cluster {

topic_table_probe::topic_table_probe(const topic_table& topic_table)
: _topic_table(topic_table)
, _node_id(*config::node().node_id()) {
, _node_id(config::node().node_id().value_or(model::node_id(0))) {
setup_metrics();
}

Expand Down
2 changes: 1 addition & 1 deletion src/v/compression/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ redpanda_cc_btest(

redpanda_cc_bench(
name = "zstd_stream_bench",
timeout = "short",
timeout = "moderate",
srcs = [
"zstd_stream_bench.cc",
],
Expand Down
4 changes: 2 additions & 2 deletions src/v/container/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ redpanda_cc_btest(

redpanda_cc_bench(
name = "vector_bench",
timeout = "short",
timeout = "long",
srcs = [
"vector_bench.cc",
],
Expand All @@ -108,7 +108,7 @@ redpanda_cc_bench(

redpanda_cc_bench(
name = "map_bench",
timeout = "short",
timeout = "long",
srcs = [
"map_bench.cc",
],
Expand Down
6 changes: 6 additions & 0 deletions src/v/raft/group_configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,9 @@ void configuration_change_strategy_v4::replace_brokers(

void configuration_change_strategy_v4::finish_configuration_transition() {
// if there are no nodes to remove there is no need to enter joint consensus
if (!_cfg._configuration_update.has_value()) {
return;
}
if (_cfg._configuration_update->replicas_to_remove.empty()) {
_cfg._configuration_update.reset();
return;
Expand Down Expand Up @@ -1158,6 +1161,9 @@ void configuration_change_strategy_v5::replace(

void configuration_change_strategy_v5::finish_configuration_transition() {
// if there are no nodes to remove there is no need to enter joint consensus
if (!_cfg._configuration_update.has_value()) {
return;
}
if (_cfg._configuration_update->replicas_to_remove.empty()) {
_cfg._configuration_update.reset();
return;
Expand Down
5 changes: 2 additions & 3 deletions src/v/storage/disk_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2411,10 +2411,9 @@ disk_log_impl::make_reader(timequery_config config) {
stlog.debug,
"Batch timestamps have monotonically increasing "
"timestamps; used segment index to find first batch before "
"timestamp {}: offset={} with ts={}",
"timestamp {}: {}",
cfg.time,
index_entry->offset,
index_entry->timestamp);
index_entry);
}

auto offset_within_segment
Expand Down
4 changes: 2 additions & 2 deletions src/v/utils/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ redpanda_cc_btest(

redpanda_cc_bench(
name = "coro_bench",
timeout = "short",
timeout = "moderate",
srcs = [
"coro_bench.cc",
],
Expand Down Expand Up @@ -484,7 +484,7 @@ redpanda_cc_btest(

redpanda_cc_bench(
name = "delta_for_bench",
timeout = "short",
timeout = "moderate",
srcs = [
"delta_for_bench.cc",
],
Expand Down
Loading