IBM Support

IV81926: FINAL FIELD OF STRING CREATED BY A STRINGBUILDER APPEARS INCORRE CTLY INITIALIZED ON A WEAK MEMORY PLATFORM

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: The user is most likely to report this issue as a
    NullPointerException or SIGSEGV reading a final instance field
    from a String object where that String object was created by a
    StringBuilder (either explicitly or via using the Java +
    notation). There is no reasonable expectation of the null field
    being null.
    .
    Stack Trace: N/A
    .
    The problem does not occur with -Xint and the problem only
    occurs on hardware with a weak memory ordering model - namely
    POWER hardware.
    

Local fix

  • The problem can be worked around by specifying
    -Xjit:disableStringPeepholes either globally or on the affected
    method(s). This workaround is likely to reduce performance by
    about 1-2% in a typical web server scenario.
    

Problem summary

  • The JIT optimizer recognizes a number of common patterns for
    StringBuilders and transforms them to use special String
    constructors for increased performance. In doing this the JIT
    added calls to various String.<init> methods without a
    subsequent allocation fence. This means that the final field
    values written by the init method are not guaranteed to be
    visible to all threads once the constructor has finished leading
    to incorrect values possibly being seen.
    

Problem conclusion

  • The JIT optimizer has been enhanced to generate the necessary
    allocation fences where required to ensure final field values
    can be read reliably after the StringBuilder optimizations
    performed by the JIT.
    .
    This APAR will be fixed in the following Java Releases:
       7 R1 SR3 FP40  (7.1.3.40)
       6    SR16 FP25 (6.0.16.25)
       7    SR9 FP40  (7.0.9.40)
       6 R1 SR8 FP25  (6.1.8.25)
       8    SR3       (8.0.3.0)
    .
    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

    IV81926

  • Reported component name

    JIT

  • Reported component ID

    620700124

  • Reported release

    130

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-02-26

  • Closed date

    2016-02-26

  • Last modified date

    2016-02-29

  • 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

  • R130 PSY

       UP

  • R600 PSY

       UP

  • R260 PSY

       UP

[{"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:
29 February 2016