Skip to content

8309663: test fails "assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe" #14460

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

Closed
wants to merge 1 commit into from

Conversation

alexmenkov
Copy link

@alexmenkov alexmenkov commented Jun 14, 2023

If virtual thread has frames in stackChunks, need to apply load barriers before processing nmethods (javaVFrame::locals() and javaVFrame::expressions() do it internally)

Testing: tier1-tier5;
400 runs of VThreadStackRefTest.java test on linux-x64 and linux-x64-debug with "-XX:+UseZGC -Xcomp -XX:-TieredCompilation"


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-8309663: test fails "assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe" (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14460

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

Using diff file

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

Webrev

Link to Webrev Comment

@alexmenkov
Copy link
Author

/label add gc

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 14, 2023

👋 Welcome back amenkov! 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 openjdk bot added the rfr Pull request is ready for review label Jun 14, 2023
@alexmenkov
Copy link
Author

/label add hotspot-gc

@openjdk
Copy link

openjdk bot commented Jun 14, 2023

@alexmenkov
The label gc is not a valid label.
These labels are valid:

  • graal
  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Jun 14, 2023
@openjdk
Copy link

openjdk bot commented Jun 14, 2023

@alexmenkov
The hotspot-gc label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Jun 14, 2023

Webrevs

@alexmenkov
Copy link
Author

/label add serviceability

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Jun 14, 2023
@openjdk
Copy link

openjdk bot commented Jun 14, 2023

@alexmenkov
The serviceability label was successfully added.

@alexmenkov
Copy link
Author

added serviceability as it was not added automatically

jvf->cb()->as_nmethod()->oops_do(_blk);
// Need to apply load barriers for unmounted vthreads.
nmethod* nm = jvf->cb()->as_nmethod();
nm->run_nmethod_entry_barrier();
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good in general.
However, I'm looking at the stackChunkOopDesc::do_barriers0() implementation and wonder if a similar trick is needed for interpreter frames (to support Class Redefinition):

template <stackChunkOopDesc::BarrierType barrier, ChunkFrames frame_kind, typename RegisterMapT>
void stackChunkOopDesc::do_barriers0(const StackChunkFrameStream<frame_kind>& f, const RegisterMapT* map) {
  // We need to invoke the write barriers so as not to miss oops in old chunks that haven't yet been concurrently scanned
  assert (!f.is_done(), "");

  if (f.is_interpreted()) {
    Method* m = f.to_frame().interpreter_frame_method();
    // Class redefinition support
    m->record_gc_epoch();
  } else if (f.is_compiled()) {
    nmethod* nm = f.cb()->as_nmethod();
    // The entry barrier takes care of having the right synchronization
    // when keeping the nmethod alive during concurrent execution.
    nm->run_nmethod_entry_barrier();
    // There is no need to mark the Method, as class redefinition will walk the
    // CodeCache, noting their Methods
  }
  . . .

Copy link
Author

Choose a reason for hiding this comment

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

This looks good in general. However, I'm looking at the stackChunkOopDesc::do_barriers0() implementation and wonder if a similar trick is needed for interpreter frames (to support Class Redefinition):

This code collects references from thread stack, I don't see how class redefinition can affect them

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. I agree with it.
The stackChunkOopDesc implementation needs it as it does some stack chunk updates.

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.

Looks good.
Thanks,
Serguei

@openjdk
Copy link

openjdk bot commented Jun 16, 2023

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

8309663: test fails "assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe"

Reviewed-by: sspitsyn, eosterlund

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 598 new commits pushed to the master branch:

  • 61c58fd: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match
  • 5d23295: 8313251: Add NativeLibraryLoad event
  • c4b8574: 8311938: Add default cups include location for configure on AIX
  • 10a2605: 8294979: test/jdk/tools/jlink 3 test classes use ASM library
  • e8c325d: 8313394: Array Elements in OldObjectSample event has the incorrect description
  • d60352e: 8311006: missing @SInCE info in jdk.xml.dom
  • 4577147: 8313712: [BACKOUT] 8313632: ciEnv::dump_replay_data use fclose
  • bb3aac6: 8301606: JFileChooser file chooser details view "size" label cut off in Metal Look&Feel
  • 0f2fce7: 8313632: ciEnv::dump_replay_data use fclose
  • ab1c212: 8312909: C1 should not inline through interface calls with non-subtype receiver
  • ... and 588 more: https://git.openjdk.org/jdk/compare/45414fc2dfa41cbbfc6de7fec15eb47f41cf8986...master

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 added the ready Pull request is ready to be integrated label Jun 16, 2023
@alexmenkov
Copy link
Author

Ping. need one more reviewer

@alexmenkov
Copy link
Author

Ping. Need one more reviewer.

Copy link
Contributor

@fisk fisk 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. It isn't obvious that we need to follow nmethod oops that are not reachable through the current JVM state, but if we do, that's a good fix.

@alexmenkov
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 7, 2023

Going to push as commit 83edffa.
Since your change was applied there have been 621 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 Aug 7, 2023
@openjdk openjdk bot closed this Aug 7, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 7, 2023
@openjdk
Copy link

openjdk bot commented Aug 7, 2023

@alexmenkov Pushed as commit 83edffa.

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

@alexmenkov alexmenkov deleted the follow_ref_barriers branch August 7, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants