This is an automated email from the ASF dual-hosted git repository. xuyang pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push: new c7b26ba1a01 [branch-1.2](bug) Fix coredump in aggregation node's destruction (#28852) c7b26ba1a01 is described below commit c7b26ba1a01c906c552ff92e237a337440ddd622 Author: xy720 <22125576+xy...@users.noreply.github.com> AuthorDate: Mon Dec 25 13:31:58 2023 +0800 [branch-1.2](bug) Fix coredump in aggregation node's destruction (#28852) Fix coredump in aggregation node's destruction --- be/src/vec/exec/vaggregation_node.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/be/src/vec/exec/vaggregation_node.cpp b/be/src/vec/exec/vaggregation_node.cpp index 67924a61b63..eff5db74832 100644 --- a/be/src/vec/exec/vaggregation_node.cpp +++ b/be/src/vec/exec/vaggregation_node.cpp @@ -822,18 +822,25 @@ void AggregationNode::_emplace_into_hash_table(AggregateDataPtr* places, ColumnR auto creator = [this](const auto& ctor, const auto& key) { using KeyType = std::decay_t<decltype(key)>; - if constexpr (HashTableTraits<HashTableType>::is_string_hash_table && - !std::is_same_v<StringRef, KeyType>) { - StringRef string_ref = to_string_ref(key); - ArenaKeyHolder key_holder {string_ref, *_agg_arena_pool}; - key_holder_persist_key(key_holder); - auto mapped = _aggregate_data_container->append_data(key_holder.key); - _create_agg_status(mapped); - ctor(key, mapped); - } else { - auto mapped = _aggregate_data_container->append_data(key); - _create_agg_status(mapped); - ctor(key, mapped); + try { + if constexpr (HashTableTraits<HashTableType>::is_string_hash_table && + !std::is_same_v<StringRef, KeyType>) { + StringRef string_ref = to_string_ref(key); + ArenaKeyHolder key_holder {string_ref, *_agg_arena_pool}; + key_holder_persist_key(key_holder); + auto mapped = _aggregate_data_container->append_data(key_holder.key); + _create_agg_status(mapped); + ctor(key, mapped); + } else { + auto mapped = _aggregate_data_container->append_data(key); + _create_agg_status(mapped); + 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; } }; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org