JDK-8198531 : C2: Wrong type of return value of Unsafe.getAndSetObject() call
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u161,9,10,11
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2018-02-21
  • Updated: 2018-02-22
  • Resolved: 2018-02-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Resolved
Related Reports
Duplicate :  
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
Comments
This is a duplicate of JDK-8198543.
22-02-2018

ILW = Incorrect execution of compiled code, reproducible with regression test provided by customer, modify Java source code (see report) or exclude method from compilation = HMM = P2
22-02-2018

Most likely, 9, 10, and 11 are also affected, though Roman was able to reproduce the probelm only with 8u161.
21-02-2018