This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 910ad5990a7 branch-4.1: [fix](be) catch block serialization exceptions
to avoid coredump #64852 (#65003)
910ad5990a7 is described below
commit 910ad5990a779213d8b4f68a731ddef0aeaa4a06
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 30 16:11:49 2026 +0800
branch-4.1: [fix](be) catch block serialization exceptions to avoid
coredump #64852 (#65003)
Cherry-picked from #64852
Co-authored-by: hui lai <[email protected]>
---
be/src/core/block/block.cpp | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/be/src/core/block/block.cpp b/be/src/core/block/block.cpp
index b42f0bf5f75..f5208a8e071 100644
--- a/be/src/core/block/block.cpp
+++ b/be/src/core/block/block.cpp
@@ -1004,14 +1004,16 @@ Status Block::serialize(int be_exec_version, PBlock*
pblock,
// calc uncompressed size for allocation
size_t content_uncompressed_size = 0;
- for (const auto& c : *this) {
- PColumnMeta* pcm = pblock->add_column_metas();
- c.to_pb_column_meta(pcm);
- DCHECK(pcm->type() != PGenericType::UNKNOWN) << " forget to set pb
type";
- // get serialized size
- content_uncompressed_size +=
- c.type->get_uncompressed_serialized_bytes(*(c.column),
pblock->be_exec_version());
- }
+ RETURN_IF_CATCH_EXCEPTION({
+ for (const auto& c : *this) {
+ PColumnMeta* pcm = pblock->add_column_metas();
+ c.to_pb_column_meta(pcm);
+ DCHECK(pcm->type() != PGenericType::UNKNOWN) << " forget to set pb
type";
+ // get serialized size
+ content_uncompressed_size +=
c.type->get_uncompressed_serialized_bytes(
+ *(c.column), pblock->be_exec_version());
+ }
+ });
// serialize data values
// when data type is HLL, content_uncompressed_size maybe larger than real
size.
@@ -1027,9 +1029,11 @@ Status Block::serialize(int be_exec_version, PBlock*
pblock,
}
char* buf = column_values.data();
- for (const auto& c : *this) {
- buf = c.type->serialize(*(c.column), buf, pblock->be_exec_version());
- }
+ RETURN_IF_CATCH_EXCEPTION({
+ for (const auto& c : *this) {
+ buf = c.type->serialize(*(c.column), buf,
pblock->be_exec_version());
+ }
+ });
*uncompressed_bytes = content_uncompressed_size;
const size_t serialize_bytes = buf - column_values.data() +
STREAMVBYTE_PADDING;
*compressed_bytes = serialize_bytes;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]