Skip to content

8307315: Missing ResourceMark in CDS and JVMTI code #13992

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

Closed

Conversation

calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented May 15, 2023

Please review this simple fix for adding a missing ResourceMark in KlassFactory::check_shared_class_file_load_hook which is a common caller of FileMapInfo::open_stream_for_jvmti and JvmtiClassFileLoadHookPoster::post_to_env (indirectly via JvmtiExport::post_class_file_load_hook).

Passed tiers 1 - 3 testing.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8307315: Missing ResourceMark in CDS and JVMTI code

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13992/head:pull/13992
$ git checkout pull/13992

Update a local copy of the PR:
$ git checkout pull/13992
$ git pull https://git.openjdk.org/jdk.git pull/13992/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13992

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13992.diff

Webrev

Link to Webrev Comment

@calvinccheung calvinccheung marked this pull request as ready for review May 15, 2023 15:53
@bridgekeeper
Copy link

bridgekeeper bot commented May 15, 2023

👋 Welcome back ccheung! 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 openjdk bot added the rfr Pull request is ready for review label May 15, 2023
@openjdk
Copy link

openjdk bot commented May 15, 2023

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label May 15, 2023
@mlbridge
Copy link

mlbridge bot commented May 15, 2023

Webrevs

Copy link
Contributor

@coleenp coleenp 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.

@openjdk
Copy link

openjdk bot commented May 15, 2023

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

8307315: Missing ResourceMark in CDS and JVMTI code

Reviewed-by: coleenp, iklam

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 29 new commits pushed to the master branch:

  • 05b51c7: 8307567: Avoid relocating global roots to metaspaceObjs in CDS dump
  • 3168372: 8306597: Improve string formatting in EquivMapsGenerator.java
  • 7b0b9b5: 8308049: Refactor nested class declarations in FdLibm.java
  • cc80ada: 8306593: Fix nsk/jdi/stop/stop001 for virtual threads and remove from problem list
  • 43c8c65: 8307555: Reduce memory reads in x86 MD5 intrinsic
  • 01892f9: 8304913: Use OperatingSystem, Architecture, and Version in jlink
  • 0f7b1c5: 8299340: CreateProcessW lpCommandLine must be mutable
  • 57e7a3f: 8307959: Remove explicit type casts from SerializeClosure::do_xxx() calls
  • 97b2ca3: 8307997: gtest:ZIndexDistributorTest fails on PPC64
  • ffab1ea: 8308086: GHA: x86_32 host configuration failing with unmet dependencies
  • ... and 19 more: https://git.openjdk.org/jdk/compare/6ebea8973feb08a7443d8d86ff52f453dc4aec43...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 15, 2023
Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM. Just a nit about the comment.

@@ -54,6 +54,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
assert(ik != nullptr, "sanity");
assert(ik->is_shared(), "expecting a shared class");
if (JvmtiExport::should_post_class_file_load_hook()) {
// Caller needs a ResourceMark because parts of the returned cfs are resource-allocated.
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 this comment should be placed in filemap.hpp above the declaration of FileMapInfo::open_stream_for_jvmti(). We use the same convention for other functions that needs the caller to create the ResourceMark.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@calvinccheung
Copy link
Member Author

Thanks @coleenp and @iklam for the review.
/integrate

@openjdk
Copy link

openjdk bot commented May 16, 2023

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

  • 23cbb2d: 8306860: Avoid unnecessary allocation in List.map() when list is empty
  • be54b54: 8307369: Add execution of all svc tests in CI
  • 19c8c30: 8305634: Renaming predicates, simple cleanups, and adding summary about current predicates
  • 72294c5: 8308024: HttpClient (HTTP/1.1) sends an extraneous empty chunk if the BodyPublisher supplies an empty buffer
  • c9b6bb5: 8308041: [JVMCI] WB_IsGCSupportedByJVMCICompiler must enter correct JVMCI env
  • 0790f70: 8306806: JMX agent with JDP enabled won't start when PerfData is disabled
  • c2ef302: 8307968: serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java timed out
  • d22bcc8: 8307403: java/util/zip/DeInflate.java timed out
  • 2210e06: 8306638: Open source some AWT tests related to datatransfer and Toolkit
  • 05b51c7: 8307567: Avoid relocating global roots to metaspaceObjs in CDS dump
  • ... and 28 more: https://git.openjdk.org/jdk/compare/6ebea8973feb08a7443d8d86ff52f453dc4aec43...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 16, 2023

@calvinccheung Pushed as commit 8686a36.

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

@calvinccheung calvinccheung deleted the 8307315-missing-ResourceMark branch May 16, 2023 14:48
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
Development

Successfully merging this pull request may close these issues.

3 participants