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

Rework sun.misc.Unsafe usages so that we directly refer to sun.misc.Unsafe, and call getObject on it natively instead of through reflection. #1722

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented May 4, 2023

Rework sun.misc.Unsafe usages so that we directly refer to sun.misc.Unsafe, and call getObject on it natively instead of through reflection.

Calling getObject through reflection breaks Azul JVMs, because the staticFieldBase is a funny "not object", but when passed through reflection it tries to become an Object and fails.

Retrieval of the unsafe is based on how other google open source projects do it, see for example AbstractFuture, UnsignedBytes, and protobufs.

Fixes #1719, and properly fixes #1672.

(Note that this change also bumps the Github Action's bazel version from 4.2.2 to 6.1.2, because somewhere along the way from 4.2.2->6.1.2, Bazel fixed the --javacopts="--release 8" option to also allow sun.misc.Unsafe.)

@copybara-service copybara-service bot force-pushed the test_529205332 branch 2 times, most recently from 624fba8 to d7cb470 Compare May 4, 2023 15:16
@copybara-service copybara-service bot changed the title Rework sun.misc.Unsafe usages so that we directly refer to sun.misc.Unsafe, and call getObject on it natively instead of through reflection. Calling getObject through reflection breaks Azul JVMs, because the staticFieldBase is a funny "not object", but when passed through reflection it tries to become an Object and fails. Rework sun.misc.Unsafe usages so that we directly refer to sun.misc.Unsafe, and call getObject on it natively instead of through reflection. May 4, 2023
@copybara-service copybara-service bot closed this May 4, 2023
@copybara-service copybara-service bot deleted the test_529205332 branch May 4, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HiddenClassDefiner incorrectly assumes Unsafe.staticFieldBase(Field) returns a real Object
0 participants