[aarch64-port-dev ] jdk8: random null pointer exceptions from javac

Edward Nevill edward.nevill at gmail.com
Wed Nov 4 17:18:25 UTC 2015


Hi,

For some time I have been observing random, infrequent null pointer exceptions in javac. These were not repeatable but seemed to happen about once every 10 builds of OpenJDK.

I think I have found the cause. Backing out the the following changeset causes the problem to go away.

changeset:   8153:394a87600c41
user:        enevill
date:        Fri Apr 24 11:01:37 2015 +0000
files:       src/cpu/aarch64/vm/aarch64.ad src/cpu/aarch64/vm/frame_aarch64.inline.hpp
description:
8075930: AARCH64: Use FP Register in C2
Summary: modify to allow C2 to allocate FP (R29) as a general register
Reviewed-by: aph, kvn, dlong

Now this change allows C2 to allocate FP for integer only registers. It is not supposed to allow C2 to allocate FP for pointers because FP is not included in the register class no_special_ptr_reg.

However I observe the following output from C2.

  0x000003ff71023b6c: bl        0x000003ff700b23c0  ; OopMap{rfp=NarrowOop [0]=Oop [8]=Oop [16]=Oop [24]=Oop [32]=Oop off=432}
                                                ;*invokevirtual accept

So iRegINoSp() in aarch64.ad is

// Integer 32 bit Register not Special
operand iRegINoSp()
%{
  constraint(ALLOC_IN_RC(no_special_reg32));
  match(RegI);
  op_cost(0);
  format %{ %}
  interface(REG_INTER);
%}

Where no_special_reg32 is just a general integer register (which includes FP).

Now I have zero confidence that the GC stack walking code correctly unwinds FP and finds the NarrowOop therein.

I have created a patch which creates a new register class no_special_ptrN_reg which excludes FP and used that in iRegINoSp instead.

Patch at

http://people.linaro.org/~edward.nevill/patches/narrowptr.patch

I have since done 100 builds of OpenJDK without a failure.

Is this the correct fix? Or should we try to do the stack unwinding code correctly so it finds ptrs in FP?

Regards,
Ed.




More information about the aarch64-port-dev mailing list