Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure at omr/compiler/il/OMRNode.cpp:6686: self()->canChkNodeCreatedByPRE() when PROD_WITH_ASSUMES is enabled #17446

Closed
dylanjtuttle opened this issue May 23, 2023 · 9 comments
Assignees
Labels

Comments

@dylanjtuttle
Copy link
Contributor

The assertion at

/home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/omr/compiler/il/OMRNode.cpp:6686: self()->canChkNodeCreatedByPRE()

fires when building OpenJDK 11 on x86-64_linux with the -DPROD_WITH_ASSUMES flag enabled in openj9/runtime/compiler/CMakeLists.txt.

Note that this assertion fires during the build process and not while running tests like the other failures under PROD_WITH_ASSUMES as discovered last year.

This assertion only fired after commenting out the assertion that fired during the previous build.

Link to the Jenkins build.

Stack trace:

16:18:08  Compiling 4 files for BUILD_JIGSAW_TOOLS
16:18:10  Assertion failed at /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/omr/compiler/il/OMRNode.cpp:6686: self()->canChkNodeCreatedByPRE()
16:18:10  VMState: 0x00050fff
16:18:10  	Unexpected opcode icalli in isNodeCreatedByPRE()
16:18:10  compiling java/lang/invoke/MethodType.hashCode()I at level: warm
16:18:10  #0: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x99c295) [0x2b05fed2d295]
16:18:10  #1: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x9a99e0) [0x2b05fed3a9e0]
16:18:10  #2: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x6262ee) [0x2b05fe9b72ee]
16:18:10  #3: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x626653) [0x2b05fe9b7653]
16:18:10  #4: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x61a028) [0x2b05fe9ab028]
16:18:10  #5: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c0f02) [0x2b05feb51f02]
16:18:10  #6: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c067e) [0x2b05feb5167e]
16:18:10  #7: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c15fa) [0x2b05feb525fa]
16:18:10  #8: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7ca2b5) [0x2b05feb5b2b5]
16:18:10  #9: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x8149b8) [0x2b05feba59b8]
16:18:10  #10: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x814d0a) [0x2b05feba5d0a]
16:18:10  #11: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x8163d3) [0x2b05feba73d3]
16:18:10  #12: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x5d62ed) [0x2b05fe9672ed]
16:18:10  #13: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x1555e2) [0x2b05fe4e65e2]
16:18:10  #14: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x156839) [0x2b05fe4e7839]
16:18:10  #15: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9prt29.so(+0x2b8b3) [0x2b05fd4698b3]
16:18:10  #16: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x153b96) [0x2b05fe4e4b96]
16:18:10  #17: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x154203) [0x2b05fe4e5203]
16:18:10  #18: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x152c2c) [0x2b05fe4e3c2c]
16:18:10  #19: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x1531d8) [0x2b05fe4e41d8]
16:18:10  #20: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x153272) [0x2b05fe4e4272]
16:18:10  #21: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9prt29.so(+0x2b8b3) [0x2b05fd4698b3]
16:18:10  #22: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x15369f) [0x2b05fe4e469f]
16:18:10  #23: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9thr29.so(+0xe4f6) [0x2b05fd6dc4f6]
16:18:10  #24: /lib64/libpthread.so.0(+0x7aa1) [0x2b05fb571aa1]
16:18:10  #25: /lib64/libc.so.6(clone+0x6d) [0x2b05fbc84c4d]
16:18:10  
16:18:10  JIT: crashed while compiling java/lang/invoke/MethodType.hashCode()I (recoverable 0)
16:18:10  #0: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x99c295) [0x2b05fed2d295]
16:18:10  #1: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x9a99e0) [0x2b05fed3a9e0]
16:18:10  #2: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x13e8c1) [0x2b05fe4cf8c1]
16:18:10  #3: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9prt29.so(+0x2ad7a) [0x2b05fd468d7a]
16:18:10  #4: /lib64/libpthread.so.0(+0xf7e0) [0x2b05fb5797e0]
16:18:10  #5: /lib64/libpthread.so.0(raise+0x2b) [0x2b05fb5796ab]
16:18:10  #6: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x626427) [0x2b05fe9b7427]
16:18:10  #7: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x626658) [0x2b05fe9b7658]
16:18:10  #8: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x61a028) [0x2b05fe9ab028]
16:18:10  #9: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c0f02) [0x2b05feb51f02]
16:18:10  #10: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c067e) [0x2b05feb5167e]
16:18:10  #11: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7c15fa) [0x2b05feb525fa]
16:18:10  #12: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x7ca2b5) [0x2b05feb5b2b5]
16:18:10  #13: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x8149b8) [0x2b05feba59b8]
16:18:10  #14: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x814d0a) [0x2b05feba5d0a]
16:18:10  #15: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x8163d3) [0x2b05feba73d3]
16:18:10  #16: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x5d62ed) [0x2b05fe9672ed]
16:18:10  #17: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x1555e2) [0x2b05fe4e65e2]
16:18:10  #18: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x156839) [0x2b05fe4e7839]
16:18:10  #19: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9prt29.so(+0x2b8b3) [0x2b05fd4698b3]
16:18:10  #20: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x153b96) [0x2b05fe4e4b96]
16:18:10  #21: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x154203) [0x2b05fe4e5203]
16:18:10  #22: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x152c2c) [0x2b05fe4e3c2c]
16:18:10  #23: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x1531d8) [0x2b05fe4e41d8]
16:18:10  #24: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x153272) [0x2b05fe4e4272]
16:18:10  #25: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9prt29.so(+0x2b8b3) [0x2b05fd4698b3]
16:18:10  #26: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9jit29.so(+0x15369f) [0x2b05fe4e469f]
16:18:10  #27: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/build/linux-x86_64-normal-server-release/jdk/lib/default/libj9thr29.so(+0xe4f6) [0x2b05fd6dc4f6]
16:18:10  #28: /lib64/libpthread.so.0(+0x7aa1) [0x2b05fb571aa1]
16:18:10  #29: /lib64/libc.so.6(clone+0x6d) [0x2b05fbc84c4d]
16:18:10  Unhandled exception
16:18:10  Type=Unhandled trap vmState=0x00050fff
16:18:10  J9Generic_Signal_Number=00000108 Signal_Number=00000005 Error_Value=00000000 Signal_Code=fffffffa
16:18:10  Handler1=00002B05FD00EDA0 Handler2=00002B05FD468B50
16:18:10  RDI=0000000000004B19 RSI=0000000000004B20 RAX=0000000000000000 RBX=00002B05FEF14600
16:18:10  RCX=FFFFFFFFFFFFFFFF RDX=0000000000000005 R8=00002B05FEF17538 R9=00002B0604FD1700
16:18:10  R10=0000000000018B20 R11=0000000000000202 R12=00002B05FEF17538 R13=00002B05FEF17508
16:18:10  R14=00002B0604FC4EC0 R15=00002B0604FC4ED0
16:18:10  RIP=00002B05FB5796AB GS=0000 FS=0000 RSP=00002B0604FC4948
16:18:10  EFlags=0000000000000202 CS=0033 RBP=0000000000001A1E ERR=0000000000000000
16:18:10  TRAPNO=0000000000000000 OLDMASK=0000000000000000 CR2=0000000000000000
16:18:10  xmm0 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm1 00000000ff000000 (f: 4278190080.000000, d: 2.113707e-314)
16:18:10  xmm2 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm3 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm4 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm5 0000000100000001 (f: 1.000000, d: 2.121996e-314)
16:18:10  xmm6 fffffffcfffffffc (f: 4294967296.000000, d: -nan)
16:18:10  xmm7 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm8 ffffffff00000000 (f: 0.000000, d: -nan)
16:18:10  xmm9 0020000000000000 (f: 0.000000, d: 4.450148e-308)
16:18:10  xmm10 00ff00000000ffff (f: 65535.000000, d: 7.063274e-304)
16:18:10  xmm11 3d2ef35793c76730 (f: 2479318784.000000, d: 5.497923e-14)
16:18:10  xmm12 be10000000000000 (f: 0.000000, d: -9.313226e-10)
16:18:10  xmm13 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  xmm14 3fe62e42fefa3800 (f: 4277811200.000000, d: 6.931472e-01)
16:18:10  xmm15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
16:18:10  Module=/lib64/libpthread.so.0
16:18:10  Module_base_address=00002B05FB56A000 Symbol=raise
16:18:10  Symbol_address=00002B05FB579680
16:18:10  
16:18:10  Method_being_compiled=java/lang/invoke/MethodType.hashCode()I
16:18:10  Target=2_90_20230519_5295 (Linux 3.10.0-327.el7.x86_64)
16:18:10  CPU=amd64 (4 logical CPUs) (0x1e4447000 RAM)
16:18:10  ----------- Stack Backtrace -----------
16:18:10  raise+0x2b (0x00002B05FB5796AB [libpthread.so.0+0xf6ab])
16:18:10  _ZN2TR4trapEv+0x47 (0x00002B05FE9B7427 [libj9jit29.so+0x626427])
16:18:10  _ZN2TR9assertionEPKciS1_S1_z+0xc8 (0x00002B05FE9B7658 [libj9jit29.so+0x626658])
16:18:10  _ZN3OMR4Node18isNodeCreatedByPREEv+0x48 (0x00002B05FE9AB028 [libj9jit29.so+0x61a028])
16:18:10  _ZN16TR_LoopVersioner40updateDefinitionsAndCollectProfiledExprsEPN2TR4NodeES2_tP4ListIS1_EPS3_I19TR_NodeParentSymRefEPS3_I30TR_NodeParentSymRefWeightTupleES2_bPNS0_5BlockEi+0xa52 (0x00002B05FEB51F02 [libj9jit29.so+0x7c0f02])
16:18:10  _ZN16TR_LoopVersioner40updateDefinitionsAndCollectProfiledExprsEPN2TR4NodeES2_tP4ListIS1_EPS3_I19TR_NodeParentSymRefEPS3_I30TR_NodeParentSymRefWeightTupleES2_bPNS0_5BlockEi+0x1ce (0x00002B05FEB5167E [libj9jit29.so+0x7c067e])
16:18:10  _ZN16TR_LoopVersioner26detectChecksToBeEliminatedEP18TR_RegionStructureP4ListIN2TR4NodeEEPS2_INS3_7TreeTopEEPS2_IiES9_S9_SB_S9_S9_S9_S9_S9_S6_PS2_I19TR_NodeParentSymRefEPS2_I30TR_NodeParentSymRefWeightTupleERb+0x44a (0x00002B05FEB525FA [libj9jit29.so+0x7c15fa])
16:18:10  _ZN16TR_LoopVersioner24performWithoutDominatorsEv+0xc45 (0x00002B05FEB5B2B5 [libj9jit29.so+0x7ca2b5])
16:18:10  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii+0x998 (0x00002B05FEBA59B8 [libj9jit29.so+0x8149b8])
16:18:10  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii+0xcea (0x00002B05FEBA5D0A [libj9jit29.so+0x814d0a])
16:18:10  _ZN3OMR9Optimizer8optimizeEv+0x263 (0x00002B05FEBA73D3 [libj9jit29.so+0x8163d3])
16:18:10  _ZN3OMR11Compilation7compileEv+0xb0d (0x00002B05FE9672ED [libj9jit29.so+0x5d62ed])
16:18:10  _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadPNS_11CompilationEP17TR_ResolvedMethodR11TR_J9VMBaseP19TR_OptimizationPlanRKNS_16SegmentAllocatorE+0x512 (0x00002B05FE4E65E2 [libj9jit29.so+0x1555e2])
16:18:10  _ZN2TR28CompilationInfoPerThreadBase14wrappedCompileEP13J9PortLibraryPv+0x369 (0x00002B05FE4E7839 [libj9jit29.so+0x156839])
16:18:10  omrsig_protect+0x1e3 (0x00002B05FD4698B3 [libj9prt29.so+0x2b8b3])
16:18:10  _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadP21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x336 (0x00002B05FE4E4B96 [libj9jit29.so+0x153b96])
16:18:10  _ZN2TR24CompilationInfoPerThread12processEntryER21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x1e3 (0x00002B05FE4E5203 [libj9jit29.so+0x154203])
16:18:10  _ZN2TR24CompilationInfoPerThread14processEntriesEv+0x44c (0x00002B05FE4E3C2C [libj9jit29.so+0x152c2c])
16:18:10  _ZN2TR24CompilationInfoPerThread3runEv+0x98 (0x00002B05FE4E41D8 [libj9jit29.so+0x1531d8])
16:18:10  _Z30protectedCompilationThreadProcP13J9PortLibraryPN2TR24CompilationInfoPerThreadE+0x82 (0x00002B05FE4E4272 [libj9jit29.so+0x153272])
16:18:10  omrsig_protect+0x1e3 (0x00002B05FD4698B3 [libj9prt29.so+0x2b8b3])
16:18:10  _Z21compilationThreadProcPv+0x1cf (0x00002B05FE4E469F [libj9jit29.so+0x15369f])
16:18:10  thread_wrapper+0x186 (0x00002B05FD6DC4F6 [libj9thr29.so+0xe4f6])
16:18:10  start_thread+0xd1 (0x00002B05FB571AA1 [libpthread.so.0+0x7aa1])
16:18:10  clone+0x6d (0x00002B05FBC84C4D [libc.so.6+0xe8c4d])
16:18:10  ---------------------------------------
16:18:10  JVMDUMP039I Processing dump event "gpf", detail "" at 2023/05/19 20:18:10 - please wait.
16:18:10  JVMDUMP032I JVM requested System dump using '/home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/core.20230519.201810.19225.0001.dmp' in response to an event
16:18:21  JVMPORT030W /proc/sys/kernel/core_pattern setting "|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h" specifies that the core dump is to be piped to an external program.  Attempting to rename either core or core.19254.  Review the manual for the external program to find where the core dump is written and ensure the program does not truncate it.
16:18:21  
16:18:27  JVMPORT049I The core file created by child process with pid = 19254 was not found. Review the documentation for the /proc/sys/kernel/core_pattern program "|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h" to find where the core file is written and ensure that program does not truncate it.
16:18:27  
16:18:27  JVMDUMP012E Error in System dump: /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/core.20230519.201810.19225.0001.dmp
16:18:27  JVMDUMP032I JVM requested Java dump using '/home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/javacore.20230519.201810.19225.0002.txt' in response to an event
16:18:27  JVMDUMP010I Java dump written to /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/javacore.20230519.201810.19225.0002.txt
16:18:27  JVMDUMP032I JVM requested Snap dump using '/home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/Snap.20230519.201810.19225.0003.trc' in response to an event
16:18:27  JVMDUMP010I Snap dump written to /home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/Snap.20230519.201810.19225.0003.trc
16:18:27  JVMDUMP032I JVM requested JIT dump using '/home/jenkins/workspace/Build_JDK11_x86-64_linux_Personal/make/jitdump.20230519.201810.19225.0004.dmp' in response to an event
16:18:27  JVMDUMP051I JIT dump occurred in 'JIT Compilation Thread-000' thread 0x000000000001AC00
16:18:27  JVMDUMP049I JIT dump notified all waiting threads of the current method to be compiled
16:18:27  JVMDUMP054I JIT dump is tracing the IL of the method on the crashed compilation thread
16:18:27  JVMDUMP048I JIT dump method being compiled is an ordinary method
16:18:27  JVMDUMP053I JIT dump is recompiling java/lang/invoke/MethodType.hashCode()I
@dylanjtuttle
Copy link
Contributor Author

This assertion fires during optimization, specifically during an optimization called LoopVersioner. (See the very bottom of the tracelog). The conditional for this assertion is OMR::Node::canChkNodeCreatedByPRE(), so we know from the stack trace that this function canChkNodeCreatedByPRE() must return false for a particular opcode icalli. There are two icalli instructions in the method java/lang/invoke/MethodType.hashCode()I, and I figured out that the assert fires on the second one, node n53n in the tracelog above.

Since OMR::Node::canChkNodeCreatedByPRE() returns false, it means that self()->getOpCode().isLoadVarDirect() (a single call which makes up the entire body of the method) must also return false. isLoadVarDirect() returns

(_flags & (ILProp1::Indirect | ILProp1::LoadVar)) == ILProp1::LoadVar

where _flags are the flags that have already been set for that opcode. I figured out that the value of _flags for n53n is 0x14008000, which means that it has the following flags set:

  • ILProp1::HasSymbolRef = 0x10000000
  • ILProp1::Call = 0x04000000
  • ILProp1::Indirect = 0x00008000

In order for the condition above to be satisfied,_flags would have to have ILProp1::LoadVar set and ILProp1::Indirect unset. Since neither of those are true, self()->getOpCode().isLoadVarDirect() returns false, so OMR::Node::canChkNodeCreatedByPRE() returns false, so the assert fires.

