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

8276696: ParallelObjectIterator freed at the wrong time in VM_HeapDumper #6501

Closed
wants to merge 1 commit into from

Conversation

fisk
Copy link
Contributor

@fisk fisk commented Nov 22, 2021

The VM_HeapDumper code uses a C heap allocated ParallelObjectIterator. It is constructed right before running a parallel operation with a work gang, but freed in the destructor of the VM_HeapDumper. This means it is created on one thread and deleted on another thread. This becomes a bit problematic when a parallel object iterator implementation uses a ThreadsListHandle (which is indeed the case for ZGC). This patch changes ParallelObjectIterator to be a StackObj, carrying a ParallelObjectIteratorImpl object, which is never exposed publicly. This ensures that construction and destruction of the internal object iterator is scoped like RAII objects, hence complying with how ThreadsListHandle is supposed to be used.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8276696: ParallelObjectIterator freed at the wrong time in VM_HeapDumper

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6501/head:pull/6501
$ git checkout pull/6501

Update a local copy of the PR:
$ git checkout pull/6501
$ git pull https://git.openjdk.java.net/jdk pull/6501/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6501

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6501.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 22, 2021

👋 Welcome back eosterlund! 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 Nov 22, 2021
@openjdk
Copy link

openjdk bot commented Nov 22, 2021

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

  • hotspot
  • serviceability
  • shenandoah

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.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Nov 22, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 22, 2021

Webrevs

Copy link
Contributor

@pliden pliden 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.

@openjdk
Copy link

openjdk bot commented Nov 23, 2021

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

8276696: ParallelObjectIterator freed at the wrong time in VM_HeapDumper

Reviewed-by: pliden, stefank

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

  • 79350b9: 8276216: Negated character classes performance regression in Pattern
  • e3243ee: 8277087: ZipException: zip END header not found at ZipFile#Source.findEND
  • 12f08ba: 8277507: Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • bb11c55: 8277542: G1: Move G1CardSetFreePool and related classes to separate files
  • f62b81c: 8273095: vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java fails with "wrong OOME"
  • 05a9a51: 8277423: ciReplay: hidden class with comment expected error
  • 1049aba: 8277576: ProblemList runtime/ErrorHandling/CreateCoredumpOnCrash.java on macosx-X64
  • 851a362: 8264297: Create implementation for NSAccessibilityProgressIndicator protocol peer
  • 6cf4cd1: 8273341: Update Siphash to version 1.0
  • e3911a8: 8277429: Conflicting jpackage static library name
  • ... and 8 more: https://git.openjdk.java.net/jdk/compare/3f847fe89a088d6921107ca887a7a1bace871bd6...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 Nov 23, 2021
@fisk
Copy link
Contributor Author

fisk commented Nov 23, 2021

Thanks for the reviews, @pliden and @stefank!

@fisk
Copy link
Contributor Author

fisk commented Nov 23, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Nov 23, 2021

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

  • 90f96fb: 8277441: CompileQueue::add fails with assert(_last->next() == __null) failed: not last
  • 66eaf65: 8277413: Remove unused local variables in jdk.hotspot.agent
  • 36b887a: 8277560: Remove WorkerDataArray::_is_serial
  • 017df14: 8277556: Call ReferenceProcessorPhaseTimes::set_processing_is_mt once
  • 79350b9: 8276216: Negated character classes performance regression in Pattern
  • e3243ee: 8277087: ZipException: zip END header not found at ZipFile#Source.findEND
  • 12f08ba: 8277507: Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • bb11c55: 8277542: G1: Move G1CardSetFreePool and related classes to separate files
  • f62b81c: 8273095: vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java fails with "wrong OOME"
  • 05a9a51: 8277423: ciReplay: hidden class with comment expected error
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/3f847fe89a088d6921107ca887a7a1bace871bd6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 23, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 23, 2021
@openjdk
Copy link

openjdk bot commented Nov 23, 2021

@fisk Pushed as commit f4dc03e.

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

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 shenandoah shenandoah-dev@openjdk.org
3 participants