Fix native library loading failure due to buffer comparison bug#318
Merged
Fix native library loading failure due to buffer comparison bug#318
Conversation
…son (#317) Compare only the bytes actually read from each stream instead of the entire 8192-byte buffer in contentsEquals(). When the final chunk is smaller than the buffer, stale bytes from the previous iteration could cause a false mismatch, preventing the native library from loading. Uses a byte-by-byte loop instead of Arrays.equals() to maintain JDK 8 compatibility. Fixes #317 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sarutak
pushed a commit
to apache/spark
that referenced
this pull request
Apr 18, 2026
### What changes were proposed in this pull request? This PR upgrades `Maven` to 3.9.15. ### Why are the changes needed? To use the latest Maven version. - https://maven.apache.org/docs/3.9.15/release-notes.html - apache/maven#11876 - codehaus-plexus/plexus-utils#304 - apache/maven#11865 - fusesource/jansi#318 - fusesource/jansi#317 - https://github.com/apache/maven/releases/tag/maven-3.9.15 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs and check the log. - https://github.com/dongjoon-hyun/spark/actions/runs/24586452868/job/71897297495 ``` Using `mvn` from path: /home/runner/work/spark/spark/build/apache-maven-3.9.15/bin/mvn ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) Closes #55398 from dongjoon-hyun/SPARK-56530. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Kousuke Saruta <sarutak@apache.org>
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.
Summary
contentsEquals()inJansiLoaderto compare only the bytes actually read from each stream, instead of comparing the entire 8192-byte buffer viaArrays.equals()Arrays.equals(byte[], int, int, byte[], int, int)overloadFixes #317
Test plan
🤖 Generated with Claude Code
Claude Code on behalf of Guillaume Nodet