Skip to content

Conversation

@jdksjolen
Copy link
Contributor

@jdksjolen jdksjolen commented Sep 9, 2025

Hi,

This is a REDO, as the previous attempt caused build failures when merged with latest master.
The only difference is that the copy ctr for the RBTRee had been integrated with a different PR, but it never should have been. I deleted the copy ctr.

Thanks.


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-8367249: [REDO] MemBaseline accesses VMT without using lock (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27170

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 9, 2025

👋 Welcome back jsjolen! 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 Sep 9, 2025

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

8367249: [REDO] MemBaseline accesses VMT without using lock

Reviewed-by: azafari, cnorrbin

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 changed the title 8367249 8367249: [REDO] MemBaseline accesses VMT without using lock Sep 9, 2025
@openjdk
Copy link

openjdk bot commented Sep 9, 2025

@jdksjolen 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 hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review labels Sep 9, 2025
Copy link
Contributor

@afshin-zafari afshin-zafari left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

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

@caspernorrbin caspernorrbin left a comment

Choose a reason for hiding this comment

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

Still good!

@mlbridge
Copy link

mlbridge bot commented Sep 9, 2025

Webrevs

@jdksjolen
Copy link
Contributor Author

It's really weird that the linux-x64-static tests fail.

@dholmes-ora
Copy link
Member

It's really weird that the linux-x64-static tests fail.

It just an infra issue:

Unable to download artifact(s): Artifact not found for name: bundles-jtreg-7.5.2+1

@jdksjolen
Copy link
Contributor Author

It's really weird that the linux-x64-static tests fail.

It just an infra issue:

Unable to download artifact(s): Artifact not found for name: bundles-jtreg-7.5.2+1

Last time I ran it, it actually did fail on a Whitebox NMT test related to exactly this change. The logs were gone, so I re-ran the test, and this time infra failed.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 15, 2025
@jdksjolen
Copy link
Contributor Author

@afshin-zafari , I fixed another couple of bugs. Now I've gone through all of the VMT::Instance matches with grep and there seems to be no more issues.

linux-x64-static is still reporting an entirely empty Virtual memory map in NMT :-). Who knows why.

@afshin-zafari
Copy link
Contributor

there seems to be no more issues.

The VMT::find_reserved_region(address p) (and the other methods that traversing the tree) also should be used within the NMT lock as well. Should we do them here in this PR or a separate one?

@jdksjolen
Copy link
Contributor Author

there seems to be no more issues.

The VMT::find_reserved_region(address p) (and the other methods that traversing the tree) also should be used within the NMT lock as well. Should we do them here in this PR or a separate one?

I think that it's only the find_reserved_region left. It seems that this never took the lock, presumably because we are already killing the VM when this is called. I don't know whether or not this should take the lock, as I suspect the reasoning is a bit subtle. It's best to do this one in a separate PR, because of that.

@jdksjolen
Copy link
Contributor Author

Hi @jianglizhou ,

There's a test failure that only appears in linux-x64-static tier1. I'm looking at running the tests under the static-jdk. So far, I've produced a static-jdk via make CONF=slow static-jdk-image. Do you happen to know how to execute the tier1 tests with such a JDK?

I've tried make JDK_UNDER_TEST=build/linux-x64-slowdebug/images/static-jdk/ test TEST=tier1 but it complains about JDK_UNDER_TEST not being a non-control variable.

@jdksjolen
Copy link
Contributor Author

Well, that was a very embarrassing bug :-). I had code in an assert which needed to run regardless if in a debug build or not. Why didn't all release builds fail? No clue.

@jianglizhou
Copy link
Contributor

Hi @jianglizhou ,

There's a test failure that only appears in linux-x64-static tier1. I'm looking at running the tests under the static-jdk. So far, I've produced a static-jdk via make CONF=slow static-jdk-image. Do you happen to know how to execute the tier1 tests with such a JDK?

I've tried make JDK_UNDER_TEST=build/linux-x64-slowdebug/images/static-jdk/ test TEST=tier1 but it complains about JDK_UNDER_TEST not being a non-control variable.

