-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8257140: Crash in JvmtiTagMap::flush_object_free_events() #1539
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
Test passed tier1-3 with no failures. |
Webrevs
|
Tier5 and Tier6 have more JPDA testing (JVM/TI, JDWP, JDI, ...) |
tier 4,5,6 pass with no failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Coleen,
The JVMTI environment can be disposed with DisposeEnvironment:
https://docs.oracle.com/en/java/javase/15/docs/specs/jvmti.html#DisposeEnvironment
It seems to me that this operation is better to wait until posting is finished. Otherwise, the information is going to be lost in the report. Of course, we could blame the agent to call the DisposeEnvironment too early but then the agent needs a way to check if posting is finished.
Thanks,
Serguei
Mailing list message from Coleen Phillimore on hotspot-dev: On 12/1/20 7:12 PM, Serguei Spitsyn wrote:
When the event is disposed, it calls set_event_callbacks(), which calls Coleen |
Mailing list message from Coleen Phillimore on hotspot-dev: Including serviceability-dev. On 12/1/20 9:03 PM, Coleen Phillimore wrote:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reasonable. Thank you for the explanation!
The fix looks good to me.
When the event is disposed, it calls set_event_callbacks()...
You, probably meant "environment" is disposed, not "event".
This correction is for other readers. :)
@coleenp 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:
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 26 new commits pushed to the
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 |
Thanks Serguei and Kim for the reviews. |
@coleenp Since your change was applied there have been 26 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 2508bc7. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The JvmtiTagMap can be deleted while it is posting. The JvmtiEnv is still on the list but the env is "disposed" of and the tag_map is deleted to save memory until the JvmtiEnv can be reclaimed at a safepoint and taken off the list.
There's a check JvmtiEnvBase::check_for_periodic_clean_up() that determines whether the JvmtiEnv can be taken off the list and that check looks for whether threads are in the middle of JvmtiEnvIterator which sets Thread::jvmti_env_iteration_count. So this part is safe for the JvmtiTagMap changes.
The fix is to clear the JvmtiTagMapTable of the entries inside the table lock to save memory but leave JvmtiTagMap intact so that we can load a valid pointer when iterating through JvmtiEnvIterator. We could also not do this at all and let the JvmtiTagMap destructor delete the table when the JvmtiEnv is also deleted, but we don't know what customer situation led to this code in the first place.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1539/head:pull/1539
$ git checkout pull/1539