You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sun.misc.Unsafe is a Java internal class only accessible to classes loaded of the boot classloader, unless one uses reflection to bypass this restriction.
org.apache.arrow.memory.util.MemoryUtil makes it available as a public field to any java classes which is kind of opening a pandora box. As a first step towards switching from sun.misc.Unsafe to safer memory access methods (which may become a requirement at some point as discussed in JEP 471 ), remove direct access to sun.misc.Unsafe instance.
Component(s)
Java
The text was updated successfully, but these errors were encountered:
`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
### Rationale for this change
`MemoryUtil.UNSAFE` field is a public field which provides unrestricted access to `sun.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` methods
### Are 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 private
* GitHub Issue: #43479
Authored-by: Laurent Goujon <[email protected]>
Signed-off-by: Dane Pitkin <[email protected]>
Describe the enhancement requested
sun.misc.Unsafe
is a Java internal class only accessible to classes loaded of the boot classloader, unless one uses reflection to bypass this restriction.org.apache.arrow.memory.util.MemoryUtil
makes it available as a public field to any java classes which is kind of opening a pandora box. As a first step towards switching fromsun.misc.Unsafe
to safer memory access methods (which may become a requirement at some point as discussed in JEP 471 ), remove direct access tosun.misc.Unsafe
instance.Component(s)
Java
The text was updated successfully, but these errors were encountered: