yujun777 commented on PR #69456:
URL: https://github.com/apache/doris/pull/69456#issuecomment-6431549068
cloud_p0 failed on a UBSan report in `be.out` while serializing an empty
top-K state:
```
../src/core/pod_array.h:518:29: runtime error: null pointer passed as
argument 2, which is declared to never be null
#3 AggregateFunctionTopK<...>::serialize(...) aggregate_function_topk.h:156
```
An empty state keeps an empty `counts` vector, whose `data()` is null, and
`serialize`/`deserialize` passed it to `BufferWritable::write` /
`BufferReadable::read`. `memcpy` rejects a null argument even for a zero length.
Fixed in 3a22241d0d5: the counts payload is written and read only when the
list is non-empty. The value column payload always carries a size prefix, so
only the counts needed the guard. `TopKTest.SerializeDeserializeRoundTrip` now
round-trips an empty state as well.
The BE UT build cannot catch this class of issue on its own:
`CXX_FLAGS_ASAN_UT` enables `-fsanitize=address` only, while the full ASAN
build used by cloud_p0 adds `-fsanitize=undefined`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]