[aarch64-port-dev ] RFR: aarch64: Fix vm crash with CDS on
Andrew Haley
aph at redhat.com
Tue Jun 21 08:38:01 UTC 2016
On 21/06/16 07:51, Ningsheng Jian wrote:
> Hi,
>
> I found that the following hotspot jtreg test failures in aarch64
> openjdk9 are caused by the same issue:
>
> runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
> runtime/CDSCompressedKPtrs/XShareAuto.java
> runtime/CompressedOops/CompressedClassPointers.java
> runtime/NMT/NMTWithCDS.java
> runtime/SharedArchiveFile/CdsSameObjectAlignment.java
> runtime/SharedArchiveFile/SASymbolTableTest.java
> runtime/SharedArchiveFile/SharedArchiveFile.java
> runtime/SharedArchiveFile/SharedBaseAddress.java
> runtime/SharedArchiveFile/SharedStrings.java
> runtime/SharedArchiveFile/SharedStringsRunAuto.java
>
>
> It is caused by incorrectly patching un-patchable bytecodes in CDS
> image. Refer to [1] for details.
>
> The crash can be reproduced by a simple hello-world case:
>
> $ java -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=1.jsa
> -Xshare:dump Hello
> $ java -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=1.jsa
> -Xshare:on Hello
>
>
> The following patch can fix that crash and the jtreg tests above (and
> no new failure found):
>
> http://people.linaro.org/~ningsheng.jian/cds-fix/webrev.01/
>
>
> Could someone please help to review and process this patch?
I am concerned that your patch may be incomplete. The x86 and sparc
versions of this code use
@@ -2661,7 +2684,7 @@
__ load_signed_byte(rax, field);
__ push(btos);
// Rewrite bytecode to be faster
- if (!is_static) {
+ if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_bgetfield, bc, rbx);
}
__ jmp(Done);
But you use
@@ -2434,7 +2434,7 @@
__ ldrsb(r0, field);
__ push(ztos);
// Rewrite bytecode to be faster
- if (!is_static) {
+ if (rc == may_rewrite) {
// use btos rewriting, no truncating to t/f bit is needed for getfield.
patch_bytecode(Bytecodes::_fast_bgetfield, bc, r1);
}
The patch is at
http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/0b0b09a60061
Please make sure that AArch64 is not missing anything else.
Andrew.
More information about the aarch64-port-dev
mailing list