Skip to content

Conversation

@zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Jan 15, 2025

Modules::get_numbered_property_as_sorted_string() returns strings created from os::strdup(), callers should free them after uses.


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-8347758: modules.cpp leaks string returned from get_numbered_property_as_sorted_string() (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23121

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 15, 2025

👋 Welcome back zgu! 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 Jan 15, 2025

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

8347758: modules.cpp leaks string returned from get_numbered_property_as_sorted_string()

Reviewed-by: dholmes, iklam, ccheung

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

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 rfr Pull request is ready for review label Jan 15, 2025
@openjdk
Copy link

openjdk bot commented Jan 15, 2025

@zhengyu123 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 Jan 15, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 15, 2025

@dholmes-ora
Copy link
Member

It seems odd that the main logic uses resource allocated storage but then uses os::strdup to return the value. If all the clients end up copying the result anyway we just get unnecessary copies made, that then have to be freed.

@TheShermanTanker
Copy link
Contributor

"property" in the title is misspelled, you have to fix it otherwise Skara won't let you commit this change

@zhengyu123 zhengyu123 changed the title 8347758: modules.cpp leaks string returned from get_numbered_propert_as_sorted_string() 8347758: modules.cpp leaks string returned from get_numbered_property_as_sorted_string() Jan 15, 2025
@zhengyu123
Copy link
Contributor Author

"property" in the title is misspelled, you have to fix it otherwise Skara won't let you commit this change

Fixed, Thanks!

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.

Hi Zhengyu,
Thanks for noticing this and fixing it. I've couple of comments.

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.

Thanks for the update.
I'm running some tiers testing and will report back once they are done, hopefully by tomorrow.

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

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Thanks for updating to remove the copying. A few minor nits to address.

}
}

const char* Modules::get_numbered_property_as_sorted_string(const char* property) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const char* Modules::get_numbered_property_as_sorted_string(const char* property) {
// Caller needs ResourceMark
const char* Modules::get_numbered_property_as_sorted_string(const char* property) {

@calvinccheung
Copy link
Member

Tiers 1 - 4 test results look good.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 16, 2025
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Thanks for the updates.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 20, 2025
@zhengyu123
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 20, 2025

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

  • 3a4d5ff: 8347996: JavaCompilation.gmk should not include ZipArchive.gmk
  • 0fbf10a: 8348038: Docs build failing in Options.notifyListeners with AssertionError
  • 9346984: 8347916: Simplify javax.swing.text.html.CSS.LengthUnit.getValue
  • 3c92392: 8348089: Serial: Remove virtual specifier in SerialHeap
  • 8a83dc2: 8347018: C2: Insertion of Assertion Predicates ignores the effects of PhaseIdealLoop::clone_up_backedge_goo()
  • 85fdd2c: 8347434: Richer VM operations events logging
  • c207cc7: 8347923: Parallel: Simplify compute_survivor_space_size_and_threshold
  • 4b4b1e9: 8347922: Remove runtime/cds/appcds/customLoader/HelloCustom_JFR.java from ProblemList.txt
  • e7a1c86: 8217914: java/net/httpclient/ConnectTimeoutHandshakeSync.java failed on connection refused while doing POST
  • 644d154: 8347474: Options singleton is used before options are parsed
  • ... and 73 more: https://git.openjdk.org/jdk/compare/a49f8332edc7da2a9494cd0dc96e5aa7271d9883...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 20, 2025

@zhengyu123 Pushed as commit ca863fd.

💡 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

Development

Successfully merging this pull request may close these issues.

5 participants