JDK-8191930 : [Graal] emits unparseable XML into compile log
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 10,11,12
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-27
  • Updated: 2022-02-24
  • Resolved: 2020-04-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 15
11.0.8-oracleFixed 15 b18Fixed
Related Reports
Relates :  
Relates :  
Description
While using +LogCompilation tool with Graal, there is a org.xml.sax.SAXParseException because Graal emits unparseable XML with too much use of single-quote to wrap embedded object details as shown below. AFAICT so far C2 does not do this so it was never handled in the LogCompilation app code.


<failure reason='Code installation failed: dependencies failed
Failed dependency of type call_site_target_value
  object  = a 'jdk/nashorn/internal/runtime/linker/LinkerCallSite'{0x00000005df235660}
  object  = a 'java/lang/invoke/BoundMethodHandle$Species_LLLL'{0x00000005df235680}
  witness = jdk.nashorn.internal.runtime.linker.LinkerCallSite
'/>


Element type "failure" must be followed by either attribute specifications, ">" or "/>". at line 279406, column 17
org.xml.sax.SAXParseException; lineNumber: 279406; columnNumber: 17; Element type "failure" must be followed by either attribute specifications, ">" or "/>".
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.seekCloseOfStartTag(XMLDocumentFragmentScannerImpl.java:1394)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1324)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
	at com.sun.hotspot.tools.compiler.LogParser.parse(LogParser.java:654)
	at com.sun.hotspot.tools.compiler.LogParser.parse(LogParser.java:632)


Comments
jdk11 backport request I would like to have the patch in OpenJDK11 as well, for better parity with 11.0.8_oracle. The patch applies cleanly.
19-05-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/0499b8336d20 User: never Date: 2020-04-02 18:23:01 +0000
02-04-2020

There was a fix to the xml printing code in JDK8 that never made it into 9+ presumably because the code moved. It's ridiculous that xmlStream doesn't handle this kind of quoting automatically.
31-03-2020

We talked about this with Tom R. We are not yet sure where the fix will be.
30-11-2017

The unparseable XML happens when the bug in JDK-8191052 happens.
29-11-2017

The problem seems to be that the reason is emitted from Graal with embedded single-quote chars which is also what the xml is using to enclose the strings. I will have to look around to see where this message is emitted, I am not sure it is a problem in the LogCompilation tool itself.
28-11-2017

Yes being that I have not yet seen this problem happen with C2 logs we could make it an enhancement, I will switch it.
28-11-2017

ILW = exceptions for LogCompilation with graal, due to multi line failures; with graal; no workaround = LLH = P5 (may be this one and 8191511 can be considered as Enhancement task, not bug? - Enhancement required for LogCompilation for working with aot, graal)
28-11-2017