Skip to content

Commit

Permalink
[bug](coredump) Fix coredump in aggregation node's destruction(#28684)
Browse files Browse the repository at this point in the history
fix coredump in aggregation node's destruction
  • Loading branch information
xy720 authored Dec 20, 2023
1 parent 3685700 commit 504693b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions be/src/vec/exec/vaggregation_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,13 +847,20 @@ void AggregationNode::_emplace_into_hash_table(AggregateDataPtr* places, ColumnR
agg_method.init_serialized_keys(key_columns, num_rows);

auto creator = [this](const auto& ctor, auto& key, auto& origin) {
HashMethodType::try_presis_key(key, origin, *_agg_arena_pool);
auto mapped = _aggregate_data_container->append_data(origin);
auto st = _create_agg_status(mapped);
if (!st) {
throw Exception(st.code(), st.to_string());
try {
HashMethodType::try_presis_key(key, origin, *_agg_arena_pool);
auto mapped = _aggregate_data_container->append_data(origin);
auto st = _create_agg_status(mapped);
if (!st) {
throw Exception(st.code(), st.to_string());
}
ctor(key, mapped);
} catch (...) {
// Exception-safety - if it can not allocate memory or create status,
// the destructors will not be called.
ctor(key, nullptr);
throw;
}
ctor(key, mapped);
};

auto creator_for_null_key = [this](auto& mapped) {
Expand Down

0 comments on commit 504693b

Please sign in to comment.