Skip to content
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

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

laurentgo
Copy link
Collaborator

@laurentgo laurentgo commented Jul 30, 2024

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

`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
@laurentgo laurentgo requested a review from lidavidm as a code owner July 30, 2024 02:27
Copy link

⚠️ GitHub issue #43479 has been automatically assigned in GitHub to PR creator.

@lidavidm
Copy link
Member

@github-actions crossbow submit -g java

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Jul 30, 2024
Copy link

Revision: fa8ebde

Submitted crossbow builds: ursacomputing/crossbow @ actions-75ecf561e7

Task Status
java-jars GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
verify-rc-source-java-linux-almalinux-8-amd64 GitHub Actions
verify-rc-source-java-linux-conda-latest-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-20.04-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-22.04-amd64 GitHub Actions
verify-rc-source-java-macos-amd64 GitHub Actions

Copy link
Collaborator

@vibhatha vibhatha left a 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!!!

Copy link
Member

@danepitkin danepitkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @laurentgo !

@danepitkin danepitkin merged commit 6bba203 into apache:main Jul 30, 2024
17 checks passed
@danepitkin danepitkin removed the awaiting merge Awaiting merge label Jul 30, 2024
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Jul 30, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants