Created on 2018-05-07.06:55:31 by jeff.allen, last changed 2018-05-08.22:13:29 by stefan.richthofer.
||Author: Jeff Allen (jeff.allen)
test_gc_jy produces warnings in Java 9
WARNING: Illegal reflective access by org.python.modules.gc (file:.../jython-dev.jar) to field java.util.ArrayList.elementData
A cut-down version of the test only running GCTests_Jy_TraverseByReflection is a good basis for debugging. Launching the test as:
dist\bin\jython -J--illegal-access=debug -m test.regrtest -v test_gc_jy
will show where the illegal access happens, at the call to setAccessible in org.python.modules.gc.traverseByReflectionIntern.
I'm peeling this off from #2656 in order to park it. I don't consider this a blocker for 2.7.2, but it is a long-term Java roadmap issue. Before the available JVMs prohibit access to private fields (at the moment they just produce an ugly message), our implementation of gc will need a re-think. The ugly message is not encountered unless the optional gc module is invoked, which must mean the user is prepared for a tussle with JVM internals.
||Author: Stefan Richthofer (stefan.richthofer)
traverseByReflection is only a fallback mode, see javadoc of modules.gc.DONT_TRAVERSE_BY_REFLECTION for details.
The easiest solution on this front would be to disable it by default, currently it is enabled by default.
A more elaborate solution could attempt to get fields by method access to avoid private access. However the current implementation intentionally avoids this because of unforeseeable potential side effects of method calls.