RFR: 8303279: C2 Compiler crash (triggered by Kotlin 1.8.10)
Vladimir Ivanov
vlivanov at openjdk.org
Tue Jun 27 20:31:05 UTC 2023
On Tue, 27 Jun 2023 14:40:49 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The crash occurs because at split if during IGVN, a `SubTypeCheck` is
> created with null as input. That happens because the control path the
> `SubTypeCheck` is cloned for is dead. To fix that I propose delaying
> split if until dead paths are collapsed.
>
> I added an assert to check a nullable first input to `SubTypeCheck`
> nodes (which should be impossible because it should be null
> checked). When I ran testing, a number of cases showed up with known
> non null values non properly marked as non null. I fixed them.
Proposed fix looks good.
The testing revealed a failure in the newly introduced assertion (attached logs to the bug).
Also, the bug summary is way too generic and lacks any details about the actual problem. Please, update it.
src/hotspot/share/opto/ifnode.cpp line 95:
> 93: uint i4;
> 94: RegionNode* phi_region = phi->region();
> 95: for(i4 = 1; i4 < phi->req(); i4++ ) {
Missing space: `for (i4`.
src/hotspot/share/opto/subtypenode.cpp line 37:
> 35: const Type* SubTypeCheckNode::sub(const Type* sub_t, const Type* super_t) const {
> 36: const TypeKlassPtr* superk = super_t->isa_klassptr();
> 37: assert(sub_t != Type::TOP && !TypePtr::NULL_PTR->higher_equal(sub_t), "should be not null");
There's a failure observed during testing. I attached logs to the bug.
test/hotspot/jtreg/compiler/splitif/TestCrashAtIGVNSplitIfSubType.java line 28:
> 26: * @bug 8303279
> 27: * @summary C2 Compiler crash (triggered by Kotlin 1.8.10)
> 28: * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+PrintCompilation -XX:CompileOnly=TestCrashAtIGVNSplitIfSubType::test -XX:CompileCommand=quiet -XX:+StressIGVN -XX:StressSeed=598200189 TestCrashAtIGVNSplitIfSubType
Missing flag: `-XX:+StressIGVN` requires `-XX:+UnlockDiagnosticVMOptions`.
-------------
PR Review: https://git.openjdk.org/jdk/pull/14678#pullrequestreview-1501774702
PR Review Comment: https://git.openjdk.org/jdk/pull/14678#discussion_r1244299611
PR Review Comment: https://git.openjdk.org/jdk/pull/14678#discussion_r1244307870
PR Review Comment: https://git.openjdk.org/jdk/pull/14678#discussion_r1244307228
More information about the hotspot-compiler-dev
mailing list