IBM Support

IJ06637: JAVA JIT: INCORRECTLY INLINING UNSAFE.MONITORENTER() AND UNSAFE.MONITOREXIT()

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: JIT Compile time crash when compiling a method
    that make calls to the Unsafe.monitorEnter or
    Unsafe.monitorExit() methods.
    .
    Stack Trace:
    {libj9jit29.so}{getMonitorClass__Q2_3OMR4NodeFP17TR_ResolvedMeth
    od}
    {libj9jit29.so}{lowerTreeIfNeeded__Q2_2J913CodeGeneratorFPQ2_2TR
    4NodeiT1PQ2_2TR7TreeTop}
    {libj9jit29.so}{lowerTreeIfNeeded__Q3_2J95Power13CodeGeneratorFP
    Q2_2TR4NodeiT1PQ2_2TR7TreeTop}
    {libj9jit29.so}{lowerTrees__Q2_3OMR13CodeGeneratorFv}
    {libj9jit29.so}{performLowerTreesPhase__Q2_3OMR12CodeGenPhaseFPQ
    2_2TR13CodeGeneratorPQ2_2TR12CodeGenPhase}
    {libj9jit29.so}{performAll__Q2_3OMR12CodeGenPhaseFv}
    {libj9jit29.so}{generateCode__Q2_3OMR13CodeGeneratorFv}
    {libj9jit29.so}{compile__Q2_3OMR11CompilationFv}
    ...
    .
    A compile time crash is very likely with this issue, but other
    symptoms are possible like an IllegalMonitorStateException or
    issues due to a failure to enforce synchronization. The state of
    the intermediate language after the problem occurred makes it
    very likely that the compiler will crash when analyzing the code
    later on in the compile.
    

Local fix

  • There are two options that will avoid the problem. You can use
    the one that offers the lest performance impact for your
    application:
    -Xjit:disableUnsafe
    -Xjit:disableDirectToJNIInline
    You can also apply these options to one method for even less
    performance impact.
    

Problem summary

  • The JIT expects an object pointer when locking/unlocking a
    object but the inlining of Unsafe.monitorEnter/Exit() (which
    converts the JNI call to a JIT internal monitorEnter/Exit
    opcode) would result in trying to lock/unlock a stack reference
    to an object. This results in a crash at compile time when
    future JIT passes are analyzing the inlined code.
    

Problem conclusion

  • The JIT was modified so that the inlining on
    Unsafe.monitorEnter/Exit() would properly setup the code so that
    it locks/unlocks a proper object reference.
    .
    This APAR will be fixed in the following Java Releases:
       8    SR5 FP16  (8.0.5.16)
    .
    Contact your IBM Product's Service Team for these Service
    Refreshes and Fix Packs.
    For those running stand-alone, information about the available
    Service Refreshes and Fix Packs can be found at:
               https://www.ibm.com/developerworks/java/jdk/
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ06637

  • Reported component name

    JIT

  • Reported component ID

    620700124

  • Reported release

    130

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-05-23

  • Closed date

    2018-05-23

  • Last modified date

    2018-05-23

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JIT

  • Fixed component ID

    620700124

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSC9HBA","label":"Just In Time (JIT) Compiler"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"130","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
23 May 2018