fix: address ubsan findings#350
Open
zjw1111 wants to merge 6 commits into
Open
Conversation
Comment on lines
+42
to
46
| static uint32_t HashBytes(const char* bytes, int32_t length) { | ||
| uint32_t result = 0; | ||
| for (int32_t i = 0; i < length; i++) { | ||
| result = (result * 31) + static_cast<int32_t>(bytes[i]); | ||
| result = result * 31U + static_cast<uint32_t>(static_cast<int32_t>(bytes[i])); | ||
| } |
Comment on lines
28
to
31
| target_compile_options(paimon_sanitizer_flags INTERFACE -fsanitize=undefined | ||
| -fno-sanitize=vptr | ||
| -fno-omit-frame-pointer) | ||
| target_link_options(paimon_sanitizer_flags INTERFACE -fsanitize=undefined) |
Comment on lines
+18
to
+20
| # Arrow's ISO8601 string-to-timestamp parser intentionally reaches the int64 | ||
| # nanosecond boundary for values such as 1677-09-21 00:12:43.145224192. | ||
| signed-integer-overflow:std::chrono::__duration_cast_impl |
Comment on lines
+24
to
+26
| leak:tokio::runtime::blocking::pool::spawn_blocking | ||
| leak:tokio::runtime::scheduler::multi_thread::worker::create | ||
| leak:std::thread::Builder::spawn_unchecked |
lxy-9602
reviewed
Jun 9, 2026
| for (size_t i = 0; i < group; ++i) { | ||
| multiple *= 10; | ||
| if (length == 0) { | ||
| return Decimal::int128_t{0}; |
Collaborator
There was a problem hiding this comment.
return bad status when "".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: N/A
This PR fixes several undefined-behavior findings exposed after enabling sanitizer flags on the object library target. It also makes Hive bucket hashing use unsigned wraparound semantics at the interface level, matching the Java-style overflow behavior without relying on C++ signed overflow.
The changes include:
paimon_objlibso implementation files are compiled with UBSan/ASan options.Tests
API and Format
No public API, storage format, or protocol changes. The Hive hasher internal interface now uses unsigned hash value types.
Documentation
No user-facing documentation changes.
Generative AI tooling
Generated-by: Codex