Skip to content

Commit

Permalink
8330464: hserr generic events - add entry for the before_exit calls
Browse files Browse the repository at this point in the history
Reviewed-by: rrich, lucy
  • Loading branch information
MBaesken committed Apr 24, 2024
1 parent e311ba3 commit 45ed97f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/hotspot/share/runtime/java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#include "runtime/vm_version.hpp"
#include "sanitizers/leak.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp"
Expand Down Expand Up @@ -366,6 +367,8 @@ void before_exit(JavaThread* thread, bool halt) {
#define BEFORE_EXIT_DONE 2
static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN;

Events::log(thread, "Before exit entered");

// Note: don't use a Mutex to guard the entire before_exit(), as
// JVMTI post_thread_end_event and post_vm_death_event will run native code.
// A CAS or OSMutex would work just fine but then we need to manipulate
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/runtime/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {

// Threads::destroy_vm() is normally called from jni_DestroyJavaVM() when
// the program falls off the end of main(). Another VM exit path is through
// vm_exit() when the program calls System.exit() to return a value or when
// there is a serious error in VM. The two shutdown paths are not exactly
// the same, but they share Shutdown.shutdown() at Java level and before_exit()
// and VM_Exit op at VM level.
// vm_exit(), when the program calls System.exit() to return a value, or when
// there is a serious error in VM.
// These two separate shutdown paths are not exactly the same, but they share
// Shutdown.shutdown() at Java level and before_exit() and VM_Exit op at VM level.
//
// Shutdown sequence:
// + Shutdown native memory tracking if it is on
Expand Down

7 comments on commit 45ed97f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk22u

@openjdk
Copy link

@openjdk openjdk bot commented on 45ed97f May 16, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-45ed97f1 in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u: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 45ed97f1 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 24 Apr 2024 and was reviewed by Richard Reingruber and Lutz Schmidt.

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/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-MBaesken-45ed97f1:backport-MBaesken-45ed97f1
$ git checkout backport-MBaesken-45ed97f1
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-MBaesken-45ed97f1

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 45ed97f May 21, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-45ed97f1 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev: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 45ed97f1 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 24 Apr 2024 and was reviewed by Richard Reingruber and Lutz Schmidt.

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/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-45ed97f1:backport-MBaesken-45ed97f1
$ git checkout backport-MBaesken-45ed97f1
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-45ed97f1

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 45ed97f Sep 2, 2024

Choose a reason for hiding this comment

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

@MBaesken Could not automatically backport 45ed97f1 to openjdk/jdk17u-dev due to conflicts in the following files:

  • src/hotspot/share/runtime/threads.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-MBaesken-45ed97f1-master

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 45ed97f15b96071e5d6b6d21e8f0129eda5aa447

# Backport the commit
$ git cherry-pick --no-commit 45ed97f15b96071e5d6b6d21e8f0129eda5aa447
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 45ed97f15b96071e5d6b6d21e8f0129eda5aa447'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport 45ed97f15b96071e5d6b6d21e8f0129eda5aa447.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 45ed97f1 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 24 Apr 2024 and was reviewed by Richard Reingruber and Lutz Schmidt.

Thanks!

Please sign in to comment.