[SPARK-56955][CORE] Add --sun-misc-unsafe-memory-access=allow for JDK 25+#55999
Closed
yadavay-amzn wants to merge 1 commit into
Closed
[SPARK-56955][CORE] Add --sun-misc-unsafe-memory-access=allow for JDK 25+#55999yadavay-amzn wants to merge 1 commit into
yadavay-amzn wants to merge 1 commit into
Conversation
… 25+ JDK 25 restricts unsafe memory access by default, breaking Arrow/Netty memory allocator initialization (EmptyByteBuf.memoryAddress() throws UnsupportedOperationException). Add the JVM flag to restore access when running on JDK 25+. Closes #SPARK-56955
ec3e225 to
00823f6
Compare
Contributor
Author
|
Closing in favor of #56006 by @attilapiros. Thanks! |
Member
|
Thank you for making a PR and closing to merge with other PRs, @yadavay-amzn . |
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.
What changes were proposed in this pull request?
Add
--sun-misc-unsafe-memory-access=allowto JVM options when running on JDK 25+, inJavaModuleOptions.java.Why are the changes needed?
JDK 25 restricts unsafe memory access by default, breaking Arrow/Netty memory allocator initialization (
EmptyByteBuf.memoryAddress()throwsUnsupportedOperationException). This affectsspark-shell --remoteand any code path that initializes Arrow.Found by @dongjoon-hyun, confirmed by @attilapiros who identified the fix flag. Same issue as apache/iceberg#15930.
Does this PR introduce any user-facing change?
No. Spark will work correctly on JDK 25 without requiring users to manually add JVM flags.
How was this patch tested?
AmmoniteReplE2ESuitepasses on JDK 17 (unchanged behavior)AmmoniteReplE2ESuitepasses on JDK 25 (was failing without the flag)Was this patch authored or co-authored using generative AI tooling?
No.