Skip to content

Conversation

@fandreuz
Copy link
Contributor

@fandreuz fandreuz commented Oct 13, 2025

In this PR I add a check to prevent debug builds to crash when an agent tries to attach while the JVM is not in live phase.

Passes tier1 and tier2 (fastdebug).


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-8359472: JVM crashes when attaching a dynamic agent before JVMTI_PHASE_LIVE (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27766

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 13, 2025

👋 Welcome back fandreuzzi! 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 Oct 13, 2025

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

8359472: JVM crashes when attaching a dynamic agent before JVMTI_PHASE_LIVE

Reviewed-by: lmesnik, sspitsyn, amenkov

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 13 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @lmesnik, @alexmenkov, @sspitsyn) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Oct 13, 2025
@openjdk
Copy link

openjdk bot commented Oct 13, 2025

@fandreuz The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@fandreuz fandreuz marked this pull request as ready for review October 14, 2025 08:07
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 14, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 14, 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.

Generally looks good. Not 100% sure on the test structure but serviceability folk can chime in there if needed.

Suggestion:

diff --git a/src/jdk.jcmd/share/man/jcmd.md b/src/jdk.jcmd/share/man/jcmd.md
index 4e67e7a4502..69784050984 100644
--- a/src/jdk.jcmd/share/man/jcmd.md
+++ b/src/jdk.jcmd/share/man/jcmd.md
@@ -551,7 +551,7 @@ ## Commands for jcmd
     events, use `JFR.view all-events`.
 
 `JVMTI.agent_load` \[*arguments*\]
-:   Loads JVMTI native agent.
+:   Loads JVMTI native agent. (Live phase only)
 
     Impact: Low

fandreuz and others added 5 commits October 16, 2025 11:24
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
@sspitsyn
Copy link
Contributor

sspitsyn commented Oct 16, 2025

The approach looks okay to me. Thank you for taking care about this issue!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 21, 2025
Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

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

The fix is good. I've posted a couple of nits though.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 22, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 22, 2025
@fandreuz
Copy link
Contributor Author

Thanks for the review @sspitsyn, @sspitsyn, @alexmenkov and @dholmes-ora.

@sspitsyn
Copy link
Contributor

/sponsor

@fandreuz
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 22, 2025

@sspitsyn The change author (@fandreuz) must issue an integrate command before the integration can be sponsored.

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 22, 2025
@openjdk
Copy link

openjdk bot commented Oct 22, 2025

@fandreuz
Your change (at version 1dafec3) is now ready to be sponsored by a Committer.

@sspitsyn
Copy link
Contributor

Thank you for the updates!

@sspitsyn
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 22, 2025

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 22, 2025

@sspitsyn @fandreuz Pushed as commit 2a8cbd9.

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

@fandreuz
Copy link
Contributor Author

/backport jdk25u

@openjdk
Copy link

openjdk bot commented Oct 27, 2025

@fandreuz the backport was successfully created on the branch backport-fandreuz-2a8cbd94-master in my personal fork of openjdk/jdk25u. To create a pull request with this backport targeting openjdk/jdk25u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 2a8cbd94 from the openjdk/jdk repository.

The commit being backported was authored by Francesco Andreuzzi on 22 Oct 2025 and was reviewed by Leonid Mesnik, Serguei Spitsyn and Alex Menkov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk25u:

$ git fetch https://github.com/openjdk-bots/jdk25u.git backport-fandreuz-2a8cbd94-master:backport-fandreuz-2a8cbd94-master
$ git checkout backport-fandreuz-2a8cbd94-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk25u.git backport-fandreuz-2a8cbd94-master

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 serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

6 participants