-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-43479: [Java] Change visibility of MemoryUtil.UNSAFE #43480
Conversation
`MemoryUtil.UNSAFE` field is a public field which provides unrestricted access to `sun.misc.Unsafe` instance which may cause misusage and possibly JVM crashes. Make the field private and only allow indirect use of Unsafe through `MemoryUtil` methods
|
@github-actions crossbow submit -g java |
Revision: fa8ebde Submitted crossbow builds: ursacomputing/crossbow @ actions-75ecf561e7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @laurentgo, this was needed!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @laurentgo !
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6bba203. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 17 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
MemoryUtil.UNSAFE
field is a public field which provides unrestricted access tosun.misc.Unsafe
instance which may cause misusage and possibly JVM crashes.What changes are included in this PR?
Make the field (and other related fields) private and only allow indirect use of Unsafe through
MemoryUtil
methodsAre these changes tested?
Yes.
Are there any user-facing changes?
No
This PR includes breaking changes to public APIs.
Code using
MemoryUtil.UNSAFE
would break as the visibility of the field was changed to privatesun.misc.Unsafe
#43479