eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.32k stars 727 forks source link

Assertion failure at omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0) with PROD_WITH_ASSUMES #17616

Open knn-k opened 1 year ago

knn-k commented 1 year ago

Assertion failure in running sanity.functional with Java 11/17 for AArch64 macOS/Linux with PROD_WITH_ASSUMES:

[2023-06-19T01:34:45.178Z] Assertion failed at /Users/jenkins/workspace/Build_JDK11_aarch64_mac_Personal/omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0)
[2023-06-19T01:34:45.178Z] VMState: 0x00050fff
[2023-06-19T01:34:45.178Z]  Block frequency must be non negative
[2023-06-19T01:34:45.178Z] 
[2023-06-19T01:34:45.178Z] compiling java/util/ServiceLoader.findStaticProviderMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method; at level: warm

macOS Java 11 build Linux Java 11 build macOS Java 17 build Linux Java 17 build

knn-k commented 1 year ago

This happens in the optimization phase as shown below:

_ZN2TR4trapEv+0x50 (0x0000FFFF92810870 [libj9jit29.so+0x4b0870])
_ZN2TR9assertionEPKciS1_S1_z+0x9c (0x0000FFFF92810A3C [libj9jit29.so+0x4b0a3c])
_ZN3OMR5Block16createEmptyBlockEPN2TR4NodeEPNS1_11CompilationEiPNS1_5BlockE+0x124 (0x0000FFFF927E0C54 [libj9jit29.so+0x480c54])
_ZN16TR_LoopVersioner18versionNaturalLoopEP18TR_RegionStructureP4ListIN2TR4NodeEEPS2_INS3_7TreeTopEES9_S9_S9_S9_S9_S9_S9_S6_PS2_I19TR_NodeParentSymRefEPS2_I30TR_NodeParentSymRefWeightTupleEPS2_I12TR_StructureESI_bRN3CS216ASparseBitVectorINSJ_16shared_allo+0x918 (0x0000FFFF9298BD68 [libj9jit29.so+0x62bd68])
_ZN16TR_LoopVersioner24performWithoutDominatorsEv+0xc24 (0x0000FFFF92990DF4 [libj9jit29.so+0x630df4])
_ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0x720 (0x0000FFFF929DC020 [libj9jit29.so+0x67c020])
_ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0x13fc (0x0000FFFF929DCCFC [libj9jit29.so+0x67ccfc])
_ZN3OMR9Optimizer8optimizeEv+0x220 (0x0000FFFF929DDD60 [libj9jit29.so+0x67dd60])
_ZN3OMR11Compilation7compileEv+0x56c (0x0000FFFF927B8A4C [libj9jit29.so+0x458a4c])
knn-k commented 1 year ago

Probably the same problem as #8594.

knn-k commented 1 year ago

Changing the TR_ASSERT() to a TR_ASSERT_FATAL_WITH_NODE() shows the following:

Assertion failed at /home/ubuntu/openj9/openj9-openjdk-jdk11/omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0)
VMState: 0x00050fff
        Node 0xffff9579b720 [ificmpne]: Block frequency must be non negative

compiling java/util/ServiceLoader.findStaticProviderMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method; at level: warm

Node context:

...
n1457n    ificmpne --> block_128 BBStart at n1688n (HCRGuard/NonoverriddenTest )              [    0xffff9579b720] bci=[9,0,597] rc=0 vc=774 vn=- li=- udi=- nc=2 flg=0x1020
n1458n      iload  unknown static[#541  Static] [flags 0x10303 0x0 ] (cannotOverflow )        [    0xffff9579b770] bci=[-1,139,640] rc=1 vc=774 vn=- li=- udi=- nc=0 flg=0x1000
n1459n      iconst 0 (X==0 X>=0 X<=0 )                                                        [    0xffff9579b7c0] bci=[-1,139,640] rc=1 vc=774 vn=- li=- udi=- nc=0 flg=0x302
...
knn-k commented 1 year ago

I tried to reproduce the assertion failure on x86 Linux (Link), but it did not fail.

knn-k commented 1 year ago

I reproduced the assertion failure on x86 Linux. See this link.

[2023-06-20T08:33:32.659Z]  [OUT] Assertion failed at /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0)
[2023-06-20T08:33:32.659Z]  [OUT] VMState: 0x00050fff
[2023-06-20T08:33:32.659Z]  [OUT]   Node 0x7f04d67c6680 [ificmpne]: Block frequency must be non negative
[2023-06-20T08:33:32.659Z]  [OUT] 
[2023-06-20T08:33:32.659Z]  [OUT] compiling java/util/ServiceLoader.findStaticProviderMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method; at level: warm

[2023-06-20T08:33:32.659Z]  [OUT] Node context:
[2023-06-20T08:33:32.659Z]  [OUT] 
[2023-06-20T08:33:32.659Z]  [OUT] ...
[2023-06-20T08:33:32.659Z]  [OUT] n1199n    ificmpne --> block_107 BBStart at n1353n (HCRGuard/NonoverriddenTest )              [0x7f04d67c6680] bci=[8,0,597] rc=0 vc=553 vn=- li=- udi=- nc=2 flg=0x1020
[2023-06-20T08:33:32.659Z]  [OUT] n1200n      iload  unknown static[#589  Static] [flags 0x10303 0x0 ] (cannotOverflow )        [0x7f04d67c66d0] bci=[-1,139,640] rc=1 vc=553 vn=- li=- udi=- nc=0 flg=0x1000
[2023-06-20T08:33:32.659Z]  [OUT] n1201n      iconst 0 (X==0 X>=0 X<=0 )                                                        [0x7f04d67c6720] bci=[-1,139,640] rc=1 vc=553 vn=- li=- udi=- nc=0 flg=0x302
[2023-06-20T08:33:32.659Z]  [OUT] ...
knn-k commented 1 year ago

I reproduced the assertion failure on x86 Linux again today. See this link.

[2023-07-24T10:02:17.957Z]  [OUT] Assertion failed at /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0)
[2023-07-24T10:02:17.957Z]  [OUT] VMState: 0x00050fff
[2023-07-24T10:02:17.957Z]  [OUT]   Node 0x7f6a581a56e0 [ificmpne]: Block frequency must be non negative
[2023-07-24T10:02:17.957Z]  [OUT] 
[2023-07-24T10:02:17.957Z]  [OUT] compiling java/util/ServiceLoader.findStaticProviderMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method; at level: warm

[2023-07-24T10:02:17.958Z]  [OUT] Node context:
[2023-07-24T10:02:17.958Z]  [OUT] 
[2023-07-24T10:02:17.958Z]  [OUT] ...
[2023-07-24T10:02:17.958Z]  [OUT] n1149n    ificmpne --> block_97 BBStart at n1382n (HCRGuard/NonoverriddenTest )               [0x7f6a581a56e0] bci=[5,0,597] rc=0 vc=527 vn=- li=- udi=- nc=2 flg=0x1020
[2023-07-24T10:02:17.958Z]  [OUT] n1150n      iload  unknown static[#574  Static] [flags 0x10303 0x0 ] (cannotOverflow )        [0x7f6a581a5730] bci=[-1,139,640] rc=1 vc=527 vn=- li=- udi=- nc=0 flg=0x1000
[2023-07-24T10:02:17.958Z]  [OUT] n1151n      iconst 0 (X==0 X>=0 X<=0 )                                                        [0x7f6a581a5780] bci=[-1,139,640] rc=1 vc=527 vn=- li=- udi=- nc=0 flg=0x302
[2023-07-24T10:02:17.958Z]  [OUT] ...
knn-k commented 1 year ago

This is still reproducible: https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk17_j9_sanity.functional_aarch64_linux_Personal_testList_0/343/consoleText

[2023-12-01T10:04:18.223Z]  [OUT] /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_aarch64_linux_Personal_testList_0/jdkbinary/j2sdk-image/bin/java -XX:+EnableCRIUSupport  -Xjit:count=0 -XX:+CRIURestoreNonPortableMode  -cp /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_aarch64_linux_Personal_testList_0/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu/criu.jar org.openj9.criu.CRIUSimpleTest 1 1
[2023-12-01T10:04:18.223Z]  [OUT] Total checkpoint(s) 1:
[2023-12-01T10:04:18.223Z]  [OUT] Pre-checkpoint
[2023-12-01T10:04:18.223Z]  [OUT] Assertion failed at /home/jenkins/workspace/Build_JDK17_aarch64_linux_Personal/omr/compiler/il/OMRBlock.cpp:280: (frequency >= 0)
[2023-12-01T10:04:18.223Z]  [OUT] VMState: 0x00050fff
[2023-12-01T10:04:18.223Z]  [OUT]   Block frequency must be non negative
[2023-12-01T10:04:18.223Z]  [OUT] 
[2023-12-01T10:04:18.223Z]  [OUT] compiling java/util/ServiceLoader.findStaticProviderMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method; at level: warm
hzongaro commented 10 months ago

Moving assertion failure issues to 0.45.