bugGNU Octave - Bugs: bug #58266, Error "An illegal reflective...

 
 

bug #58266: Error "An illegal reflective access operation has occurred" in Java subsystem

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Tue 28 Apr 2020 07:12:00 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 16 Jun 2020 08:41:21 AM UTC, comment #6: 

The classloader issue has a bug report of its own, I didn't know about that when I entered this bug report: bug #55174, but I see you found that one as well.

So closing as "Invalid" as this is an upstream issue.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 16 Jun 2020 08:31:44 AM UTC, comment #5: 


> I got it with Java 10 though (I'd have to check, I have no Java > 10)


I might be wrong about the "this started with Java 11 or newer"; it could well be "with Java 9 or newer" since that's when the module system and the Jigsaw project happend; I just didn't work much with Java 9.

> So would you think this is rather an upstream bug, and we can close this bug report?


Probably. This should probably be reported to whatever packages or projects are providing the specific Java code that is triggering this error when it is loaded, asking them to add support for Java 9+ and modules. As I understand it, this is not something that Octave can fix by altering how it interacts with its embedded JRE; it is all about how compiled Java code is interacting with the JRE.

That said, I don't really understand the "Archived non-system classes are disabled..." warning, and that one does have to do with ClassLoader, which might be caused by Octave itself. So might want to leave this bug report open, since it's dealing with both.

Andrew Janke <apjanke>
Tue 16 Jun 2020 08:22:56 AM UTC, comment #4: 

@Andrew:
Thanks for the explanation - I suppose you're right. I got it with Java 10 though (I'd have to check, I have no Java > 10).

AFAIR I myself only got these "reflective access operation" errors with ODF Toolkit from > 6 or 7 years ago. I now see that in the mean time there's a less ancient ODF Toolkit release, other than that the project looks stalled if not dead anyway. So maybe I shouldn't bother about this error.

So would you think this is rather an upstream bug, and we can close this bug report?

Philip Nienhuis <philipnienhuis>
Group Member
Tue 16 Jun 2020 01:20:26 AM UTC, comment #3: 

The "reflective access operation has occurred" happens with a bunch of Java code that has been compiled on older versions of the JDK and is then run against Java 11 or newer, even when running in a plain old non-embedded JRE environment. I believe it's related to the new "module" system introduced in Java 9. I think fixing it requires modification to whatever Java code is being loaded, not a change in how the embedded JVM is being initialized or called from the C++ code.

Andrew Janke <apjanke>
Thu 30 Apr 2020 10:52:11 AM UTC, comment #2: 

While investigating (note: my Java and C++ proficiency is meager) and after some reading up it turned out that there are separate bugs here.

The one Olaf mentioned in the package release tracker and mentioned as 2nd here:

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "org.octave.OctClassLoader"). To use archived non-system classes, this property must be not be set


is probably solved using the attached patch (I never got that message on my systems so I'm not sure).
I tried this patch and I see no difference in Java behavior in Linux and Windows. Octave's test suite passes all Java-related checks and all Java methods in the io package (quite lot actually) work as before.

The other (original) "reflective access operation has occurred" warning is beyond me. It provokes a bug but only the first time, when the warning is emitted, next times the offending Java operation proceeds w/o issue.


(file #48972)

Philip Nienhuis <philipnienhuis>
Group Member
Tue 28 Apr 2020 07:15:43 PM UTC, comment #1: 

Bug #58004 is (probably) depending on this bug.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 28 Apr 2020 07:12:00 PM UTC, original submission:  

With some Java operations a warning is emitted as follows:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.octave.ClassHelper (file:/C:/Programs/Octave/Octave-7.0.0_20200423D/mingw64/share/octave/7.0.0/m/java/octave.jar) to method com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(java.lang.String,java.lang.Object,javax.xml.namespace.QName)
WARNING: Please consider reporting this to the maintainers of org.octave.ClassHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operati
ons
WARNING: All illegal access operations will be denied in a future release


I saw this warning appear after I upgraded Java from 8 to 10 on my Windows boxes.
But in the mean time other have noted AFAICS similar issues in Octave's Java subsystem, e.g., the thread about the io-2.6.0 release [1] where Olaf mentioned it when processing the XML I/O functions:
<quote>

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "org.octave.OctClassLoader"). To use archived non-system classes, this property must be not be set


</quote.

(I think the Java issue reports itself differently in Linux than in Windows.)

Another example:
A thread about a perceived Named ranges bug in LibreOffice's UNO-Java bridge [2] from 5 years ago where I now conclude that this bug really must be in Octave itself.  A deceiving issue there is that the bug occurs only the first time when Java detects the error, but next times the Octave code seems to function properly.

I have very limited knowledge of the Java subsystem, I can only hope this can be solved w/o too much trouble.

[1] https://sourceforge.net/p/octave/package-releases/405/#78a4ad following posts
[2] https://bugs.documentfoundation.org/show_bug.cgi?id=94423

Philip Nienhuis <philipnienhuis>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48972:  Java_system_loader.patch added by philipnienhuis (872B - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by apjanke (Posted a comment)
  • -email is unavailable- added by saturn
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-16 philipnienhuis StatusPatch Submitted Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2020-05-06 saturn Carbon-Copy- Added saturn
    2020-04-30 philipnienhuis Attached File- Added Java_system_loader.patch, #48972
        StatusNone Patch Submitted
    2020-04-28 philipnienhuis Dependencies- bugs #58004 is dependent

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code