RFR: 8263790: C2: new igv_print_immediately() for debugging purpose

Yi Yang yyang at openjdk.java.net
Sun Apr 11 05:29:42 UTC 2021


On Fri, 19 Mar 2021 08:50:25 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Sure, I have uploaded `custom_debug.xml` in JBS issue. I don't find an option like '-version' for idealgraphvisualizer. But from GUI->Preference->About, it shows `Version 1.0 (1.0)`.
>
> Hi @kelthuzadx, I cannot reproduce the problem running the latest IGV on JDK 8 and linux-x64 either.
> 
> Note that IGV is designed to tolerate XML files without closing `</graphDocument>` and `</group>` tags. The parser does not use an error handler, which leads to ignoring all parsing errors [1], and on top of that certain parsing exceptions are ignored:
> 
> https://github.com/openjdk/jdk/blob/d24e4cfef36026b781906a9e0c5cf519eb72696e/src/utils/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java#L531-L539
> 
> [1] https://docs.oracle.com/javase/8/docs/api/org/xml/sax/XMLReader.html#setErrorHandler-org.xml.sax.ErrorHandler-
> 
> Perhaps the problem you report should be addressed by making sure IGV also accepts missing closing `</graphDocument>` and `</group>` tags in your case? As you mention, this is a common debugging scenario.

The latest IGV can not open incomplete XML as well.  When I changed the system locale to en-US, it works for incomplete XML as expected. I guess this is yet another an i18n problem. As @robcasloz pointed out, the parser does not use an error handler, which leads to ignoring all parsing errors, and on top of that certain parsing exceptions are ignored
 try { 
     XMLReader reader = createReader(); 
     reader.setContentHandler(new XMLParser(xmlDocument, monitor)); 
     reader.parse(new InputSource(Channels.newInputStream(channel))); 
 } catch (SAXException ex) { 
     if (!(ex instanceof SAXParseException) || !"XML document structures must start and end within the same entity.".equals(ex.getMessage())) { 
         throw new IOException(ex); 
     } 
 } 
In the catch clause, ex.getMessage() compares with ASCII characters, but ex.getMessage()gets characters that corresponding to their system locale settings. To support non-English system locale settings(if needed), we could code something like this:
     if (!(ex instanceof SAXParseException) || !"XML document structures must start and end within the same entity.".equals(disable_i18n(ex.getMessage())))
-------
![fig1](https://user-images.githubusercontent.com/5010047/114293326-c0474e00-9ac7-11eb-983b-22e60bceea6e.png)
![FIG2](https://user-images.githubusercontent.com/5010047/114293327-c2111180-9ac7-11eb-94c6-4e9aac373f74.png)

-------------

PR: https://git.openjdk.java.net/jdk/pull/3071


More information about the hotspot-compiler-dev mailing list