Hi @jdksjolen, to run jtreg tests on a static-jdk binary, you can set JDK_FOR_COMPILE=<static_jdk>, JDK_FOR_COMPILE=<regular-jdk-path> and extra-problem-lists options in jtreg command line. The GHA testing on static JDK setup those to run tier1 tests:

if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then

https://bugs.openjdk.org/browse/JDK-8303796?focusedId=14745789&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14745789 has a command line example for running tier1 tests on static-jdk.

To build a static JDK: make static-jdk-image.

Hope those are helpful.

@jianglizhou
Copy link
Contributor

I had code in an assert which needed to run regardless if in a debug build or not. Why didn't all release builds fail? No clue.

The GHA teir1 testing on static JDK is only enabled for release builds currently. We haven't setup testing on debug builds for static JDK due to resource limit in GHA build environment. @magicus and the build team have solution(s) to address the issue with https://bugs.openjdk.org/browse/JDK-8350450.

@afshin-zafari
Copy link
Contributor

The changes in VMATree::copy_into of this PR, are only seen if we test/check the allocation_sites after a baseline. As I checked the gTest/JTREG tests, none of them check the sites that is written out to the report. So, the code for copy_into is never run in release builds and no allocation_site will be stored in a baseline nor written out in the report. No test will check it to discover it.

@jdksjolen
Copy link
Contributor Author

Hi @jianglizhou ,
There's a test failure that only appears in linux-x64-static tier1. I'm looking at running the tests under the static-jdk. So far, I've produced a static-jdk via make CONF=slow static-jdk-image. Do you happen to know how to execute the tier1 tests with such a JDK?
I've tried make JDK_UNDER_TEST=build/linux-x64-slowdebug/images/static-jdk/ test TEST=tier1 but it complains about JDK_UNDER_TEST not being a non-control variable.

Hi @jdksjolen, to run jtreg tests on a static-jdk binary, you can set JDK_FOR_COMPILE=<static_jdk>, JDK_FOR_COMPILE=<regular-jdk-path> and extra-problem-lists options in jtreg command line. The GHA testing on static JDK setup those to run tier1 tests:

if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then

https://bugs.openjdk.org/browse/JDK-8303796?focusedId=14745789&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14745789 has a command line example for running tier1 tests on static-jdk.

To build a static JDK: make static-jdk-image.

Hope those are helpful.

Thank you for your help!

I did something akin to this, and it worked:

$ make CONF=linux-x64 static-jdk-image
$ make CONF=linux-x64 jdk-image
$ make CONF=linux-x64 JDK_FOR_COMPILE='/home/jsjolen/jdk/build/linux-x64/images/jdk/' JDK_UNDER_TEST=/home/jsjolen/jdk/build/linux-x64/images/static-jdk/ test TEST='jtreg:runtime/NMT/ThreadedVirtualAllocTestType.java'

This did reproduce the test failure on linux-x64-static :-).

The changes in VMATree::copy_into of this PR, are only seen if we test/check the allocation_sites after a baseline. As I checked the gTest/JTREG tests, none of them check the sites that is written out to the report. So, the code for copy_into is never run in release builds and no allocation_site will be stored in a baseline nor written out in the report. No test will check it to discover it.

The test ThreadedVirtualAllocTestType does run NMT under detailed mode and was tested in release for all platforms. This was the one that failed in linux-x64-static. The weird thing is that the test succeeded in all other release platforms, even though they should have had the same assert problem.

Copy link
Contributor

@afshin-zafari afshin-zafari left a comment

Choose a reason for hiding this comment

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

Good that you found the problem. Thanks.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 18, 2025
@jdksjolen
Copy link
Contributor Author

/integrate

Thanks!

@openjdk
Copy link

openjdk bot commented Sep 18, 2025

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

  • 5db1dfe: 8361950: Update to use jtreg 8
  • a49856b: 8367969: C2: compiler/vectorapi/TestVectorMathLib.java fails without UnlockDiagnosticVMOptions

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 18, 2025

@jdksjolen Pushed as commit feaa654.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants