Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8198531

C2: Wrong type of return value of Unsafe.getAndSetObject() call

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 8u161, 9, 10, 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:

      Description

      Sometimes C2 eliminates non-null branch in the following code as if it proved that ThreadCont.getAndSet() can't return non-null:

          val cont = ThreadCont.getAndSet(threads[i], null)
          if (cont != null) { /* do something */ }

      Detailed problem description & reproducer (by Roman Elizarov):
        https://github.com/ktorio/ktor/blob/resumeAnyThread_HotSpotBug/BUG_README_FIRST.md

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vlivanov Vladimir Ivanov
                Reporter:
                vlivanov Vladimir Ivanov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: