RFR: 8255466: C2 crashes at ciObject::get_oop() const+0x0 [v2]

Vladimir Kozlov kvn at openjdk.java.net
Thu Oct 29 03:23:08 UTC 2020


> Graal testing hit this issue with product VM. Tom R. suggested that it could be the case of reflective unsafe static field access that would eventually be optimized away because the Class is null:
> `if (staticFieldBase != null) {
>   return Unsafe.getInt(staticFieldBase, Unsafe.staticFieldOffset(field));
> }`
> 
> I suggest to replace assert with runtime check. Note, `o` value is assigned to `_const_oop` so semantically new code is the same except additional runtime check.
> 
> I also noticed that const_oop is accessed without check for NULL in new Vector API code. I added check there too.
> 
> Passed tier1-3 testing.

Vladimir Kozlov has updated the pull request incrementally with one additional commit since the last revision:

  Added regression test provided by Tom

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/890/files
  - new: https://git.openjdk.java.net/jdk/pull/890/files/da8be529..0de93893

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=890&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=890&range=00-01

  Stats: 62 lines in 1 file changed: 62 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/890.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/890/head:pull/890

PR: https://git.openjdk.java.net/jdk/pull/890


More information about the hotspot-compiler-dev mailing list