-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8266773: Release VM is broken with GCC 9 after 8214237 #3941
Conversation
/test |
/label add hotspot-gc |
/issue add JDK-8266773 |
/label add hotspot-gc |
@@ -331,7 +331,7 @@ void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent_level | |||
|
|||
for (uint i = 0; i < phase->MaxThreadWorkItems; i++) { | |||
WorkerDataArray<size_t>* work_items = phase->thread_work_items(i); | |||
if (work_items != NULL) { | |||
if (work_items != NULL && indent(indent_level + 1) != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't do this. indent
never returns NULL. It asserts the given argument is in bounds. The warning is a (gcc9-specific?) false positive, similar to JDK-8235819.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't do this.
indent
never returns NULL. It asserts the given argument is in bounds. The warning is a (gcc9-specific?) false positive, similar to JDK-8235819.
Thanks @kimbarrett for your review.
Yes, I agree that this seems to be false positive with gcc 9.
Fastdebug build wouldn't fail due to the existence of the assert.
But release vm would fail since there is no such an assert.
So any suggestions?
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead use something like:
out->print("%*s%s", 2 * indent_level, "", "indented*s");
or:
out->print("%*c%s", 2 * indent_level, ' ', "indented*c");
And get rid of the "Indents" string array and associated functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string version ("%*s") of mine is better as it will correctly indent the zero indentation case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead use something like:
out->print("%*s%s", 2 * indent_level, "", "indented*s");
or:
out->print("%*c%s", 2 * indent_level, ' ', "indented*c");
And get rid of the "Indents" string array and associated functions.
Good suggestion!
Thanks @lkorinth .
Will update it later if there is no objection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do it the other way, yours is correctly linked to 8266773. Sync with Thomas so that we only have one pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do it the other way, yours is correctly linked to 8266773. Sync with Thomas so that we only have one pull request.
I prefer @tstuefe 's out->sp(indent_level * 2)
.
Patch has been updated.
Testing:
- test/hotspot/jtreg/gc on Linux/x64
Thanks.
👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into |
@DamonFool |
Webrevs
|
@DamonFool The |
@DamonFool The |
@DamonFool The |
@DamonFool This issue is referenced in the PR title - it will now be updated. |
@DamonFool The |
@DamonFool The |
FYI: this patch appears to solve the build issue for me:
Not sure if this is the correct solution. |
Thanks @mgkwill for your info. It would be better to remove all of the old usages of indent(), which is suggested by @lkorinth . |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until 0561a9c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @DamonFool ,
Thanks for tackling this! Feel free to go forward with your patch, I'll withdraw mine.
You patch looks fine. Nit: having a constant for chars-per-indentation would be nice instead of the literal 2 and " ". But I don't have strong emotions.
Cheers, Thomas
@DamonFool This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 30 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks @tstuefe . What do you mean by |
@@ -42,12 +42,6 @@ | |||
#include "utilities/enumIterator.hpp" | |||
#include "utilities/macros.hpp" | |||
|
|||
static const char* indent(uint level) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -359,11 +353,11 @@ void G1GCPhaseTimes::trace_phase(WorkerDataArray<double>* phase, bool print_sum, | |||
#define TIME_FORMAT "%.1lfms" | |||
|
|||
void G1GCPhaseTimes::info_time(const char* name, double value) const { | |||
log_info(gc, phases)("%s%s: " TIME_FORMAT, indent(1), name, value); | |||
log_info(gc, phases)("%s%s: " TIME_FORMAT, " ", name, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer the fixed indentation spaces in the format string instead of in an extra argument. Same for the other cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer the fixed indentation spaces in the format string instead of in an extra argument. Same for the other cases.
Good.
That make sense to me.
Updated.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for fixing this!
Looks still good. ..Thomas |
@DamonFool Since your change was applied there have been 38 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 974b9f7. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
Release VM is broken with GCC 9 due to -Werror=format-overflow=.
And if this assert[1] is removed, fastdebug VM can also reproduce the same bug.
The key to reproduce it is to compile with -O3.
IMO, it seems like a false positive gcc bug.
But we'd better fix it since gcc 9 is assumed to be supported to build OpenJDK.
Thanks.
Best regards,
Jie
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp#L47
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3941/head:pull/3941
$ git checkout pull/3941
Update a local copy of the PR:
$ git checkout pull/3941
$ git pull https://git.openjdk.java.net/jdk pull/3941/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3941
View PR using the GUI difftool:
$ git pr show -t 3941
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3941.diff