Skip to content
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

8314225: SIGSEGV in JavaThread::is_lock_owned #3177

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

GoeLin
Copy link
Member

@GoeLin GoeLin commented Dec 29, 2024

I backport this for parity with 17.0.15-oracle.

I had to resolve the larger part of this change.
None of my edits change the code essentially, though.

src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
Resolved because of NULL/nullptr difference

src/hotspot/share/runtime/javaThread.cpp|hpp
These files don't exist in 17, they were split off from thread.cpp|hpp.
The modiefied code looks very similar in 17, so I could easily identify
the changed code and apply the patches. Usual minor nullptr diffs etc.

src/hotspot/share/runtime/monitorChunk.cpp
Resolved because of NULL/nullptr difference

src/hotspot/share/runtime/monitorChunk.hpp
Resolved because of context diff.

src/hotspot/share/runtime/synchronizer.cpp
Resolved. Different checks in if condition.
One is for the new locking mode in head, the other whether the mask has a locker.
... check ...

src/hotspot/share/runtime/thread.cpp
Resolved because new locking modes added an assertion in removed function is_lock_owned.

src/hotspot/share/runtime/vframeArray.cpp
Resolved. Code differs because 21 has biased locking removed.

To make it build, I had to replace
Javathread::cast() by as_Java_thread() in synchronizer.cpp.

Also I removed is_linked() from monitorChunk.hpp.


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
  • JDK-8314225 needs maintainer approval

Issue

  • JDK-8314225: SIGSEGV in JavaThread::is_lock_owned (Bug - P2 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3177/head:pull/3177
$ git checkout pull/3177

Update a local copy of the PR:
$ git checkout pull/3177
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3177/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3177

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3177.diff

Using Webrev

Link to Webrev Comment

@GoeLin GoeLin changed the title Goetz backport 8314225 Backport ad0b54d429fdbd806c09aa06bb42f1ed4a0297e8 Dec 29, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 29, 2024

👋 Welcome back goetz! 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 Dec 29, 2024

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

8314225: SIGSEGV in JavaThread::is_lock_owned

Reviewed-by: rrich

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.

➡️ 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 Backport ad0b54d429fdbd806c09aa06bb42f1ed4a0297e8 8314225: SIGSEGV in JavaThread::is_lock_owned Dec 29, 2024
@openjdk
Copy link

openjdk bot commented Dec 29, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label Dec 29, 2024
@GoeLin GoeLin force-pushed the goetz_backport_8314225 branch from 375bb0c to c69d97a Compare January 3, 2025 09:57
@GoeLin GoeLin marked this pull request as ready for review January 3, 2025 11:59
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 3, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 3, 2025

Webrevs

Copy link
Member

@reinrich reinrich left a comment

Choose a reason for hiding this comment

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

Looks good besides one assertion message that could be improved.

@@ -95,9 +94,16 @@ void vframeArrayElement::fill_in(compiledVFrame* vf, bool realloc_failures) {
if (monitor->owner_is_scalar_replaced()) {
dest->set_obj(NULL);
} else {
assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
assert(monitor->owner() != nullptr, "monitor owner must not be null");
assert(!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern(), "object must be null or locked, and unbiased");
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
assert(!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern(), "object must be null or locked, and unbiased");
assert(!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern(), "object must be locked, and unbiased");

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching this, makes sense. Fixed.

@openjdk
Copy link

openjdk bot commented Jan 10, 2025

⚠️ @GoeLin This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants