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

Illegal reflective access operation on lambda enumeration/arity-check #5123

Closed
Haniyya opened this issue Mar 28, 2018 · 3 comments
Closed

Illegal reflective access operation on lambda enumeration/arity-check #5123

Haniyya opened this issue Mar 28, 2018 · 3 comments

Comments

@Haniyya
Copy link

Haniyya commented Mar 28, 2018

Environment

jruby -v jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 OpenJDK 64-Bit Server VM 9.0.4+11 on 9.0.4+11 +jit [linux-x86_64]
OS Linux paul-aspire 4.15.13-1-ARCH #1 SMP PREEMPT Sun Mar 25 11:27:57 UTC 2018 x86_64 GNU/Linux

Expected Behavior

The following script

print_three = ->(a, b, c) { puts [a, b, c] }
arr = [[1, 2, 3]]

arr.map(&print_three)

Should run without warnings.

Actual Behavior

The Output points to illegal reflective access operations.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.io.FilenoUtil to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of org.jruby.util.io.FilenoUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
1
2
3

Addendum

The script above will exit with an error (ArgumentError) on CRuby 2.4.1+. I've posted an issue on the ruby trunk before.
Since this seems to be a bug rather than expected behaviour I guess there is no use in conforming to the strict arity check.

EDIT: The issue has since been fixed.

The script worked on CRuby from 2.2.0 - 2.4.0 so maybe the Issue can be found in the related jruby versions?

@rdubya
Copy link

rdubya commented Mar 28, 2018

Just to add some additional info to this about the warnings, we were seeing warnings similar to those when using Java 9. They don't appear when running Java 8.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.zlib.RubyZlib to field java.util.zip.CRC32.crc
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.zlib.RubyZlib
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@headius
Copy link
Member

headius commented Apr 11, 2018

This is a Java 9+ warning about our using reflection to crack open some JVM objects in order to better support Ruby features. The warnings should generally be harmless, other than the fact that they're always there.

I am working on a set of flags we can pass to Java 9+ JVMs to prevent these messages from being printed. This issue may be considered a dupe of #4834.

@headius headius added this to the JRuby 9.2.0.0 milestone Apr 11, 2018
@enebo enebo modified the milestones: JRuby 9.2.0.0, JRuby 9.2.1.0 May 24, 2018
@headius
Copy link
Member

headius commented Oct 11, 2018

There are numerous duplicate bugs about these warnings. They will all be addressed together once we have finished modularizing (#4835) and do some test runs with full warning noise turned on.

Closing this since it does not add any new information.

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

No branches or pull requests

4 participants