-
Notifications
You must be signed in to change notification settings - Fork 28
8264640: CMS ParScanClosure misses a barrier #165
Conversation
|
👋 Welcome back akozlov! A progress list of the required criteria for merging this PR into |
|
Mailing list message from Anton Kozlov on jdk-updates-dev: Adding hotspot-gc-dev. It will be great to receive comments from GC experts, even the fix does not make sense for mainline jdk. Thanks, On 4/2/21 11:51 AM, Anton Kozlov wrote: |
|
Mailing list message from John Cuthbertson on jdk-updates-dev: Hi Anton, This looks good to me. I think I?m still a reviewer for the jdk-updates project. For the benefit of everyone else... We were seeing this as a crash when obtaining the size of an object to be copied. The klass was observed to be transiently NULL. We found that the object, reached through another reference path, had already been copied and the from-space oop placed on the task queue for subsequent reference field scanning. The task queue, however, had overflowed and the from-space oop was placed on the shared overflow queue where objects are chained together through their klass field. If the reads are ordered as they are in the code then everything is OK as per the comment at line 105 (in ParScanClosure::do_oop_work) but we found that gcc had reordered the reads in the non-compressed oops case. So the mark word is read and the object is observed to not forwarded (yet). Then, via another reference path, the object is copied, forwarded, and placed on the overflow task queue ? over writing the from-space object?s klass. Then in the original path the klass is read and observed to be NULL or the next overflow entry ? leading to the crash. When the from-space oop is dequeued, its klass is restored ? which is what was observed in the core file. Using worker thread local queues, -XX:+ParGCUseLocalOverflow, seems to workaround the problem. Thanks, John Cuthbertson
|
|
Mailing list message from Anton Kozlov on jdk-updates-dev: John, thank you for review and the comment! Thanks, On 4/8/21 9:33 PM, John Cuthbertson wrote:
|
|
/reviewer credit johnc |
|
@AntonKozlov |
yan-too
left a comment
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.
After John, it's easy to say lgtm!
|
@AntonKozlov This change now passes all automated pre-integration checks. 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 12 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@yan-too) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Yura, thanks! /integrate |
|
@AntonKozlov |
|
/sponsor |
|
@yan-too @AntonKozlov Since your change was applied there have been 12 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit efc81a3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi, please review an original fix for a GC crash. The jdk13u is the latest supported version that still has buggy code, it was deleted in jdk14 as a part of JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector. So I'm proposing it here.
The fix is low-risk, on x86-64 it just introduces a compiler barrier to prevent two reads to be reordered as intended by surrounding comments. On CPUs with weaker memory models it introduces CPU barriers as well.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk13u-dev pull/165/head:pull/165$ git checkout pull/165Update a local copy of the PR:
$ git checkout pull/165$ git pull https://git.openjdk.java.net/jdk13u-dev pull/165/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 165View PR using the GUI difftool:
$ git pr show -t 165Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk13u-dev/pull/165.diff