@dylanjtuttle
Copy link
Contributor Author

dylanjtuttle commented Jun 2, 2023

Now comes the task of figuring out what part of the puzzle is wrong. Inferring as much as I can from its name, I think icalli probably has the right flags.

This assertion was added in this commit from February, and doesn't seem incorrect to me.

From omr/compiler/optimizer/LoopVersioner.hpp: "The loop versioner optimization eliminates loop invariant null checks, bound checks, div checks, checkcasts and inline guards (where the "this" pointer does not change in the loop) from loops by placing equivalent tests outside the loop." The call to isNodeCreatedByPRE() occurs in the method TR_LoopVersioner::updateDefinitionsAndCollectProfiledExprs(), inside an if condition which consists of a bunch of conditions ANDed together, including !_containsCall, which I find particularly interesting. _containsCall may be set to true under the following nested conditionals:

if (_inNullCheckReference || !_nullCheckReference)
      {
       if ((opCode.isCall()) || (opCodeValue == TR::New) || (opCodeValue == TR::newarray) || (opCodeValue == TR::anewarray) || (opCodeValue == TR::multianewarray))
         _containsCall = true;

      if (node->hasUnresolvedSymbolReference())
         _containsCall = true;

      if (_inNullCheckReference && comp()->requiresSpineChecks() &&
            node->getOpCode().hasSymbolReference() &&
            node->getSymbol()->isArrayShadowSymbol())
            _containsCall = true;
      }

