Skip to content
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

8276787: Improve warning messages for -XX:+RecordDynamicDumpInfo #6383

Conversation

iklam
Copy link
Member

@iklam iklam commented Nov 15, 2021

[1] Fixed the error messages for the three scenarios described in the bug report. See the test SharedArchiveFileOption.java for new test cases for these messages.

[2] The global SharedDynamicArchivePath was used for both reading and writing the dynamic archive. Now the writing part is handled by DynamicArchiveBuilder::_archive_name. This simplifies the logic in Arguments::init_shared_archive_paths() and DynamicArchive::dump_for_jcmd(). It also makes the checks in [1] easier to implement.

Testing: running through Oracle CI tiers 1-4.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8276787: Improve warning messages for -XX:+RecordDynamicDumpInfo

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6383/head:pull/6383
$ git checkout pull/6383

Update a local copy of the PR:
$ git checkout pull/6383
$ git pull https://git.openjdk.java.net/jdk pull/6383/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6383

View PR using the GUI difftool:
$ git pr show -t 6383

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6383.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 15, 2021

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 15, 2021

@iklam The following label will be automatically applied to this pull request:

  • hotspot

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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Nov 15, 2021
@iklam
Copy link
Member Author

iklam commented Nov 15, 2021

/label remove hotspot
/label add hotspot-runtime

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Nov 15, 2021
@openjdk
Copy link

openjdk bot commented Nov 15, 2021

@iklam
The hotspot label was successfully removed.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Nov 15, 2021
@openjdk
Copy link

openjdk bot commented Nov 15, 2021

@iklam
The hotspot-runtime label was successfully added.

@iklam iklam marked this pull request as ready for review November 15, 2021 08:03
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 15, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 15, 2021

Webrevs

FileMapInfo::check_archive((const char*)cur_path, false /*is_static*/);
*top_archive_path = cur_path;
}

bool Arguments::init_shared_archive_paths() {
void Arguments::init_shared_archive_paths() {
if (ArchiveClassesAtExit != NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change NULL to nullptr since your new code below in the same function uses nullptr?

check_unsupported_dumping_properties();
SharedDynamicArchivePath = os::strdup_check_oom(ArchiveClassesAtExit, mtArguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is clearer to leave this assignment alone.
It works in your current patch because in line 3561, the ArchiveClassesAtExit is used instead of SharedDynamicArchivePath.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SharedDynamicArchivePath had two meanings before this PR:

  1. the dynamic archive that will be mapped during VM start-up.
  2. the dynamic archive that will be dumped.

This made the code complicated (E.g., the old version of DynamicArchive::dump() needed to call into Arguments::init_shared_archive_paths() to set it SharedDynamicArchivePath).

This PR removed the second meaning. That's why I removed line 3504. Now if ArchiveClassesAtExit is specified, SharedDynamicArchivePath will be NULL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your explanation. It makes sense.

}

if (SharedArchiveFile == NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null to nullptr?

@@ -34,9 +34,10 @@
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. SharedArchiveFileOption
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @bug in the header section.

Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some minor comments in arguments.cpp and the testcase.

@iklam
Copy link
Member Author

iklam commented Nov 16, 2021

@tstuefe could you take a look?

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ioi,

I am not an AppCDS expert, but to me, this looks good.

Thanks, Thomas

@@ -336,7 +338,8 @@ void DynamicArchiveBuilder::write_archive(char* serialized_data) {
class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation {
DynamicArchiveBuilder builder;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, preexisting, but should members not be prefixed with _?

@openjdk
Copy link

openjdk bot commented Nov 16, 2021

@iklam 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:

8276787: Improve warning messages for -XX:+RecordDynamicDumpInfo

Reviewed-by: ccheung, stuefe

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 16, 2021
Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update looks good.

@iklam
Copy link
Member Author

iklam commented Nov 16, 2021

Thanks @calvinccheung and @tstuefe for the review.
/integrate

@openjdk
Copy link

openjdk bot commented Nov 16, 2021

Going to push as commit a77d8dd.
Since your change was applied there have been 3 commits pushed to the master branch:

  • 8ed384c: 8276609: Document setting property jdk.serialFilter to an invalid value throws ExceptionInInitializerError
  • cddc6ce: 8275811: Incorrect instance to dispose
  • b0a463f: 8169468: NoResizeEventOnDMChangeTest.java fails because FS Window didn't receive all resizes!

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 16, 2021
@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 16, 2021
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 16, 2021
@openjdk
Copy link

openjdk bot commented Nov 16, 2021

@iklam Pushed as commit a77d8dd.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
4 participants