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

Warning about netty's shaded jctools' usage of Unsafe #260

Closed
jerboaa opened this issue Jun 17, 2024 · 2 comments · Fixed by quarkusio/quarkus#41251
Closed

Warning about netty's shaded jctools' usage of Unsafe #260

jerboaa opened this issue Jun 17, 2024 · 2 comments · Fixed by quarkusio/quarkus#41251
Assignees

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Jun 17, 2024

With recent mandrel-integration test runs we see these warnings for Mandrel for JDK 22 and Mandrel for JDK 21 and quarkus main:

Warning: RecomputeFieldValue.ArrayIndexScale automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) was detected in the static initializer of io.netty.util.internal.shaded.org.jctools.util.UnsafeLongArrayAccess. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) for the array index scale computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.

This seems concerning and needs to get investigated.

@zakkak
Copy link
Collaborator

zakkak commented Jun 17, 2024

The call to UnsafeAccess.UNSAFE.arrayIndexScale happens in https://github.com/JCTools/JCTools/blob/a17b56f09cc9ec7d773707578c89f3ca9c11f968/jctools-core/src/main/java/org/jctools/util/UnsafeLongArrayAccess.java#L26 and its return value is indeed not stored in any field, it's only used in the static initializer.

The class needs to be initialized at runtime. Working on a Quarkus patch.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jun 17, 2024

Thanks!

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 a pull request may close this issue.

2 participants