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

JDK21 java/foreign/loaderLookup/TestLoaderLookup.java Segmentation error vmState=0x00051aff #18074

Closed
JasonFengJ9 opened this issue Sep 5, 2023 · 15 comments

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Sep 5, 2023

Failure link

From an internal build(ub20-aarch64-4):

openjdk version "21-internal" 2023-09-19
OpenJDK Runtime Environment (build 21-internal-adhoc.****.BuildJDK21aarch64linuxNightly)
Eclipse OpenJ9 VM (build master-c46b26096a8, JRE 21 Linux aarch64-64-Bit Compressed References 20230901_53 (JIT enabled, AOT enabled)
OpenJ9   - c46b26096a8
OMR      - 75d233597f4
JCL      - fce06129139 based on jdk-21+35)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2023-09-01T22:14:29.206Z] variation: Mode650
[2023-09-01T22:14:29.206Z] JVM_OPTIONS:  -XX:-UseCompressedOops 

[2023-09-01T22:17:29.363Z] TEST: java/foreign/loaderLookup/TestLoaderLookup.java

[2023-09-01T22:17:29.365Z] STDOUT:
[2023-09-01T22:17:29.365Z] STDERR:
[2023-09-01T22:17:29.365Z] #0: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8455f4) [0xffff9347e5f4]
[2023-09-01T22:17:29.365Z] #1: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8522c0) [0xffff9348b2c0]
[2023-09-01T22:17:29.365Z] #2: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x123a74) [0xffff92d5ca74]
[2023-09-01T22:17:29.365Z] #3: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x27c64) [0xffff98392c64]
[2023-09-01T22:17:29.365Z] #4: function __kernel_rt_sigreturn+0 [0]
[2023-09-01T22:17:29.365Z] #5: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c8d10) [0xffff92f01d10]
[2023-09-01T22:17:29.365Z] #6: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2a8bb0) [0xffff92ee1bb0]
[2023-09-01T22:17:29.365Z] #7: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2a9038) [0xffff92ee2038]
[2023-09-01T22:17:29.365Z] #8: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c5d4c) [0xffff92efed4c]
[2023-09-01T22:17:29.365Z] #9: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c7fb8) [0xffff92f00fb8]
[2023-09-01T22:17:29.365Z] #10: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2068) [0xffff9331b068]
[2023-09-01T22:17:29.365Z] #11: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff9331b458]
[2023-09-01T22:17:29.365Z] #12: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff9331b458]
[2023-09-01T22:17:29.365Z] #13: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff9331b458]
[2023-09-01T22:17:29.365Z] #14: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e39a4) [0xffff9331c9a4]
[2023-09-01T22:17:29.365Z] #15: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x4fbb04) [0xffff93134b04]
[2023-09-01T22:17:29.365Z] #16: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x13aaf0) [0xffff92d73af0]
[2023-09-01T22:17:29.365Z] #17: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x13b918) [0xffff92d74918]
[2023-09-01T22:17:29.365Z] #18: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2877c) [0xffff9839377c]
[2023-09-01T22:17:29.365Z] #19: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139628) [0xffff92d72628]
[2023-09-01T22:17:29.365Z] #20: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139ad8) [0xffff92d72ad8]
[2023-09-01T22:17:29.365Z] #21: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138860) [0xffff92d71860]
[2023-09-01T22:17:29.365Z] #22: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138d1c) [0xffff92d71d1c]
[2023-09-01T22:17:29.365Z] #23: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138dcc) [0xffff92d71dcc]
[2023-09-01T22:17:29.365Z] #24: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2877c) [0xffff9839377c]
[2023-09-01T22:17:29.365Z] #25: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139198) [0xffff92d72198]
[2023-09-01T22:17:29.365Z] #26: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9thr29.so(+0x73bc) [0xffff983413bc]
[2023-09-01T22:17:29.365Z] #27: /lib/aarch64-linux-gnu/libpthread.so.0(+0x7624) [0xffff98b96624]
[2023-09-01T22:17:29.365Z] #28: /lib/aarch64-linux-gnu/libc.so.6(+0xd149c) [0xffff98ad949c]
[2023-09-01T22:17:29.365Z] Unhandled exception
[2023-09-01T22:17:29.365Z] Type=Segmentation error vmState=0x00051aff
[2023-09-01T22:17:29.365Z] J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
[2023-09-01T22:17:29.365Z] Handler1=0000FFFF9842C134 Handler2=0000FFFF98392AF0 InaccessibleAddress=0000000000000000
[2023-09-01T22:17:29.365Z] R0=0000000000000000 R1=0000000000000020 R2=0000FFFF937C31F8 R3=0000000000000E50
[2023-09-01T22:17:29.365Z] R4=0000FFFF53090E40 R5=0000FFFF53090E60 R6=FEFF666D68776845 R7=7F7F7F7F7F7F7F7F
[2023-09-01T22:17:29.365Z] R8=0101010101010101 R9=0000FFFF942A6B00 R10=000000000000000C R11=0101010101010101
[2023-09-01T22:17:29.365Z] R12=000000000000002B R13=0000000000000000 R14=0000000000000000 R15=0715190000000000
[2023-09-01T22:17:29.365Z] R16=0000FFFF93799018 R17=0000FFFF98A8D010 R18=0000000000000000 R19=0000FFFF532C4790
[2023-09-01T22:17:29.365Z] R20=0000FFFF532AE020 R21=0000FFFF584A97B0 R22=0000000000000000 R23=0000000000000000
[2023-09-01T22:17:29.365Z] R24=0000FFFF93798000 R25=0000000000000032 R26=0000000000000000 R27=0000000000000000
[2023-09-01T22:17:29.365Z] R28=0000FFFF584A9E58 R29=0000FFFF584B2F10 R30=0000FFFF92EE1BB0 R31=0000FFFF584A96D0
[2023-09-01T22:17:29.365Z] PC=0000FFFF92F01D10 SP=0000FFFF584A96D0 PSTATE=0000000020001000
[2023-09-01T22:17:29.365Z] V0 0000ffff53000170 (f: 1392509312.000000, d: 1.390657e-309)
[2023-09-01T22:17:29.365Z] V1 0000ffff532c4740 (f: 1395410688.000000, d: 1.390657e-309)
[2023-09-01T22:17:29.365Z] V2 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V3 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V4 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V5 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V6 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V7 4010040140100401 (f: 1074791424.000000, d: 4.003911e+00)
[2023-09-01T22:17:29.365Z] V8 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V9 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V10 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V11 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V12 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V13 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V14 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.365Z] V16 0000000054040401 (f: 1409549312.000000, d: 6.964099e-315)
[2023-09-01T22:17:29.366Z] V17 5555555555555555 (f: 1431655808.000000, d: 1.194531e+103)
[2023-09-01T22:17:29.366Z] V18 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.366Z] V19 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.366Z] V20 3fb1eb851eb851ec (f: 515396064.000000, d: 7.000000e-02)
[2023-09-01T22:17:29.366Z] V21 0000000000000800 (f: 2048.000000, d: 1.011846e-320)
[2023-09-01T22:17:29.366Z] V22 3fc999999999999a (f: 2576980480.000000, d: 2.000000e-01)
[2023-09-01T22:17:29.366Z] V23 3fa999999999999a (f: 2576980480.000000, d: 5.000000e-02)
[2023-09-01T22:17:29.366Z] V24 3fd6666666666666 (f: 1717986944.000000, d: 3.500000e-01)
[2023-09-01T22:17:29.366Z] V25 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.366Z] V26 3fb999999999999a (f: 2576980480.000000, d: 1.000000e-01)
[2023-09-01T22:17:29.366Z] V27 000000000000000a (f: 10.000000, d: 4.940656e-323)
[2023-09-01T22:17:29.366Z] V28 0000000000000800 (f: 2048.000000, d: 1.011846e-320)
[2023-09-01T22:17:29.366Z] V29 0000000000000300 (f: 768.000000, d: 3.794424e-321)
[2023-09-01T22:17:29.366Z] V30 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.366Z] V31 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2023-09-01T22:17:29.366Z] Module=/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so
[2023-09-01T22:17:29.366Z] Module_base_address=0000FFFF92C39000
[2023-09-01T22:17:29.366Z] 
[2023-09-01T22:17:29.366Z] Method_being_compiled=jdk/internal/foreign/abi/AbstractLinker.stripNames(Ljava/lang/foreign/FunctionDescriptor;)Ljava/lang/foreign/FunctionDescriptor;
[2023-09-01T22:17:29.366Z] Target=2_90_20230901_53 (Linux 5.4.0-144-generic)
[2023-09-01T22:17:29.366Z] CPU=aarch64 (8 logical CPUs) (0x1efead000 RAM)
[2023-09-01T22:17:29.366Z] ----------- Stack Backtrace -----------
[2023-09-01T22:17:29.366Z] _ZNK3OMR8ILOpCode11properties2Ev+0x0 (0x0000FFFF92F01D10 [libj9jit29.so+0x2c8d10])
[2023-09-01T22:17:29.366Z] _ZN17TR_EscapeAnalysis9fixupNodeEPN2TR4NodeES2_RNS0_13NodeChecklistE.localalias+0x1a40 (0x0000FFFF92EE1BB0 [libj9jit29.so+0x2a8bb0])
[2023-09-01T22:17:29.366Z] _ZN17TR_EscapeAnalysis10fixupTreesEv+0xc8 (0x0000FFFF92EE2038 [libj9jit29.so+0x2a9038])
[2023-09-01T22:17:29.366Z] _ZN17TR_EscapeAnalysis19performAnalysisOnceEv+0x7cc (0x0000FFFF92EFED4C [libj9jit29.so+0x2c5d4c])
[2023-09-01T22:17:29.366Z] _ZN17TR_EscapeAnalysis7performEv+0x2a8 (0x0000FFFF92F00FB8 [libj9jit29.so+0x2c7fb8])
[2023-09-01T22:17:29.366Z] _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0x6e4 (0x0000FFFF9331B068 [libj9jit29.so+0x6e2068])
[2023-09-01T22:17:29.366Z] _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF9331B458 [libj9jit29.so+0x6e2458])
[2023-09-01T22:17:29.366Z] _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF9331B458 [libj9jit29.so+0x6e2458])
[2023-09-01T22:17:29.366Z] _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF9331B458 [libj9jit29.so+0x6e2458])
[2023-09-01T22:17:29.366Z] _ZN3OMR9Optimizer8optimizeEv+0x180 (0x0000FFFF9331C9A4 [libj9jit29.so+0x6e39a4])
[2023-09-01T22:17:29.366Z] _ZN3OMR11Compilation7compileEv+0x574 (0x0000FFFF93134B04 [libj9jit29.so+0x4fbb04])
[2023-09-01T22:17:29.366Z] _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadPNS_11CompilationEP17TR_ResolvedMethodR11TR_J9VMBaseP19TR_OptimizationPlanRKNS_16SegmentAllocatorE+0x40c (0x0000FFFF92D73AF0 [libj9jit29.so+0x13aaf0])
[2023-09-01T22:17:29.366Z] _ZN2TR28CompilationInfoPerThreadBase14wrappedCompileEP13J9PortLibraryPv+0x2c8 (0x0000FFFF92D74918 [libj9jit29.so+0x13b918])
[2023-09-01T22:17:29.366Z] omrsig_protect+0x21c (0x0000FFFF9839377C [libj9prt29.so+0x2877c])
[2023-09-01T22:17:29.366Z] _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadP21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x2c4 (0x0000FFFF92D72628 [libj9jit29.so+0x139628])
[2023-09-01T22:17:29.366Z] _ZN2TR24CompilationInfoPerThread12processEntryER21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x118 (0x0000FFFF92D72AD8 [libj9jit29.so+0x139ad8])
[2023-09-01T22:17:29.366Z] _ZN2TR24CompilationInfoPerThread14processEntriesEv+0x2e0 (0x0000FFFF92D71860 [libj9jit29.so+0x138860])
[2023-09-01T22:17:29.366Z] _ZN2TR24CompilationInfoPerThread3runEv+0x4c (0x0000FFFF92D71D1C [libj9jit29.so+0x138d1c])
[2023-09-01T22:17:29.366Z] _Z30protectedCompilationThreadProcP13J9PortLibraryPN2TR24CompilationInfoPerThreadE+0x7c (0x0000FFFF92D71DCC [libj9jit29.so+0x138dcc])
[2023-09-01T22:17:29.366Z] omrsig_protect+0x21c (0x0000FFFF9839377C [libj9prt29.so+0x2877c])
[2023-09-01T22:17:29.366Z] _Z21compilationThreadProcPv+0x148 (0x0000FFFF92D72198 [libj9jit29.so+0x139198])
[2023-09-01T22:17:29.366Z] thread_wrapper+0xcc (0x0000FFFF983413BC [libj9thr29.so+0x73bc])
[2023-09-01T22:17:29.366Z] start_thread+0x184 (0x0000FFFF98B96624 [libpthread.so.0+0x7624])
[2023-09-01T22:17:29.366Z]  (0x0000FFFF98AD949C [libc.so.6+0xd149c])
[2023-09-01T22:17:29.366Z] ---------------------------------------
[2023-09-01T22:17:29.366Z] JVMDUMP039I Processing dump event "gpf", detail "" at 2023/09/01 22:17:22 - please wait.

[2023-09-01T22:17:29.367Z] TEST RESULT: Failed. Unexpected exit from test [exit code: 255]
[2023-09-01T22:17:29.367Z] --------------------------------------------------
[2023-09-01T22:17:33.277Z] Test results: passed: 80; failed: 1
[2023-09-01T22:17:48.385Z] Report written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/aqa-tests/TKG/output_16936051239437/jdk_foreign_1/report/html/report.html
[2023-09-01T22:17:48.385Z] Results written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_Nightly_testList_2/aqa-tests/TKG/output_16936051239437/jdk_foreign_1/work
[2023-09-01T22:17:48.385Z] Error: Some tests failed or other problems occurred.
[2023-09-01T22:17:48.385Z] -----------------------------------
[2023-09-01T22:17:48.385Z] jdk_foreign_1_FAILED

50x internal grinder - 7/50 failed w/ Segmentation error vmState=0x00051aff

@pshipton
Copy link
Member

pshipton commented Sep 5, 2023

This failure occurred earlier than the previous one, although on the same day.

https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/19/
jdk_foreign_1
java/foreign/loaderLookup/TestLoaderLookup.java

https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Test/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/19/openjdk_test_output.tar.gz

06:01:37  #0: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8455f4) [0xffff8a8c65f4]
06:01:37  #1: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8522c0) [0xffff8a8d32c0]
06:01:37  #2: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x123a74) [0xffff8a1a4a74]
06:01:37  #3: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x27c64) [0xffff8b70dc64]
06:01:37  #4: function __kernel_rt_sigreturn+0 [0]
06:01:37  #5: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c8d10) [0xffff8a349d10]
06:01:37  #6: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2a8bb0) [0xffff8a329bb0]
06:01:37  #7: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2a9038) [0xffff8a32a038]
06:01:37  #8: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c5d4c) [0xffff8a346d4c]
06:01:37  #9: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2c7fb8) [0xffff8a348fb8]
06:01:37  #10: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2068) [0xffff8a763068]
06:01:37  #11: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff8a763458]
06:01:37  #12: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff8a763458]
06:01:37  #13: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e2458) [0xffff8a763458]
06:01:37  #14: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x6e39a4) [0xffff8a7649a4]
06:01:37  #15: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x4fbb04) [0xffff8a57cb04]
06:01:37  #16: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x13aaf0) [0xffff8a1bbaf0]
06:01:37  #17: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x13b918) [0xffff8a1bc918]
06:01:37  #18: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2877c) [0xffff8b70e77c]
06:01:37  #19: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139628) [0xffff8a1ba628]
06:01:37  #20: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139ad8) [0xffff8a1baad8]
06:01:37  #21: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138860) [0xffff8a1b9860]
06:01:37  #22: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138d1c) [0xffff8a1b9d1c]
06:01:37  #23: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x138dcc) [0xffff8a1b9dcc]
06:01:37  #24: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2877c) [0xffff8b70e77c]
06:01:37  #25: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x139198) [0xffff8a1ba198]
06:01:37  #26: /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9thr29.so(+0x73bc) [0xffff8b6bc3bc]
06:01:37  #27: /lib/aarch64-linux-gnu/libpthread.so.0(+0x7624) [0xffff8bf11624]
06:01:37  #28: /lib/aarch64-linux-gnu/libc.so.6(+0xd149c) [0xffff8be5449c]
06:01:37  Unhandled exception
06:01:37  Type=Segmentation error vmState=0x00051aff
06:01:37  J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
06:01:37  Handler1=0000FFFF8B7A7134 Handler2=0000FFFF8B70DAF0 InaccessibleAddress=0000000000000000
06:01:37  R0=0000000000000000 R1=0000000000000020 R2=0000FFFF8AC0B1F8 R3=0000000000004598
06:01:37  R4=0000FFFF499A2588 R5=0000FFFF499A25A8 R6=6D6067421F3D2C1F R7=7F7F7F7F7F7F7F7F
06:01:37  R8=0101010101010101 R9=0000FFFF842A6400 R10=0000FFFF49FF6420 R11=000000000000002C
06:01:37  R12=676E616C2F617661 R13=3B7463656A624F2F R14=0000000000000000 R15=000000007FFFFFDE
06:01:37  R16=0000FFFF8ABE1018 R17=0000FFFF8BE08010 R18=0000000000000000 R19=0000FFFF49DEBDE0
06:01:37  R20=0000FFFF49FF5E20 R21=0000FFFF88EE87B0 R22=0000000000000000 R23=0000000000000000
06:01:37  R24=0000FFFF8ABE0000 R25=000000000000005E R26=0000000000000000 R27=0000000000000000
06:01:37  R28=0000FFFF88EE93A8 R29=0000FFFF88EF1F10 R30=0000FFFF8A329BB0 R31=0000FFFF88EE86D0
06:01:37  PC=0000FFFF8A349D10 SP=0000FFFF88EE86D0 PSTATE=0000000020001000
06:01:37  V0 0000ffff4993e170 (f: 1234428288.000000, d: 1.390656e-309)
06:01:37  V1 0000ffff49debd90 (f: 1239334272.000000, d: 1.390656e-309)
06:01:37  V2 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V3 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V4 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V5 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V6 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V7 4010040140100401 (f: 1074791424.000000, d: 4.003911e+00)
06:01:37  V8 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V9 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V10 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V11 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V12 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V13 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V14 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V16 0000000054040401 (f: 1409549312.000000, d: 6.964099e-315)
06:01:37  V17 5555555555555555 (f: 1431655808.000000, d: 1.194531e+103)
06:01:37  V18 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V19 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V20 3fb1eb851eb851ec (f: 515396064.000000, d: 7.000000e-02)
06:01:37  V21 0000000000000800 (f: 2048.000000, d: 1.011846e-320)
06:01:37  V22 3fc999999999999a (f: 2576980480.000000, d: 2.000000e-01)
06:01:37  V23 3fa999999999999a (f: 2576980480.000000, d: 5.000000e-02)
06:01:37  V24 3fd6666666666666 (f: 1717986944.000000, d: 3.500000e-01)
06:01:37  V25 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V26 3fb999999999999a (f: 2576980480.000000, d: 1.000000e-01)
06:01:37  V27 000000000000000a (f: 10.000000, d: 4.940656e-323)
06:01:37  V28 0000000000000800 (f: 2048.000000, d: 1.011846e-320)
06:01:37  V29 0000000000000300 (f: 768.000000, d: 3.794424e-321)
06:01:37  V30 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  V31 0000000000000000 (f: 0.000000, d: 0.000000e+00)
06:01:37  Module=/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so
06:01:37  Module_base_address=0000FFFF8A081000
06:01:37  
06:01:37  Method_being_compiled=jdk/internal/foreign/abi/AbstractLinker.downcallHandle0(Ljava/lang/foreign/FunctionDescriptor;[Ljava/lang/foreign/Linker$Option;)Ljava/lang/invoke/MethodHandle;
06:01:37  Target=2_90_20230901_20 (Linux 5.4.0-144-generic)
06:01:37  CPU=aarch64 (8 logical CPUs) (0x1efead000 RAM)
06:01:37  ----------- Stack Backtrace -----------
06:01:37  _ZNK3OMR8ILOpCode11properties2Ev+0x0 (0x0000FFFF8A349D10 [libj9jit29.so+0x2c8d10])
06:01:37  _ZN17TR_EscapeAnalysis9fixupNodeEPN2TR4NodeES2_RNS0_13NodeChecklistE.localalias+0x1a40 (0x0000FFFF8A329BB0 [libj9jit29.so+0x2a8bb0])
06:01:37  _ZN17TR_EscapeAnalysis10fixupTreesEv+0xc8 (0x0000FFFF8A32A038 [libj9jit29.so+0x2a9038])
06:01:37  _ZN17TR_EscapeAnalysis19performAnalysisOnceEv+0x7cc (0x0000FFFF8A346D4C [libj9jit29.so+0x2c5d4c])
06:01:37  _ZN17TR_EscapeAnalysis7performEv+0x2a8 (0x0000FFFF8A348FB8 [libj9jit29.so+0x2c7fb8])
06:01:37  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0x6e4 (0x0000FFFF8A763068 [libj9jit29.so+0x6e2068])
06:01:37  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF8A763458 [libj9jit29.so+0x6e2458])
06:01:37  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF8A763458 [libj9jit29.so+0x6e2458])
06:01:37  _ZN3OMR9Optimizer19performOptimizationEPK20OptimizationStrategyiii.localalias+0xad4 (0x0000FFFF8A763458 [libj9jit29.so+0x6e2458])
06:01:37  _ZN3OMR9Optimizer8optimizeEv+0x180 (0x0000FFFF8A7649A4 [libj9jit29.so+0x6e39a4])
06:01:37  _ZN3OMR11Compilation7compileEv+0x574 (0x0000FFFF8A57CB04 [libj9jit29.so+0x4fbb04])
06:01:37  _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadPNS_11CompilationEP17TR_ResolvedMethodR11TR_J9VMBaseP19TR_OptimizationPlanRKNS_16SegmentAllocatorE+0x40c (0x0000FFFF8A1BBAF0 [libj9jit29.so+0x13aaf0])
06:01:37  _ZN2TR28CompilationInfoPerThreadBase14wrappedCompileEP13J9PortLibraryPv+0x2c8 (0x0000FFFF8A1BC918 [libj9jit29.so+0x13b918])
06:01:37  omrsig_protect+0x21c (0x0000FFFF8B70E77C [libj9prt29.so+0x2877c])
06:01:37  _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadP21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x2c4 (0x0000FFFF8A1BA628 [libj9jit29.so+0x139628])
06:01:37  _ZN2TR24CompilationInfoPerThread12processEntryER21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x118 (0x0000FFFF8A1BAAD8 [libj9jit29.so+0x139ad8])
06:01:37  _ZN2TR24CompilationInfoPerThread14processEntriesEv+0x2e0 (0x0000FFFF8A1B9860 [libj9jit29.so+0x138860])
06:01:37  _ZN2TR24CompilationInfoPerThread3runEv+0x4c (0x0000FFFF8A1B9D1C [libj9jit29.so+0x138d1c])
06:01:37  _Z30protectedCompilationThreadProcP13J9PortLibraryPN2TR24CompilationInfoPerThreadE+0x7c (0x0000FFFF8A1B9DCC [libj9jit29.so+0x138dcc])
06:01:37  omrsig_protect+0x21c (0x0000FFFF8B70E77C [libj9prt29.so+0x2877c])
06:01:37  _Z21compilationThreadProcPv+0x148 (0x0000FFFF8A1BA198 [libj9jit29.so+0x139198])
06:01:37  thread_wrapper+0xcc (0x0000FFFF8B6BC3BC [libj9thr29.so+0x73bc])
06:01:37  start_thread+0x184 (0x0000FFFF8BF11624 [libpthread.so.0+0x7624])
06:01:37   (0x0000FFFF8BE5449C [libc.so.6+0xd149c])
06:01:37  ---------------------------------------

@pshipton
Copy link
Member

pshipton commented Sep 5, 2023

vmState [0x51aff]: {J9VMSTATE_JIT} {escapeAnalysis}

Changes from the previous build where the failure did not occur, although it may be intermittent.
080f0db...2b34667

@knn-k fyi

@pshipton
Copy link
Member

pshipton commented Sep 5, 2023

Since it seems to be failing in every build, we need to fix it or exclude it asap.

@0xdaryl
Copy link
Contributor

0xdaryl commented Sep 5, 2023

@hzongaro : this seems to be crashing in EA fairly consistently. Could you have a look please?

@hzongaro hzongaro self-assigned this Sep 6, 2023
@hzongaro
Copy link
Member

hzongaro commented Sep 6, 2023

Status thus far. The immediate cause of the failure is that a call to TR_EscapeAnalysis::fixupNode passes NULL as the parent node, as the node that's being fixed up is a tree top node. In the process of fixing up that node, the parent's opcode is examined, without any guard testing for whether the parent is NULL.

(gdb) up 17
#17 TR_EscapeAnalysis::fixupNode (this=this@entry=0xffff49ff5e20, node=node@entry=0xffff49debde0, parent=parent@entry=0x0, visited=...)
    at /home/jenkins/workspace/Build_JDK21_aarch64_linux_OMR/openj9/runtime/compiler/optimizer/EscapeAnalysis.cpp:5625
5625                            if (parent->getOpCode().isCheck() || parent->getOpCodeValue() == TR::compressedRefs)
(gdb) up
#18 0x0000ffff8a32a038 in TR_EscapeAnalysis::fixupTrees (this=this@entry=0xffff49ff5e20)
    at /home/jenkins/workspace/Build_JDK21_aarch64_linux_OMR/openj9/runtime/compiler/optimizer/EscapeAnalysis.cpp:5424
5424             if (fixupNode(node, NULL, visited))

The node in question is an awrtbari. Comments above this block of code indicate that Escape Analysis is handling a case where the operation is writing to a field of a candidate for discontiguous stack allocation and the JIT believes that the field is not a field in the object that's being allocated. Such situations can arise, for instance, if the field access of a subclass is guarded by an instanceof test.

I will need to add a test to fixupNode to guard against the possibility that parent is NULL, but first I'm investigating whether Escape Analysis is correct in thinking that the field that's being written to is not actually in an instance of the class that's being allocated. Things look a bit suspicious, so I'm trying to capture more debug output. In particular, from the jitdump and core file from https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Test/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OMR_testList_2/19/openjdk_test_output.tar.gz, the candidate for stack allocation and the field that's written (after the awrtbari has been transformed into an astorei) look like this. The fact that Escape Analysis thinks the arg\$1 field is not part of the lambda that's being allocated seems suspicious, and might be a symptom of another problem that the failure to check whether parent was NULL just happened to trip across.

n4795n    treetop                                                                             [    0xffff49deaa80] bci=[40,12,501] rc=0 vc=991 vn=892 li=- udi=- nc=1
n4794n      new  jitNewObject[#91  helper Method] [flags 0x400 0x0 ]                          [    0xffff49deaa30] bci=[40,12,501] rc=1 vc=991 vn=94 li=- udi=- nc=1
n9177n        loadaddr  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000[#1538  Static] [flags 0x18307 0x0 ]  [    0xffff49f50440] bci=[40,12,501] rc=1 vc=991 vn=93 li=- udi=- nc=0

  ...

n4857n    astorei  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000.arg$1 Ljava/lang/foreign/FunctionDescriptor;[#993  final Shadow +16] [flags 0xa0607 0x0 ] ()  [    0xffff49debde0] bci=[42,6,-] rc=0 vc=992 vn=2 li=- udi=- nc=2 flg=0x20
n9647n      iconst 0 (X==0 X>=0 X<=0 )                                                        [    0xffff49f59720] bci=[42,4,-] rc=1 vc=0 vn=1838 li=- udi=- nc=0 flg=0x302
n4856n      aload  function<parm 1 Ljava/lang/foreign/FunctionDescriptor;>[#350  Parm] [flags 0x40000107 0x0 ] (X!=0 )  [    0xffff49debd90] bci=[42,5,-] rc=1 vc=992 vn=2 li=633 udi=632 nc=0 flg=0x4

@hzongaro
Copy link
Member

hzongaro commented Sep 7, 2023

I went pawing through node n9177n [0xffff49f50440] to see which class was being referenced at that point, as there are seven with that name, some of which have no fields and some of which have an arg$1 field. From jdmpview:

> info class jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000
name = jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000 found 7 on different class loaders
    Class ID = 0xfffee80e8300    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80db800    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80dab00    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80da800    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80da500    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80da100    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)
    Class ID = 0xfffee80d9e00    Class Loader jdk/internal/loader/ClassLoaders$BootClassLoader(0xffff64057e28)

In gdb, at TR_EscapeAnalysis::fixupNode:

(gdb) p candidate->_node->_unionBase._unionedWithChildren._caseInfo._firstChild
$11 = (TR::Node *) 0xffff49f50440
(gdb) p *(TR::StaticSymbol*) candidate->_node->_unionBase._unionedWithChildren._caseInfo._firstChild->_unionPropertyA._symbolReference->_symbol
$14 = {<J9::StaticSymbol> = {<OMR::StaticSymbol> = {<TR::Symbol> = {<J9::Symbol> = {<OMR::Symbol> = {
            _vptr.Symbol = 0xffff8abbdae8 <vtable for TR::StaticSymbol+16>, _size = 8, _name = 0x0, _declaredClass = 0x0, _flags = {_flags = 99079},
            _flags2 = {_flags = 0}, _localIndex = 65535}, _recognizedField = J9::Symbol::Com_ibm_gpu_Kernel_blockIdxX}, <No data fields>},
      _staticAddress = 0xfffee80da800, _assignedTOCIndex = 0}, _callSiteIndex = 0, _classSignature = 0x0, _classSignatureLength = 0,
    _isPrimitive = false, _recognizedField = J9::Symbol::UnknownField, _methodTypeIndex = 131072}, <No data fields>}

So the address referenced by the symbol is 0xfffee80da800, which agrees with the content of the Candidate object:

(gdb) p candidate->_class
$18 = (void *) 0xfffee80da800
(gdb) p candidate->_size
$19 = 24

According to both jdmpview and kca, that class has an arg$1 field at offset 16, so I'm not sure how Escape Analysis comes to think that the awrtbari is writing to a field that's not in the object.

> info class 0xfffee80da800
name = jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000

        ID = 0xfffee80da800    superID = 0xffff8418d200
        classLoader = 0xffff64057e28    modifiers: final

        number of instances:     1
        total size of instances on the heap: 24 bytes

Fields......

          "jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000" has no static fields

          non-static fields for "jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000"
            private final foreign.FunctionDescriptor arg$1
            
(kca) j9class fields 0xfffee80da800
  Fields for Class: {jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000}
     Hidden Fields: 1
>                       lockWord (  +8) - <hidden>
Super class fields: {java/lang/Object}  Number of Fields: 0
      Class fields:   Number of Fields: 1
>                          arg$1 ( +16) (Ljava/lang/foreign/FunctionDescriptor;) - 20012 Private Final 

@hzongaro
Copy link
Member

hzongaro commented Sep 7, 2023

The function candidateHasField is responsible for determining whether a field accesses a field that's actually in a candidate. In particular, I'm looking at these lines:

            TR_OpaqueClassBlock *fieldClassInCP = fieldSymRef->getOwningMethod(comp)->getClassFromFieldOrStatic(comp, fieldSymRef->getCPIndex());
      if (  fieldClassInCP
         && TR_yes == comp->fej9()->isInstanceOf((TR_OpaqueClassBlock*)candidate->_class, fieldClassInCP, true))

From the store node, the owning method index of the field is 277:

n4857n    astorei  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000.arg$1 Ljava/lang/foreign/FunctionDescriptor;[#993  final Shadow +16] [flags 0xa0607 0x0 ] ()  [    0xffff49debde0] bci=[42,6,-] rc=0 vc=992 vn=2 li=- udi=- nc=2 flg=0x20

(gdb) p *((TR::Node *)0xffff49debde0)->_unionPropertyA._symbolReference
$31 = {<J9::SymbolReference> = {<OMR::SymbolReference> = {_vptr.SymbolReference = 0xffff8abb25d8 <vtable for TR::SymbolReference+16>,
      _symbol = 0xffff49dda470, _extraInfo = 0x0, _offset = 16, _size = 1239262528, _owningMethodIndex = {_value = 277}, _cpIndex = 4,
      _unresolvedIndex = 0, _referenceNumber = 993, _flags = {_flags = 536870912}, _knownObjectIndex = -1, {_useDefAliases = 0x0,
        _independentSymRefs = 0x0}}, <No data fields>}, <No data fields>}

The j9method for index 277:

(gdb) p this->_manager->_optimizer->_compilation->_methodSymbols->_array[277]->_methodAddress
$48 = (void *) 0xfffee80da728

(kca) j9method 0xfffee80da728
Method   {ClassPath/Name.MethodName}: {jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000.<init>}
                           Signature: (Ljava/lang/foreign/FunctionDescriptor;)V
                              Access: Private
                    J9Class/J9Method: 0x0000fffee80da500 / 0x0000fffee80da728
               Compiled Method Start: Not Compiled! (count=296)
                      ByteCode Start: 0x0000ffff119b0574 (10 bytes)
                   ROM Constant Pool: 0x0000ffff119b04f8 (8 entries)
                       Constant Pool: 0x0000fffee80da400 (8 entries)

Notice that the J9Class is 0xfffee80da500, rather than 0xfffee80da800. I'm wondering how we seem to be using an <init> method for a different class. . . .

@pshipton
Copy link
Member

https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Nightly_testList_2/57
java/foreign/loaderLookup/TestLoaderLookup.java

https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Test/Test_openjdk21_j9_sanity.openjdk_ppc64le_linux_Nightly_testList_2/57/openjdk_test_output.tar.gz

20:35:56  Type=Segmentation error vmState=0x00000000
20:35:56  J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
20:35:56  Handler1=00007FFFA6A61440 Handler2=00007FFFA6989700
20:35:56  R0=0000000000000000 R1=00007FFF679DB6F0 R2=0000000000000000 R3=00000000FFED8D48
20:35:56  R4=00000000FFF077A8 R5=00000000FFF07870 R6=0000000000000000 R7=00000000E0000000
20:35:56  R8=0000000000600000 R9=0000000000000001 R10=00007FFF86BB1F74 R11=0000000000276BE8
20:35:56  R12=00007FFF869A0398 R13=00007FFF679E68E0 R14=000000000027AB40 R15=0000000000223F00
20:35:56  R16=00007FFF84320038 R17=00000000000C1CD0 R18=00000000FFF077A8 R19=00000000FFEFBA18
20:35:56  R20=00000000FFEE15C0 R21=000000000027AC38 R22=00000000FFF07788 R23=000000000027AC50
20:35:56  R24=00000000E0040600 R25=00000000E0040600 R26=000000000027AC38 R27=00000000E00D8670
20:35:56  R28=00000000FFF07870 R29=00000000E0040600 R30=00000000FFEDA718 R31=00000000E0040600
20:35:56  NIP=00007FFF86BB369C MSR=800000000280F033 ORIG_GPR3=00007FFF867D2F3C CTR=00007FFF867D25CC
20:35:56  LINK=00007FFF86BB3678 XER=0000000000000000 CCR=0000000048884884 SOFTE=0000000000000001
20:35:56  TRAP=0000000000000300 DAR=0000000000000008 dsisr=0000000042000000 RESULT=0000000000000000
20:35:56  FPR0 0000000000000005 (f: 5.000000, d: 2.470328e-323)
20:35:56  FPR1 4052f678a0000000 (f: 2684354560.000000, d: 7.585111e+01)
20:35:56  FPR2 41d0000000000000 (f: 0.000000, d: 1.073742e+09)
20:35:56  FPR3 4000000000000000 (f: 0.000000, d: 2.000000e+00)
20:35:56  FPR4 3fe8000000000000 (f: 0.000000, d: 7.500000e-01)
20:35:56  FPR5 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR6 3fe62e42fefa39ef (f: 4277811712.000000, d: 6.931472e-01)
20:35:56  FPR7 bfa252f438e10c1e (f: 954272768.000000, d: -3.578914e-02)
20:35:56  FPR8 bfdffffef20a4123 (f: 4060758272.000000, d: -4.999997e-01)
20:35:56  FPR9 bfd00ea348b88334 (f: 1220051712.000000, d: -2.508934e-01)
20:35:56  FPR10 bfdff449cc548c9b (f: 3428093184.000000, d: -4.992852e-01)
20:35:56  FPR11 0000000000013600 (f: 79360.000000, d: 3.920905e-319)
20:35:56  FPR12 000000000027b1c9 (f: 2601417.000000, d: 1.285271e-317)
20:35:56  FPR13 0000000040d9429b (f: 1087980160.000000, d: 5.375336e-315)
20:35:56  FPR14 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR16 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR17 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR18 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR19 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR20 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR21 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR22 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR23 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR24 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR25 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR26 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR27 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR28 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR29 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR30 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  FPR31 0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:35:56  
20:35:56  Compiled_method=jdk/internal/foreign/abi/AbstractLinker.downcallHandle0(Ljava/lang/foreign/FunctionDescriptor;[Ljava/lang/foreign/Linker$Option;)Ljava/lang/invoke/MethodHandle;
20:35:56  Target=2_90_20230918_64 (Linux 4.18.0-486.el8.ppc64le)
20:35:56  CPU=ppc64le (4 logical CPUs) (0x1dbc00000 RAM)
20:35:56  ----------- Stack Backtrace -----------
20:35:56   (0x00007FFF86BB369C [<unknown>+0x0])
20:35:56  runJavaThread+0x250 (0x00007FFFA6A37F70 [libj9vm29.so+0x17f70])
20:35:56  javaProtectedThreadProc+0xc8 (0x00007FFFA6AD6368 [libj9vm29.so+0xb6368])
20:35:56  omrsig_protect+0x3e4 (0x00007FFFA698ABB4 [libj9prt29.so+0x3abb4])
20:35:56  javaThreadProc+0x60 (0x00007FFFA6AD1AC0 [libj9vm29.so+0xb1ac0])
20:35:56  thread_wrapper+0x190 (0x00007FFFA691D820 [libj9thr29.so+0xd820])
20:35:56  start_thread+0xf8 (0x00007FFFA7459678 [libpthread-2.28.so+0x9678])
20:35:56  clone+0x74 (0x00007FFFA7348738 [libc-2.28.so+0x138738])
20:35:56  ---------------------------------------

@0xdaryl
Copy link
Contributor

0xdaryl commented Sep 26, 2023

Henry (@hzongaro), could you post a brief status update on this JDK 21 issue and the outlook for JDK 21 please? Thanks.

@hzongaro
Copy link
Member

I haven't investigated further since last time, but I'll spend some time on it this week. I think I should be able to have a fix ready for JDK 21.

@hzongaro
Copy link
Member

hzongaro commented Oct 2, 2023

I spent some time producing logs running TestLoaderLookup.java locally, just to see whether the circumstances involving instances of jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000 being allocated and then stored to via a field AbstractLinker$$Lambda/0x0000000000000000.arg$1 that is part of a different class might be seen even without escape analysis attempting to stack allocate it. I found that I did see that situation running with:

TKG_ITERATIONS=3 \
TR_EnableStartupNextGenHCRAtAllOpts=yes \
TESTIMAGE_PATH=${MYDIR}/openj9-openjdk-jdk21/build/linux-x86_64-server-release/images/test \
TEST_JDK_HOME=${MYDIR}/openj9-openjdk-jdk21/build/linux-x86_64-server-release/jdk \
BUILD_LIST=openjdk \
TARGET=jdk_foreign_1 \
JDK_CUSTOM_TARGET=java/foreign/loaderLookup/TestLoaderLookup.java \
make _jdk_custom EXTRA_OPTIONS="-Xjit:{jdk/internal/foreign/abi/AbstractLinker.downcallHandle0*}(log=${MYDIR}/downcallhandle0.log,traceGlobalVP,traceInlining,traceILGen,traceBC,traceEscapeAnalysis,traceVPConstraints,tryToInline={*AbstractLinker.stripNames*}),verbose,vlog=${MYDIR}/vlog.txt,disableAsyncCompilation"

I found that before Global Value Propagation, two (amongst several) object allocations being performed through Unsafe.allocateInstance that were then transformed to jitNewObject by Global VP:

n2076n      aloadi  unknown field[#801  Shadow] (obj7) [flags 0x80000607 0x0 ]                [0x7fe6232578a0] bci=[21,7,278] rc=11 vc=926 vn=154 li=- udi=- nc=1
n2075n        aladd (X>=0 internalPtr )                                                       [0x7fe623257850] bci=[21,7,278] rc=1 vc=926 vn=153 li=- udi=- nc=2 flg=0x8100
n2068n          aload  <callSite entry @9     0x2a9a48>[#800  Static] (obj24) [flags 0x307 0x8 ]  [0x7fe623257620] bci=[21,7,278] rc=1 vc=926 vn=152 li=- udi=- nc=0
n2074n          lconst 12 (highWordZero X!=0 X>=0 )                                           [0x7fe623257800] bci=[21,7,278] rc=1 vc=926 vn=36 li=- udi=- nc=0 flg=0x4104
...
n2288n    astore  dmh<auto slot 1>[#851  Auto] [flags 0x7 0x0 ]                               [0x7fe62325bae0] bci=[28,4,500] rc=0 vc=926 vn=154 li=147 udi=59 nc=1
n2076n      ==>aloadi
n2292n    NULLCHK on n2290n [#32]                                                             [0x7fe62325bc20] bci=[28,9,501] rc=0 vc=926 vn=160 li=- udi=- nc=1
n2291n      aloadi  java/lang/invoke/DirectMethodHandle$Constructor.instanceClass Ljava/lang/Class;[#740  final Shadow +48] [flags 0x20607 0x0 ]  [0x7fe62325bbd0] bci=[28,9,501] rc=3 vc=926 vn=159 li=- udi=- nc=1
n2290n        aload  dmh<auto slot 1>[#851  Auto] [flags 0x7 0x0 ] (X>=0 )                    [0x7fe62325bb80] bci=[28,8,501] rc=1 vc=926 vn=154 li=447 udi=414 nc=0 flg=0x100
...
n2292n    NULLCHK on n2290n [#32]                                                             [0x7fe62325bc20] bci=[28,9,501] rc=0 vc=926 vn=160 li=- udi=- nc=1
n2291n      aloadi  java/lang/invoke/DirectMethodHandle$Constructor.instanceClass Ljava/lang/Class;[#740  final Shadow +48] [flags 0x20607 0x0 ]  [0x7fe62325bbd0] bci=[28,9,501] rc=3 vc=926 vn=159 li=- udi=- nc=1
n2290n        aload  dmh<auto slot 1>[#851  Auto] [flags 0x7 0x0 ] (X>=0 )                    [0x7fe62325bb80] bci=[28,8,501] rc=1 vc=926 vn=154 li=447 udi=414 nc=0 flg=0x100
n2294n    compressedRefs                                                                      [0x7fe62325bcc0] bci=[28,9,501] rc=0 vc=926 vn=1101 li=- udi=- nc=2
n2291n      ==>aloadi
n2293n      lconst 0 (highWordZero X==0 X>=0 X<=0 )                                           [0x7fe62325bc70] bci=[28,9,501] rc=1 vc=926 vn=16 li=- udi=- nc=0 flg=0x4302
n2296n    NULLCHK on n2289n [#32]                                                             [0x7fe62325bd60] bci=[28,12,501] rc=0 vc=926 vn=162 li=- udi=- nc=1
n2295n      acall  jdk/internal/misc/Unsafe.allocateInstance(Ljava/lang/Class;)Ljava/lang/Object;[#854  final native virtual Method -272] [flags 0x20500 0x0 ]  [0x7fe62325bd10] bci=[28,12,501] rc=2 vc=926 vn=163 li=- udi=- nc=2
n2289n        aload  java/lang/invoke/MethodHandleStatics.UNSAFE Ljdk/internal/misc/Unsafe;[#739  final Static] (obj23) [flags 0x20307 0x0 ]  [0x7fe62325bb30] bci=[28,5,501] rc=1 vc=926 vn=161 li=- udi=- nc=0
n2291n        ==>aloadi
...
n2299n    astore  <auto slot 2>[#838  Auto] [flags 0x7 0x0 ]                                  [0x7fe62325be50] bci=[27,4,-] rc=0 vc=926 vn=163 li=148 udi=60 nc=1
n2295n      ==>acall
...
n2323n    compressedRefs                                                                      [0x7fe62325c5d0] bci=[30,6,-] rc=0 vc=926 vn=1127 li=- udi=- nc=2
n2321n      awrtbari  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000.arg$1 Ljava/lang/foreign/FunctionDescriptor;[#859  final Shadow +8] [flags 0xa0607 0x0 ] ()  [0x7fe62325c530] bci=[30,6,-] rc=1 vc=926 vn=2 li=- udi=- nc=3 flg=0x20
n2319n        aload  <auto slot 2>[#838  Auto] [flags 0x7 0x0 ] (X!=0 X>=0 )                  [0x7fe62325c490] bci=[30,4,-] rc=2 vc=926 vn=163 li=455 udi=422 nc=0 flg=0x104
n2320n        aload  function<parm 1 Ljava/lang/foreign/FunctionDescriptor;>[#421  Parm] [flags 0x40000107 0x0 ]  [0x7fe62325c4e0] bci=[30,5,-] rc=1 vc=926 vn=2 li=456 udi=423 nc=0
n2319n        ==>aload
...
n2094n    compressedRefs                                                                      [0x7fe623257e40] bci=[21,16,279] rc=0 vc=926 vn=1213 li=- udi=- nc=2
n2092n      aloadi  unknown field[#809  Shadow] (obj8) [flags 0x80000607 0x0 ]                [0x7fe623257da0] bci=[21,16,279] rc=11 vc=926 vn=201 li=- udi=- nc=1
n2091n        aladd (X>=0 internalPtr )                                                       [0x7fe623257d50] bci=[21,16,279] rc=1 vc=926 vn=200 li=- udi=- nc=2 flg=0x8100
n2084n          aload  <callSite entry @10     0x2a9a50>[#808  Static] (obj25) [flags 0x307 0x8 ]  [0x7fe623257b20] bci=[21,16,279] rc=1 vc=926 vn=199 li=- udi=- nc=0
n2090n          lconst 12 (highWordZero X!=0 X>=0 )                                           [0x7fe623257d00] bci=[21,16,279] rc=1 vc=926 vn=36 li=- udi=- nc=0 flg=0x4104
n2093n      lconst 0 (highWordZero X==0 X>=0 X<=0 )                                           [0x7fe623257df0] bci=[21,16,279] rc=1 vc=926 vn=16 li=- udi=- nc=0 flg=0x4302
...
n2583n    astore  dmh<auto slot 1>[#904  Auto] [flags 0x7 0x0 ]                               [0x7fe6233f1720] bci=[38,4,500] rc=0 vc=926 vn=201 li=164 udi=79 nc=1
n2092n      ==>aloadi
...
n2587n    NULLCHK on n2585n [#32]                                                             [0x7fe6233f1860] bci=[38,9,501] rc=0 vc=926 vn=207 li=- udi=- nc=1
n2586n      aloadi  java/lang/invoke/DirectMethodHandle$Constructor.instanceClass Ljava/lang/Class;[#740  final Shadow +48] [flags 0x20607 0x0 ]  [0x7fe6233f1810] bci=[38,9,501] rc=3 vc=926 vn=206 li=- udi=- nc=1
n2585n        aload  dmh<auto slot 1>[#904  Auto] [flags 0x7 0x0 ] (X>=0 )                    [0x7fe6233f17c0] bci=[38,8,501] rc=1 vc=926 vn=201 li=480 udi=450 nc=0 flg=0x100
...
n2591n    NULLCHK on n2584n [#32]                                                             [0x7fe6233f19a0] bci=[38,12,501] rc=0 vc=926 vn=209 li=- udi=- nc=1
n2590n      acall  jdk/internal/misc/Unsafe.allocateInstance(Ljava/lang/Class;)Ljava/lang/Object;[#907  final native virtual Method -272] [flags 0x20500 0x0 ]  [0x7fe6233f1950] bci=[38,12,501] rc=2 vc=926 vn=210 li=- udi=- nc=2
n2584n        aload  java/lang/invoke/MethodHandleStatics.UNSAFE Ljdk/internal/misc/Unsafe;[#739  final Static] (obj23) [flags 0x20307 0x0 ]  [0x7fe6233f1770] bci=[38,5,501] rc=1 vc=926 vn=208 li=- udi=- nc=0
n2586n        ==>aloadi
n2594n    astore  <auto slot 2>[#891  Auto] [flags 0x7 0x0 ]                                  [0x7fe6233f1a90] bci=[37,4,-] rc=0 vc=926 vn=210 li=165 udi=80 nc=1
n2590n      ==>acall
...
n2618n    compressedRefs                                                                      [0x7fe6233f2210] bci=[40,6,-] rc=0 vc=926 vn=1245 li=- udi=- nc=2
n2616n      awrtbari  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000.arg$1 Ljava/lang/foreign/FunctionDescriptor;[#859  final Shadow +8] [flags 0xa0607 0x0 ] ()  [0x7fe6233f2170] bci=[40,6,-] rc=1 vc=926 vn=2 li=- udi=- nc=3 flg=0x20
n2614n        aload  <auto slot 2>[#891  Auto] [flags 0x7 0x0 ] (X!=0 X>=0 )                  [0x7fe6233f20d0] bci=[40,4,-] rc=2 vc=926 vn=210 li=488 udi=458 nc=0 flg=0x104
n2615n        aload  function<parm 1 Ljava/lang/foreign/FunctionDescriptor;>[#421  Parm] [flags 0x40000107 0x0 ]  [0x7fe6233f2120] bci=[40,5,-] rc=1 vc=926 vn=2 li=489 udi=459 nc=0
n2614n        ==>aload
n2617n      lconst 0 (highWordZero X==0 X>=0 X<=0 )                                           [0x7fe6233f21c0] bci=[40,6,-] rc=1 vc=926 vn=16 li=- udi=- nc=0 flg=0x4302

Global Value Propagation transforms those two calls to Unsafe.allocateInstance into jitNewObject operations:

n2295n      new  jitNewObject[#91  helper Method] [flags 0x400 0x0 ]                          [0x7fe62325bd10] bci=[28,12,501] rc=2 vc=930 vn=163 li=- udi=- nc=1
n6392n        loadaddr  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000[#1422  Static] [flags 0x18307 0x0 ]  [0x7fe623b6bdb0] bci=[28,12,501] rc=1 vc=0 vn=2678 li=- udi=- nc=0

and

n2590n      new  jitNewObject[#91  helper Method] [flags 0x400 0x0 ]                          [0x7fe6233f1950] bci=[38,12,501] rc=2 vc=930 vn=210 li=- udi=- nc=1
n6428n        loadaddr  jdk/internal/foreign/abi/AbstractLinker$$Lambda/0x0000000000000000[#1426  Static] [flags 0x18307 0x0 ]  [0x7fe623b6c8f0] bci=[38,12,501] rc=1 vc=0 vn=2714 li=- udi=- nc=0

The j9class for n6392n is 0x2AD000, while the j9class for n6428n is 0x2AD300. Both awrtbari instructions at n2321n and n2616n, however, use the same field shadow symbol, and when EA queries which class owns that field it gets back 0x2AD000, which it finds is not an instance of the j9class 0x2AD300.

@nbhuiyan
Copy link
Member

nbhuiyan commented Nov 6, 2023

Using the fix in #18374, 100X Grinder of TestLoaderLookup.java and 100X Grinder running jdk_foreign_0 all passed.

@hzongaro
Copy link
Member

hzongaro commented Nov 9, 2023

The problem with recognizing whether fields in hidden classes are the same was fixed by pull request #18374. That bug resulted in trees that expose the latent bug in Escape Analysis that resulted in the crash first reported in this issue. That latent bug is still present, so I will leave this issue open until that bug is fixed, but I will move this issue to release-0.44, as it's unlikely to be seen.

@hzongaro
Copy link
Member

Closing this issue. The bug that ultimately caused the test failure was fixed under pull request #18374. The latent bug in Escape Analysis described in a comment above will be tracked under issue #19148.

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

No branches or pull requests

5 participants