# IV20144: INCORRECT OUTPUT FROM SYSTEM.ARRAYCOPY WHEN INLINED INTO AOT-COM PILED CODE

## 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.

## Error description

• Error Message: When a Java method that moves data within an
array using System.arraycopy is AOT-compiled, the
System.arraycopy call is inlined for performance reasons. If the
source and destination ranges overlap, the inlined code can be
incorrect and can produce incorrect content in the array. This
may lead to unexpected exceptions or crashes.
In many applications, this problem manifests itself as a
corrupted string after the string has undergone special
character escaping or Unicode character decoding.
For example, escaping the backslash in the string "foo\bar"
should result in the string "foo%5cbar", but this problem can
corrupt the string to "fooo5cbar". Another example is decoding
the string "foo\U0024bar", which should result in "foo$bar", however it can be corrupted into "ffo$bar" instead.
This problem affects z/OS and z/Linux.
.
Stack Trace:
.


## Local fix

• This problem can be avoided by disabling AOT compilations with
the -Xnoaot option. Alternatively, it can be avoided by using
the "gencon" GC policy, with the -Xgcpolicy:gencon option.


## Problem summary

• The problem is caused when the JIT compiler optimizes an
arraycopy of primitive arrays into a simple memory copy, but is
unable to determine the exact type of the arrays. In this
scenario, the System z code generator can emit instructions to
copy an incorrect number of array elements.


## Problem conclusion

• This defect will be fixed in:
6.0.0 SR12
6.0.1 SR3
7.0.0 SR2
.
The JIT compiler has been updated to prevent the improper
optimization of such arraycopy calls.


IV20144

JIT

620700124

600

CLOSED PER

NoPE

NoHIPER

NoSpecatt

2012-04-24

2012-05-05

2012-05-05

JIT

620700124

## Applicable component levels

UP

• ### R260 PSY

UP

(0 users)Average rating

## Document information

### More support for:

Runtimes for Java Technology
Just In Time (JIT) Compiler

6.0

IV20144

2012-05-05

## Translate my page

Machine Translation