So _containsCall will be set to true if either of _inNullCheckReference or !_nullCheckReference is true, and opCode.isCall() is true. isCall() just checks to see if the node has the ILProp1::Call flag set, and we already know that n53n does.

It seems intuitive, then, that _containsCall would be true here, so !_containsCall would be false, and the boolean expression would short circuit before we ever get a chance to call node->isNodeCreatedByPRE(). However, since the assert is firing, clearly node->isNodeCreatedByPRE() is getting called.

Therefore, it follows that _inNullCheckReference is false and _nullCheckReference is true (non-null?), so I'm guessing that this assert is firing because one or both of those is probably incorrect.

@dylanjtuttle
Copy link
Contributor Author

dylanjtuttle commented Jun 2, 2023

We know _inNullCheckReference must be false in order for our assert to be firing (I also confirmed this by printing its value to the tracelog), and the only opportunity it has to get set to true is in this conditional shortly before we query its value.

That means that the problem is likely that node != _nullCheckReference.

@dylanjtuttle
Copy link
Contributor Author

I've confirmed that if I set _inNullCheckReference manually to true like so:

if (node->getGlobalIndex() == 53) _inNullCheckReference = true;

The method runs all the way through and the assertion doesn't fire.

@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 6, 2023

I wonder if the fix here is to ensure that all calls to isNodeCreatedByPRE() throughout the code base are guarded with a check for canChkNodeCreatedByPRE(). That is, node->canChkNodeCreatedByPRE() && node->isNodeCreatedByPRE(). This guard used to be part of the API when calling isNodeCreatedByPRE() but has since been removed, and in fact replaced by an assert.

This API is a bit peculiar in that you have to first check whether you may ask a node if it was created by PRE before actually asking it. I'm sure there was a good reason for this, but I wish there was better documentation in the code describing it.

EDIT: I'm sure it has to do with the overloading of flags on the node, and that the flag indicating that a node was created by PRE is only valid for certain opcodes. If that's not the reason the code is this way then I'm puzzled by the design.

@hzongaro
Copy link
Member

hzongaro commented Jun 6, 2023

I wonder if the fix here is to ensure that all calls to isNodeCreatedByPRE() throughout the code base are guarded with a check for canChkNodeCreatedByPRE()

I think so. I had recommended the change to isNodeCreatedByPRE to add an assertion in OMR pull request #6882, as this method seemed not to follow the pattern of most of the other APIs for node flags.

In most cases, the chk methods checked whether the flag was set, possibly with additional checking of whether the node contained the right kind of operation, while the is methods included an assertion that the node contained the right kind of operation. In the old implementations of isNodeCreatedByPRE and chkNodeCreatedByPRE those roles were reversed, with chkNodeCreatedByPRE containing an assertion. I had suggested that should be switched. I had thought that the one existing use of isNodeCreatedByPRE in Loop Versioner already satisfied the conditions for the assertion, but obviously I was mistaken. Sorry about that. Thanks for catching this, Dylan @dylanjtuttle!

@dylanjtuttle
Copy link
Contributor Author

Not that it's particularly surprising, but I can confirm that guarding the call to isNodeCreatedByPRE() with canChkNodeCreatedByPRE() does prevent the assertion from firing. Should I make a PR with that change?

As a side note, I noticed that setIsNodeCreatedByPRE() has the same assert, and its single use in the Partial Redundancy optimization isn't guarded either (resetIsNodeCreatedByPRE() isn't currently being used anywhere). Should we guard that as well?

@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 6, 2023

Should I make a PR with that change?

Yes

Should we guard that as well?

It seems to me that someone using the setIsNodeCreatedByPRE() API should know already that the node they have in hand can have this flag set. Otherwise, they'll get caught by the assert in the setter. I'm open to other opinions though.

@dylanjtuttle
Copy link
Contributor Author

Closing this issue as completed in eclipse/omr#7024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants