-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Eliminate or configure invasive JDK class accesses for Java 9 #4834
Comments
+1 Had to hack a bunch of build code to ignore this output. |
To help others dealing with the warnings, here's an example of eliminating them (a.k.a. a workaround!). The
I put these into JAVA_OPTS env and that eliminates the warnings. Follow this pattern and you should be able to ease your build hacking. We may need to install some of these flags into our launcher, for accesses that we can't yet replace through other means. In order for this to be really kosher with the module system, however, we'll want to export our own module so that the |
adding
|
I couldn't figure out the module name for this referenced from jruby/java/invokers/FieldMethodZero.java#L25. Here're for others I found:
|
I'm getting this error while running
|
Inspired by jruby/jruby#4834, thanks!
Just tried upgrading a postgres-backed API to jruby 9.1.16.0 and java 9, which failed. Was busted running some database migrations via Sequel, which hit an illegal access: https://github.com/jeremyevans/sequel/blob/4cad051de9e63042c8950be69d6289686e19c0ac/lib/sequel/adapters/jdbc/postgresql.rb#L228
|
Actually, scratch my previous comment. I was running an older version of Java 9 ("9-internal"), rather than the latest "9.0.4". Running on latest 9.0.4, my database migrations and test suite run - but with 'Illegal reflective access' warnings. However, the puma web server fails to start: #5082 Lesson learned: install a specific version of java 9 directly, rather than depending on 'apt-get install openjdk-9-jdk'. |
Is there a good reason for tinkering with CRC32 internals? It seems to be just to support use of potentially faster implementation for call to
|
@jmiettinen I traced it back to this commit: e52313e I did this so long ago I'm not entirely certain of my justification, but I believe it's to work around Java's CRC32 not being restartable at a particular initial value, which we need to support for Ruby's API. This may no longer be a limitation. In any case, you're right, this is one of those items that should be fixed or eliminated, either by using better Java CRC32 APIs that allow an initial value or by doing a clean-room implementation of CRC32 that works the way we want. |
Yeah, I can see that this is to support Ruby It would probably be slightly slower as the OpenJDK CRC32 uses intrinsics, but it does not seem to make the code more complex at least: final boolean slowPath = start != 0;
final int bytesLength = bytes == null ? 0 : bytes.length();
long result = 0;
if (bytes != null) {
CRC32 checksum = new CRC32();
checksum.update(bytes.getUnsafeBytes(), bytes.begin(), bytesLength);
result = checksum.getValue();
}
if (slowPath) {
result = JZlib.crc32_combine(start, result, bytesLength);
} |
@jmiettinen Hey, that's a great idea! Can you make a PR? |
Here's a set of opens that gets our build to not warn (it uses 9.1.8.0 during parts). @enebo and I talked today about creating a tool that can analyze the warning output and produce a command line.
|
This depends on #4835 which had some work for 9.2.1 and will have more for 9.2.2. |
I think most of this has been done in the launcher, by adding known packages we have to open up. I'm going to drop this issue in favor of other specific ones that mention specific packages. |
Seeing several issues with later versions of Java: jruby/jruby#4834 Adding `--add-opens java.base/java.io=jruby` got past one issue but `zlib` is not found after that. Pinning to JDK 8 for now to fix PR testing.
Seeing several issues with later versions of Java: jruby/jruby#4834 Adding `--add-opens java.base/java.io=jruby` got past one issue but `zlib` is not found after that. Pinning to JDK 8 for now to fix PR testing.
Seeing several issues with later versions of Java: jruby/jruby#4834 Adding `--add-opens java.base/java.io=jruby` got past one issue but `zlib` is not found after that. Pinning to JDK 8 for now to fix PR testing. This also pins postgres to 9.6, as 9.3 is failing as well.
Seeing several issues with later versions of Java: jruby/jruby#4834 Adding `--add-opens java.base/java.io=jruby` got past one issue but `zlib` is not found after that. Pinning to JDK 8 for now to fix PR testing. This also pins postgres to 9.6, as 9.3 is failing as well.
… Rubinius (#921) * CI: Extend matrix w/ JRuby 9.2 * CI: run Rubinius in trusty * CI: JRuby 9.2 JAVA_OPTS with --add-opens decls See jruby/jruby#4834 * CI: Use "name" to identify specific matrix jobs * CI: Drop unmaintained Ruby versions - see https://www.ruby-lang.org/en/downloads/branches/
… Rubinius (#921) * CI: Extend matrix w/ JRuby 9.2 * CI: run Rubinius in trusty * CI: JRuby 9.2 JAVA_OPTS with --add-opens decls See jruby/jruby#4834 * CI: Use "name" to identify specific matrix jobs * CI: Drop unmaintained Ruby versions - see https://www.ruby-lang.org/en/downloads/branches/
…in console WARNING messages in console mess up our tests. They seem to appear with JRuby 9.1 and Java 9+. Doesn't seem to be an issue with JRuby 9.2. jruby/jruby#4834
…in console WARNING messages in console mess up our tests. They seem to appear with JRuby 9.1 and Java 9+. Doesn't seem to be an issue with JRuby 9.2. jruby/jruby#4834
In #4111 we tracked general Java 9 support, for running JRuby and associated apps and libraries.
This bug tracks the additional flags and cleanup we should do relating to accessibility warnings.
At a minimum, we need to audit all uses of reflection to "crack open" classes and find alternatives or consider --add-opens flags.
Here is the list of illegal accesses we do while running
gem install rails
:More of these warnings will occur on Windows or when running without native IO, since in those cases we crack open core JDK IO classes.
The text was updated successfully, but these errors were encountered: