-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8263790: C2: new igv_print_immediately() for debugging purpose #3071
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
Conversation
👋 Welcome back yyang! A progress list of the required criteria for merging this PR into |
@kelthuzadx The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
I'm not sure if I understand this correctly. Is it just about having an ill-formatted xml file or are you actually having problems opening the graph in the IGV? I've just played around with calling If it's the IGV that has problems opening it, could you maybe provide more information how to reproduce this and/or share the xml file that causes problems? |
Okay, that is strange that the closing tags are the only problem. I cannot reproduce this. What version of IGV are you using? Looking at your filters in the screenshot, I assume you are not using one of the most recent versions (there were some fixes/improvements recently done by @robcasloz including new default filters). You could try to build the latest version of IGV and try it again. Could you also share the failing |
Sure, I have uploaded |
Please try the latest version from https://github.com/openjdk/jdk/tree/master/src/utils/IdealGraphVisualizer (you might need Java 8 to build). |
Thanks! I tried it out with a recently built version and I could open it without any problems in the IGV. |
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 jdk/src/utils/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java Lines 531 to 539 in d24e4cf
Perhaps the problem you report should be addressed by making sure IGV also accepts missing closing |
Yes, absolutely. Thank you all for pointing out this. It seems that my IGV is too old to parse incomplete xml documents:-( . I will update it to let it work. The original intention of this patch is to generate complete xml, but it seems that even incomplete xml can be opened by the latest IGV, so this patch seems to be of little significance(Maybe the only use is to make the old version IGV happy). Thanks! |
By not adding the closing tags to the xml file after
Sounds good. |
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()))) |
That makes sense, can you please try if this fix works for you? robcasloz@702e763 If it does, please feel free to re-purpose this issue with the proposed fix (once #3361 is integrated), and with a test case that parses an incomplete XML document in |
Thank you @robcasloz, I can verify it on the weekend. In order to not disturb others, I'd like to close this PR and I have filed this as https://bugs.openjdk.java.net/browse/JDK-8265106. |
Add a new igv_print_immediately, it prints the current method immediately. This differs from other igv_print* methods, it creates a well-formed and complete ideal graph xml immediately, while others accomplish their ideal graph xml when VM exists (i.e. destructor of
IdealGraphPrinter::_xx_printer
). If VM crashes before VM exit, the ideal graph xml will be ill-formed, this is fairly a common case when debugging another crash.Test manually!
Cheers,
Yang
Progress
Issue
Download
To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3071/head:pull/3071
$ git checkout pull/3071
To update a local copy of the PR:
$ git checkout pull/3071
$ git pull https://git.openjdk.java.net/jdk pull/3071/head