Skip to content

abbs Segmentation error jitAMultiNewArray IOException: Bad file descriptor NegativeArraySizeExceptionย #22757

Closed

Description

@pshipton

http://vmfarm.rtp.raleigh.ibm.com/job_output.php?id=115399317
[Linux S390 64bit] 80 Load_Level_2.abbs.5mins.Mode107
-Xgcpolicy:optthruput -Xdebug -Xrunjdwp:transport=dt_socket,address=8888,server=y,onthrow=no.pkg.foo,launch=echo -Xjit:count=0 -Xnocompressedrefs

50x grinder - failed 2/50
http://vmfarm.rtp.raleigh.ibm.com/job_output.php?id=115412348 which is different, see below
http://vmfarm.rtp.raleigh.ibm.com/job_output.php?id=115412371

75x grinder on previous build (104097) http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=104128- more failures
Working backwards
104068 http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=104131 - 1 failure
104059 containing eclipse-omr/omr#7962 http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=104135 - 4 failures
104021 containing #22548 http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=104138 - 2 x NegativeArraySizeException failure
103992 http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=104142 - passed

j> 08:47:27 Type=Segmentation error vmState=0x00000000
j> 08:47:27 J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
j> 08:47:27 Handler1=000003FF8E9D7EA0 Handler2=000003FF8E72AD48 InaccessibleAddress=0000040314150000
j> 08:47:27 gpr0=0000000000000000 gpr1=00000003FFFFFFFC gpr2=000003FF0C5D5A00 gpr3=000003FF3008FD00
j> 08:47:27 gpr4=0000000000000000 gpr5=00000000FFFFFFFF gpr6=000003FF14150E68 gpr7=0000000000000000
j> 08:47:27 gpr8=0000000000000001 gpr9=00000000FFFFFFFF gpr10=000003FF88043E00 gpr11=000003FF0C5D5A00
j> 08:47:27 gpr12=000003FF3008FD00 gpr13=000003FF8CEEC2E0 gpr14=000003FF8E9B5BE0 gpr15=000003FEE6B2C248
j> 08:47:27 psw=000003FF8E9B56C2 mask=0705200180000000 fpc=00080000 bea=000003FF8E9B5BDA
j> 08:47:27 fpr0=42c223f74ee6a582 (f: 1323738496.000000, d: 3.989136e+13)
j> 08:47:27 fpr1=3fe62e42fefa39ef (f: 4277811712.000000, d: 6.931472e-01)
j> 08:47:27 fpr2=4031b2b4f0fe7bca (f: 4043209728.000000, d: 1.769807e+01)
j> 08:47:27 fpr3=0000000000000007 (f: 7.000000, d: 3.458460e-323)
j> 08:47:27 fpr4=3f22ae1b3ee5a152 (f: 1055236416.000000, d: 1.425179e-04)
j> 08:47:27 fpr5=000003ff14017110 (f: 335638784.000000, d: 2.170968e-311)
j> 08:47:27 fpr6=bfdfbec61cb78ee7 (f: 481791712.000000, d: -4.960189e-01)
j> 08:47:27 fpr7=ae3867cc8eaef090 (f: 2393829632.000000, d: -4.907365e-86)
j> 08:47:27 fpr8=000003ff8e889208 (f: 2391314944.000000, d: 2.171983e-311)
j> 08:47:27 fpr9=0000000000000000 (f: 0.000000, d: 0.000000e+00)
j> 08:47:27 fpr10=000003ff0c5c6650 (f: 207382096.000000, d: 2.170904e-311)
j> 08:47:27 fpr11=000003ffff37df38 (f: 4281851648.000000, d: 2.172917e-311)
j> 08:47:27 fpr12=000003fee6b2d910 (f: 3870480640.000000, d: 2.170592e-311)
j> 08:47:27 fpr13=000002aa20fa8970 (f: 553290112.000000, d: 1.447474e-311)
j> 08:47:27 fpr14=0000000000041000 (f: 266240.000000, d: 1.315400e-318)
j> 08:47:27 fpr15=000003ffff37ce70 (f: 4281847296.000000, d: 2.172917e-311)
j> 08:47:27 Module=/j9vm/ascii/builds/bld_104112/sdk/xz6480/jre/lib/s390x/default/libj9vm29.so
j> 08:47:27 Module_base_address=000003FF8E900000
j> 08:47:27 Target=2_90_20251009_104112 (Linux 4.18.0-553.77.1.el8_10.s390x)
j> 08:47:27 CPU=s390x (4 logical CPUs) (0x1f6614000 RAM)
j> 08:47:27 ----------- Stack Backtrace -----------
j> 08:47:27 allocate_dimension+0x32 (0x000003FF8E9B56C2 [libj9vm29.so+0xb56c2])
j> 08:47:27 helperMultiANewArray+0x108 (0x000003FF8E9B5BE0 [libj9vm29.so+0xb5be0])
j> 08:47:27 old_slow_jitAMultiNewArray+0x130 (0x000003FF8D9E1700 [libj9jit29.so+0xae1700])
j> 08:47:27 jitAMultiNewArray+0x6e (0x000003FF8D9F814E [libj9jit29.so+0xaf814e])
j> 08:47:27 ---------------------------------------
j> 08:47:27 JVMDUMP039I Processing dump event "gpf", detail "" at 2025/10/09 08:47:27 - please wait.
j> 08:47:27 JVMDUMP032I JVM requested System dump using '/tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/core.20251009.084727.1043628.0001.dmp' in response to an event
p> 20251009-08:47:27 Dump /tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/core.1044011 spotted.
p> 20251009-08:47:27 Attempted to collect /proc/pid/maps and /proc/pid/smaps
j> 08:47:32 JVMDUMP010I System dump written to /tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/core.20251009.084727.1043628.0001.dmp
j> 08:47:32 JVMDUMP032I JVM requested Java dump using '/tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/javacore.20251009.084727.1043628.0002.txt' in response to an event
p> 20251009-08:47:32 Dump /tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/core.20251009.084727.1043628.0001.dmp spotted.
p> 20251009-08:47:33 Attempted to collect /proc/pid/maps and /proc/pid/smaps
p> 20251009-08:47:33 Dump /tmp/bld_104112/abbs.5mins/115399317/JLTF-jgrinder-abbs-mode107-20251009-0846/javacore.20251009.084727.1043628.0002.txt spotted.
j> 08:47:36 20251009 08:47:35 <Primary|SimpleDriver|testcases.serialization.SerializationBasicHFS(dumponfailure)|544|Default Invocant> ERROR: JGrinder testcase failed.
j> 08:47:36 Testcase return code was 4
j> 08:47:36 
j> 08:47:36 Throwable trace:
j> 08:47:36 java.io.IOException: Bad file descriptor
j> 08:47:36 	at java.io.FileOutputStream.writeBytes(Native Method)
j> 08:47:36 	at java.io.FileOutputStream.write(FileOutputStream.java:387)
j> 08:47:36 	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1944)
j> 08:47:36 	at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1853)
j> 08:47:36 	at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:264)
j> 08:47:36 	at testcases.serialization.SerializationBasicHFS.run(SerializationBasicHFS.java:79)

http://vmfarm.rtp.raleigh.ibm.com/job_output.php?id=115412348

j> 16:51:39 20251009 16:51:39 Result Summary ERROR: Primary|SimpleDriver|testcases.benchmarks.jbytemark.jBYTEmark(nnet,dumponfailure)|407|Default Invocant reported failed with message: java.lang.NegativeArraySizeException: -66952648
j> 16:51:39 	at testcases.benchmarks.jbytemark.NeuralNetTest.<init>(NeuralNetTest.java:177)
j> 16:51:39 	at testcases.benchmarks.jbytemark.jBYTEmark.run(jBYTEmark.java:163)

Activity

  1. added
    segfault
    on Oct 9, 2025
  2. pshipton commented on Oct 9, 2025

    @pshipton
    MemberAuthor

    @hzongaro @r30shah (not sure if it's restricted to Z) pls take a look at this regression.

  3. r30shah commented on Oct 9, 2025

    @r30shah
    Contributor

    @ehsankianifar Pls take a look at the failures.

  4. r30shah commented on Oct 9, 2025

    @r30shah
    Contributor

    This is most likely related to the mutianewarcay evaluator changes in #22548

    @ehsankianifar Please confirm if it is related to the changes and if it is, pls investigate if it can be fixed soon, else we can backout the changes while we investigate.

  5. ehsankianifar commented on Oct 9, 2025

    @ehsankianifar
    Contributor

    Probably related to recently merged amultinewarray evaluator changes I did. I am looking at it.

  6. ehsankianifar commented on Oct 9, 2025

    @ehsankianifar
    Contributor

    The top Jit frame in the stack slots show that we failed inline allocation and jumped to the helper call (pc value is the helper call for multianewarray allocation):

    <3ff0c5d5a00> JIT frame: bp = 0x000003FF14150EF0, pc = 0x000003FF58B6A96C, unwindSP = 0x000003FF14150DE0, cp = 0x000003FF88DEF2E0, arg0EA = 0x000003FF14150F00, jitInfo = 0x000003FF57E34038
    <3ff0c5d5a00> 	Method: testcases/benchmarks/jbytemark/NeuralNetTest.<init>(Ltestcases/benchmarks/jbytemark/BMglobals;)V !j9method 0x000003FF88F72268
    <3ff0c5d5a00> 	Bytecode index = 192, inlineDepth = 0, PC offset = 0x0000000000004978
    <3ff0c5d5a00> 	stackMap=0x000003FF57E345AA, slots=I16(0x0002) parmBaseOffset=I16(0x0008), parmSlots=U16(0x0002), localBaseOffset=I16(0xFFA0)
    <3ff0c5d5a00> 	Described JIT args starting at 0x000003FF14150EF8 for U16(0x0002) slots
    <3ff0c5d5a00> 		O-Slot: : a1[0x000003FF14150EF8] = 0x000003FF6871AC98
    <3ff0c5d5a00> 		O-Slot: : a0[0x000003FF14150F00] = 0x000003FF68ED8548
    <3ff0c5d5a00> 	Described JIT temps starting at 0x000003FF14150E90 for IDATA(0x000000000000000C) slots
    <3ff0c5d5a00> 		O-Slot: : t11[0x000003FF14150E90] = 0x0000000000000000
    <3ff0c5d5a00> 		O-Slot: : t10[0x000003FF14150E98] = 0x0000000000000000
    <3ff0c5d5a00> 		O-Slot: : t9[0x000003FF14150EA0] = 0x000003FF68ED8548
    <3ff0c5d5a00> 		I-Slot: : t8[0x000003FF14150EA8] = 0x000003FF00000008
    <3ff0c5d5a00> 		I-Slot: : t7[0x000003FF14150EB0] = 0x0000000000000050
    <3ff0c5d5a00> 		I-Slot: : t6[0x000003FF14150EB8] = 0x0000000000000050
    <3ff0c5d5a00> 		O-Slot: : t5[0x000003FF14150EC0] = 0x000003FF68ED8548
    <3ff0c5d5a00> 		I-Slot: : t4[0x000003FF14150EC8] = 0x000003FF00000023
    <3ff0c5d5a00> 		I-Slot: : t3[0x000003FF14150ED0] = 0x0000000788F72268
    <3ff0c5d5a00> 		I-Slot: : t2[0x000003FF14150ED8] = 0x000003FF00000005
    <3ff0c5d5a00> 		I-Slot: : t1[0x000003FF14150EE0] = 0x000003FF5881DD08
    <3ff0c5d5a00> 		I-Slot: : t0[0x000003FF14150EE8] = 0x000003FF5881DD08
    <3ff0c5d5a00> 	JIT-RegisterMap = UDATA(0x0000000000000080)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C660] = UDATA(0x0000000000000007) (jit_r0)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C668] = UDATA(0x000003FF3008FD00) (jit_r1)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C670] = UDATA(0x000003FF00000000) (jit_r2)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C678] = UDATA(0x000003FF14150E68) (jit_r3)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C680] = UDATA(0x000003FF00000023) (jit_r4)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C688] = UDATA(0x000003FF14150DE0) (jit_r5)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C690] = UDATA(0x000003FF58B6ADC0) (jit_r6)
    <3ff0c5d5a00> 		JIT-RegisterMap-O-Slot[0x000003FEE6B2C698] = 0x000003FF6871AC98 (jit_r7)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6A0] = UDATA(0x000003FF695916E8) (jit_r8)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6A8] = UDATA(0x000003FF14150E60) (jit_r9)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6B0] = UDATA(0x000003FF695919B8) (jit_r10)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6B8] = UDATA(0x000003FF14150E68) (jit_r11)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6C0] = UDATA(0x000003FF3008FD00) (jit_r12)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6C8] = UDATA(0x000003FF0C5D5A00) (jit_r13)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6D0] = UDATA(0x000003FF58B6A96C) (jit_r14)
    <3ff0c5d5a00> 		JIT-RegisterMap-I-Slot[0x000003FEE6B2C6D8] = UDATA(0x0000000000000000) (jit_r15)
    

    R2 suppose to have the dimensions value in its lower 32 bits but the register map show 0! From the pc value I find the helper call code snippet and it show that the "Dimentions" parameter is not evaluated properly!
    here is the helper call snippet in core dump that we expect the dimensions parameter in GPR2:

    0x3ff58b6a926 jitMethod +18738               e33050d00024 stg       %r3, 0xd0(%r5)  <<< +1830 (0x3ff58b6671a)
    0x3ff58b6a92c jitMethod +18744               b904003b     lgr       %r3, %r11
    0x3ff58b6a930 jitMethod +18748               e3b050e00004 lg        %r11, 0xe0(%r5)
    0x3ff58b6a936 jitMethod +18754               e31050e00024 stg       %r1, 0xe0(%r5)
    0x3ff58b6a93c jitMethod +18760               e3e050d80024 stg       %r14, 0xd8(%r5)
    0x3ff58b6a942 jitMethod +18766               b904001c     lgr       %r1, %r12
    0x3ff58b6a946 jitMethod +18770               e39050f80024 stg       %r9, 0xf8(%r5)
    0x3ff58b6a94c jitMethod +18776               e34050e80024 stg       %r4, 0xe8(%r5)
    0x3ff58b6a952 jitMethod +18782               b9040092     lgr       %r9, %r2
    0x3ff58b6a956 jitMethod +18786               500050f0     st        %r0, 0xf0(%r5)
    0x3ff58b6a95a jitMethod +18790               b904002b     lgr       %r2, %r11
    0x3ff58b6a95e jitMethod +18794               b90400b3     lgr       %r11, %r3
    0x3ff58b6a962 jitMethod +18798               b90400c1     lgr       %r12, %r1
    0x3ff58b6a966 jitMethod +18802  -1:192       c0e51a746bbd brasl     %r14, 0x3ff8d9f80e0 // multianewarray 17 dims 2 [[D
    0x3ff58b6a96c jitMethod +18808               58e050f0     l         %r14, 0xf0(%r5)
    0x3ff58b6a970 jitMethod +18812               e34050e80004 lg        %r4, 0xe8(%r5)
    

    the inline evaluator code from core dump:

    0x3ff58b66636 jitMethod +1602               e38050d80004 lg        %r8, 0xd8(%r5)  <<< +1544 +1594 ^+18984
    0x3ff58b6663c jitMethod +1608               e39050d00004 lg        %r9, 0xd0(%r5)
    0x3ff58b66642 jitMethod +1614               e3a050c80004 lg        %r10, 0xc8(%r5)
    0x3ff58b66648 jitMethod +1620               e3b010d80024 stg       %r11, 0xd8(%r1)
    0x3ff58b6664e jitMethod +1626               e31050c00024 stg       %r1, 0xc0(%r5)
    0x3ff58b66654 jitMethod +1632               5080509c     st        %r8, 0x9c(%r5)
    0x3ff58b66658 jitMethod +1636               50a050a0     st        %r10, 0xa0(%r5)
    0x3ff58b6665c jitMethod +1640               50a05088     st        %r10, 0x88(%r5)
    0x3ff58b66660 jitMethod +1644               e3a050c80024 stg       %r10, 0xc8(%r5)
    0x3ff58b66666 jitMethod +1650               5080508c     st        %r8, 0x8c(%r5)
    0x3ff58b6666a jitMethod +1654               41b05088     la        %r11, 0x88(%r5)
    0x3ff58b6666e jitMethod +1658               a7a90010     lghi      %r10, 0x10
    0x3ff58b66672 jitMethod +1662               e330b0040032 ltgf      %r3, 4(%r11)
    0x3ff58b66678 jitMethod +1668          *    a784001f     je        0x3ff58b666b6 C>> +1730
    0x3ff58b6667c jitMethod +1672          |*   a744004f     jl        0x3ff58b6671a C>> +1830
    0x3ff58b66680 jitMethod +1676          ||   e3e0b0000032 ltgf      %r14, 0(%r11)
    0x3ff58b66686 jitMethod +1682          ||   e3e0b0000014 lgf       %r14, 0(%r11)
    0x3ff58b6668c jitMethod +1688          ||   8be00003     sla       %r14, 3
    0x3ff58b66690 jitMethod +1692          ||*  a7840008     je        0x3ff58b666a0 C>> +1708
    0x3ff58b66694 jitMethod +1696          |||* a7540043     jnhe      0x3ff58b6671a C>> +1830
    0x3ff58b66698 jitMethod +1700          |||| a7eb0010     aghi      %r14, 0x10
    0x3ff58b6669c jitMethod +1704          |||| b90400ae     lgr       %r10, %r14
    0x3ff58b666a0 jitMethod +1708          ||>| b90400ea     lgr       %r14, %r10 <<< +1692
    0x3ff58b666a4 jitMethod +1712          || | b90c00a3     msgr      %r10, %r3
    0x3ff58b666a8 jitMethod +1716          || | eb330003000d sllg      %r3, %r3, 3
    0x3ff58b666ae jitMethod +1722          || | a73b0010     aghi      %r3, 0x10
    0x3ff58b666b2 jitMethod +1726          || | b90a00a3     algr      %r10, %r3
    0x3ff58b666b6 jitMethod +1730          >| | e380d0600004 lg        %r8, 0x60(%r13)  J9VMThread.heapAlloc <<< +1668
    0x3ff58b666bc jitMethod +1736           | | b90a00a8     algr      %r10, %r8
    0x3ff58b666c0 jitMethod +1740          *| | a7b4002d     jnl       0x3ff58b6671a C>> +1830
    0x3ff58b666c4 jitMethod +1744          || | e3a0d0680021 clg       %r10, 0x68(%r13)  J9VMThread.heapTop
    0x3ff58b666ca jitMethod +1750          ||*| a7240028     jh        0x3ff58b6671a C>> +1830
    0x3ff58b666ce jitMethod +1754          |||| e3a0d0600024 stg       %r10, 0x60(%r13)  J9VMThread.heapAlloc
    0x3ff58b666d4 jitMethod +1760          |||| e320b0000004 lg        %r2, 0(%r11)
    0x3ff58b666da jitMethod +1766          |||| e3c080000024 stg       %r12, 0(%r8)
    0x3ff58b666e0 jitMethod +1772          |||| 50208008     st        %r2, 8(%r8)
    0x3ff58b666e4 jitMethod +1776          |||| ec28001d007f clije     %r2, 0, 0x3ff58b6671e C>> +1834
    0x3ff58b666ea jitMethod +1782          |||| 41383000     la        %r3, 0(%r8, %r3)
    0x3ff58b666ee jitMethod +1786          |||| e3c0c0580004 lg        %r12, 0x58(%r12)
    0x3ff58b666f4 jitMethod +1792          |||| 41a08010     la        %r10, 0x10(%r8)
    0x3ff58b666f8 jitMethod +1796          |||| e3c030000024 stg       %r12, 0(%r3) <<< ^+1822
    0x3ff58b666fe jitMethod +1802          |||| e320300800cb stfh      %r2, 8(%r3)
    0x3ff58b66704 jitMethod +1808          |||| e330a0000024 stg       %r3, 0(%r10)
    0x3ff58b6670a jitMethod +1814          |||| b91a003e     algfr     %r3, %r14
    0x3ff58b6670e jitMethod +1818          |||| 41a0a008     la        %r10, 8(%r10)
    0x3ff58b66712 jitMethod +1822          |||| a726fff3     brct      %r2, 0x3ff58b666f8 C>> ^+1796
    0x3ff58b66716 jitMethod +1826          |||| a7f40004     j         0x3ff58b6671e U>> +1834
    0x3ff58b6671a jitMethod +1830          >>>> a7f42106     j         0x3ff58b6a926 U>> +18738  <<< +1672 +1696 +1740 +1750
    

    Since the dimension count is always 2 (otherwise we do not inline). We do not need to evaluate the dimensions child for the inline code. If the reference count of the child is 1, we do not even evaluate it and let the helper builder evaluate it. In this case though, it was not evaluated neither in inline evaluator nor in helper dispatch sequence.
    I try to find what is happening.

  7. ehsankianifar commented on Oct 9, 2025

    @ehsankianifar
    Contributor

    We have two or more multiANewArray trees. When we evaluate the nodes for all trees the reference count of the second child (dimsRegister) is more than 1 so we evaluate it. The dispatch call snippet properly bind it to the parameters. For the last tree that gets evaluated, the reference count is 1 so we don't evaluate it and the dispatch call sequence ignores that parameter since it was evaluated before! The expected parameter register however, doesn't have the correct value since it was originally evaluated in a non R2 register and the helper dispatch was not called in the previous trees to copy the register to the correct register (R2).
    I think we must always evaluate all the children regardless of the reference count.

  8. r30shah commented on Oct 9, 2025

    @r30shah
    Contributor

    @ehsankianifar I do not agree with the analysis. Irrespective of the node being evaluated or not, I think performCall should evaluate all the children and use deps to assign appropriate regs before call. It should be investigated why it did not do it for the second time. So If the Ref count of node is 2 in first anewarray - We should have evaluated in mainline before ICF. When it reaches the second anewarray - perform call function should call evaluate on the dimensions node and use pre-deps to set it to proper reg before making the call.

    Can you share the log file.

  9. ehsankianifar commented on Oct 10, 2025

    @ehsankianifar
    Contributor

    The RA store and load the DimRegister inside the OOL dispatch code instead of the inline code. As a result the register would have the correct value only if the OOL of each alloc tree was executed. This is the last two alloc code snippets from the core file and as you can see, in the first snippet, R8 is the dims register. In the OOL dispatch of the first tree, R8 was saved in 0xe0(%r5) and in the OOL of the second tree it expect to have the dims value in the same location (0xe0(%r5)) but the actual value is zero since the dispatch sequence of the first tree was never executed:

    0x3ff58b6655c               e3a010d00024 stg       %r10, 0xd0(%r1)  <<< ^+19064
    0x3ff58b66562               e31050c00024 stg       %r1, 0xc0(%r5)
    0x3ff58b66568               5080509c     st        %r8, 0x9c(%r5)
    0x3ff58b6656c               509050a0     st        %r9, 0xa0(%r5)
    0x3ff58b66570               50905080     st        %r9, 0x80(%r5)
    0x3ff58b66574               50805084     st        %r8, 0x84(%r5)
    0x3ff58b66578               e38050c80024 stg       %r8, 0xc8(%r5)
    0x3ff58b6657e               41205080     la        %r2, 0x80(%r5)
    0x3ff58b66582               a7390010     lghi      %r3, 0x10
    0x3ff58b66586               b90400ec     lgr       %r14, %r12
    0x3ff58b6658a               e3a020040032 ltgf      %r10, 4(%r2)
    0x3ff58b66590          *    a784001f     je        0x3ff58b665ce C>> +1498
    0x3ff58b66594          |*   a744004f     jl        0x3ff58b66632 C>> +1598
    0x3ff58b66598          ||   e39020000032 ltgf      %r9, 0(%r2)
    0x3ff58b6659e          ||   e39020000014 lgf       %r9, 0(%r2)
    0x3ff58b665a4          ||   8b900003     sla       %r9, 3
    0x3ff58b665a8          ||*  a7840008     je        0x3ff58b665b8 C>> +1476
    0x3ff58b665ac          |||* a7540043     jnhe      0x3ff58b66632 C>> +1598
    0x3ff58b665b0          |||| a79b0010     aghi      %r9, 0x10
    0x3ff58b665b4          |||| b9040039     lgr       %r3, %r9
    0x3ff58b665b8          ||>| b9040093     lgr       %r9, %r3 <<< +1460
    0x3ff58b665bc          || | b90c003a     msgr      %r3, %r10
    0x3ff58b665c0          || | ebaa0003000d sllg      %r10, %r10, 3
    0x3ff58b665c6          || | a7ab0010     aghi      %r10, 0x10
    0x3ff58b665ca          || | b90a003a     algr      %r3, %r10
    0x3ff58b665ce          >| | e3b0d0600004 lg        %r11, 0x60(%r13)  J9VMThread.heapAlloc <<< +1436
    0x3ff58b665d4           | | b90a003b     algr      %r3, %r11
    0x3ff58b665d8          *| | a7b4002d     jnl       0x3ff58b66632 C>> +1598
    0x3ff58b665dc          || | e330d0680021 clg       %r3, 0x68(%r13)  J9VMThread.heapTop
    0x3ff58b665e2          ||*| a7240028     jh        0x3ff58b66632 C>> +1598
    0x3ff58b665e6          |||| e330d0600024 stg       %r3, 0x60(%r13)  J9VMThread.heapAlloc
    0x3ff58b665ec          |||| e38020000004 lg        %r8, 0(%r2)
    0x3ff58b665f2          |||| e3e0b0000024 stg       %r14, 0(%r11)
    0x3ff58b665f8          |||| 5080b008     st        %r8, 8(%r11)
    0x3ff58b665fc          |||| ec88001d007f clije     %r8, 0, 0x3ff58b66636 C>> +1602
    0x3ff58b66602          |||| 41aba000     la        %r10, 0(%r11, %r10)
    0x3ff58b66606          |||| e3e0e0580004 lg        %r14, 0x58(%r14)
    0x3ff58b6660c          |||| 4130b010     la        %r3, 0x10(%r11)
    0x3ff58b66610          |||| e3e0a0000024 stg       %r14, 0(%r10) <<< ^+1590
    0x3ff58b66616          |||| e380a00800cb stfh      %r8, 8(%r10)
    0x3ff58b6661c          |||| e3a030000024 stg       %r10, 0(%r3)
    0x3ff58b66622          |||| b91a00a9     algfr     %r10, %r9
    0x3ff58b66626          |||| 41303008     la        %r3, 8(%r3)
    0x3ff58b6662a          |||| a786fff3     brct      %r8, 0x3ff58b66610 C>> ^+1564
    0x3ff58b6662e          |||| a7f40004     j         0x3ff58b66636 U>> +1602
    0x3ff58b66632          >>>> a7f421b7     j         0x3ff58b6a9a0 U>> +18860  <<< +1440 +1464 +1508 +1518
    
    0x3ff58b6a9a0               e38050e80024 stg       %r8, 0xe8(%r5)  <<< +1598
    0x3ff58b6a9a6               e38050f80004 lg        %r8, 0xf8(%r5)
    0x3ff58b6a9ac               e39050f80024 stg       %r9, 0xf8(%r5)
    0x3ff58b6a9b2               b904009e     lgr       %r9, %r14
    0x3ff58b6a9b6               e34050900024 stg       %r4, 0x90(%r5)
    0x3ff58b6a9bc               e33051000024 stg       %r3, 0x100(%r5)
    0x3ff58b6a9c2               b9040032     lgr       %r3, %r2
    0x3ff58b6a9c6               e31050f00024 stg       %r1, 0xf0(%r5)
    0x3ff58b6a9cc               50005108     st        %r0, 0x108(%r5)
    0x3ff58b6a9d0               b904001c     lgr       %r1, %r12
    0x3ff58b6a9d4               b9040028     lgr       %r2, %r8
    0x3ff58b6a9d8               e38050e00024 stg       %r8, 0xe0(%r5)
    0x3ff58b6a9de               b9040083     lgr       %r8, %r3
    0x3ff58b6a9e2  -1:176       c0e51a746b7f brasl     %r14, 0x3ff8d9f80e0 // multianewarray 17 dims 2 [[D
    0x3ff58b6a9e8               b90400e9     lgr       %r14, %r9
    0x3ff58b6a9ec               58905108     l         %r9, 0x108(%r5)
    0x3ff58b6a9f0               e34050900004 lg        %r4, 0x90(%r5)
    0x3ff58b6a9f6               e33051000004 lg        %r3, 0x100(%r5)
    0x3ff58b6a9fc               e31050f00004 lg        %r1, 0xf0(%r5)
    0x3ff58b6aa02               1809         lr        %r0, %r9
    0x3ff58b6aa04               b9040092     lgr       %r9, %r2
    0x3ff58b6aa08               b9040028     lgr       %r2, %r8
    0x3ff58b6aa0c               e38050e80004 lg        %r8, 0xe8(%r5)
    0x3ff58b6aa12               b90400b9     lgr       %r11, %r9
    0x3ff58b6aa16               e39050f80004 lg        %r9, 0xf8(%r5)
    0x3ff58b6aa1c               a7f4de0d     j         0x3ff58b66636 U>> ^+1602
    
    0x3ff58b66636          >    e38050d80004 lg        %r8, 0xd8(%r5)  <<< +1544 +1594 ^+18984
    0x3ff58b6663c               e39050d00004 lg        %r9, 0xd0(%r5)
    0x3ff58b66642               e3a050c80004 lg        %r10, 0xc8(%r5)
    0x3ff58b66648               e3b010d80024 stg       %r11, 0xd8(%r1)
    0x3ff58b6664e               e31050c00024 stg       %r1, 0xc0(%r5)
    0x3ff58b66654               5080509c     st        %r8, 0x9c(%r5)
    0x3ff58b66658               50a050a0     st        %r10, 0xa0(%r5)
    0x3ff58b6665c               50a05088     st        %r10, 0x88(%r5)
    0x3ff58b66660               e3a050c80024 stg       %r10, 0xc8(%r5)
    0x3ff58b66666               5080508c     st        %r8, 0x8c(%r5)
    0x3ff58b6666a               41b05088     la        %r11, 0x88(%r5)
    0x3ff58b6666e               a7a90010     lghi      %r10, 0x10
    0x3ff58b66672               e330b0040032 ltgf      %r3, 4(%r11)
    0x3ff58b66678          *    a784001f     je        0x3ff58b666b6 C>> +1730
    0x3ff58b6667c          |*   a744004f     jl        0x3ff58b6671a C>> +1830
    0x3ff58b66680          ||   e3e0b0000032 ltgf      %r14, 0(%r11)
    0x3ff58b66686          ||   e3e0b0000014 lgf       %r14, 0(%r11)
    0x3ff58b6668c          ||   8be00003     sla       %r14, 3
    0x3ff58b66690          ||*  a7840008     je        0x3ff58b666a0 C>> +1708
    0x3ff58b66694          |||* a7540043     jnhe      0x3ff58b6671a C>> +1830
    0x3ff58b66698          |||| a7eb0010     aghi      %r14, 0x10
    0x3ff58b6669c          |||| b90400ae     lgr       %r10, %r14
    0x3ff58b666a0          ||>| b90400ea     lgr       %r14, %r10 <<< +1692
    0x3ff58b666a4          || | b90c00a3     msgr      %r10, %r3
    0x3ff58b666a8          || | eb330003000d sllg      %r3, %r3, 3
    0x3ff58b666ae          || | a73b0010     aghi      %r3, 0x10
    0x3ff58b666b2          || | b90a00a3     algr      %r10, %r3
    0x3ff58b666b6          >| | e380d0600004 lg        %r8, 0x60(%r13)  J9VMThread.heapAlloc <<< +1668
    0x3ff58b666bc           | | b90a00a8     algr      %r10, %r8
    0x3ff58b666c0          *| | a7b4002d     jnl       0x3ff58b6671a C>> +1830
    0x3ff58b666c4          || | e3a0d0680021 clg       %r10, 0x68(%r13)  J9VMThread.heapTop
    0x3ff58b666ca          ||*| a7240028     jh        0x3ff58b6671a C>> +1830
    0x3ff58b666ce          |||| e3a0d0600024 stg       %r10, 0x60(%r13)  J9VMThread.heapAlloc
    0x3ff58b666d4          |||| e320b0000004 lg        %r2, 0(%r11)
    0x3ff58b666da          |||| e3c080000024 stg       %r12, 0(%r8)
    0x3ff58b666e0          |||| 50208008     st        %r2, 8(%r8)
    0x3ff58b666e4          |||| ec28001d007f clije     %r2, 0, 0x3ff58b6671e C>> +1834
    0x3ff58b666ea          |||| 41383000     la        %r3, 0(%r8, %r3)
    0x3ff58b666ee          |||| e3c0c0580004 lg        %r12, 0x58(%r12)
    0x3ff58b666f4          |||| 41a08010     la        %r10, 0x10(%r8)
    0x3ff58b666f8          |||| e3c030000024 stg       %r12, 0(%r3) <<< ^+1822
    0x3ff58b666fe          |||| e320300800cb stfh      %r2, 8(%r3)
    0x3ff58b66704          |||| e330a0000024 stg       %r3, 0(%r10)
    0x3ff58b6670a          |||| b91a003e     algfr     %r3, %r14
    0x3ff58b6670e          |||| 41a0a008     la        %r10, 8(%r10)
    0x3ff58b66712          |||| a726fff3     brct      %r2, 0x3ff58b666f8 C>> ^+1796
    0x3ff58b66716          |||| a7f40004     j         0x3ff58b6671e U>> +1834
    0x3ff58b6671a          >>>> a7f42106     j         0x3ff58b6a926 U>> +18738  <<< +1672 +1696 +1740 +1750
    
    0x3ff58b6a926  -1:204       e33050d00024 stg       %r3, 0xd0(%r5)  <<< +1830 // newarray double
    0x3ff58b6a92c               b904003b     lgr       %r3, %r11
    0x3ff58b6a930               e3b050e00004 lg        %r11, 0xe0(%r5)
    0x3ff58b6a936               e31050e00024 stg       %r1, 0xe0(%r5)
    0x3ff58b6a93c               e3e050d80024 stg       %r14, 0xd8(%r5)
    0x3ff58b6a942               b904001c     lgr       %r1, %r12
    0x3ff58b6a946               e39050f80024 stg       %r9, 0xf8(%r5)
    0x3ff58b6a94c               e34050e80024 stg       %r4, 0xe8(%r5)
    0x3ff58b6a952               b9040092     lgr       %r9, %r2
    0x3ff58b6a956               500050f0     st        %r0, 0xf0(%r5)
    0x3ff58b6a95a               b904002b     lgr       %r2, %r11
    0x3ff58b6a95e               b90400b3     lgr       %r11, %r3
    0x3ff58b6a962               b90400c1     lgr       %r12, %r1
    0x3ff58b6a966  -1:192       c0e51a746bbd brasl     %r14, 0x3ff8d9f80e0 // multianewarray 17 dims 2 [[D
    0x3ff58b6a96c               58e050f0     l         %r14, 0xf0(%r5)
    0x3ff58b6a970               e34050e80004 lg        %r4, 0xe8(%r5)
    0x3ff58b6a976               e33050d00004 lg        %r3, 0xd0(%r5)
    0x3ff58b6a97c               e31050e00004 lg        %r1, 0xe0(%r5)
    0x3ff58b6a982               180e         lr        %r0, %r14
    0x3ff58b6a984               b90400e2     lgr       %r14, %r2
    0x3ff58b6a988               b9040029     lgr       %r2, %r9
    0x3ff58b6a98c               e39050f80004 lg        %r9, 0xf8(%r5)
    0x3ff58b6a992               b904008e     lgr       %r8, %r14
    0x3ff58b6a996               e3e050d80004 lg        %r14, 0xd8(%r5)
    0x3ff58b6a99c               a7f4dec1     j         0x3ff58b6671e U>> ^+1834
    

    We need to all the dimsReg to the post dependency conditions of the evaluator so it gets the correct value in the inline code and in case of helper dispatch, the value is correct.

  10. ehsankianifar commented on Oct 10, 2025

    @ehsankianifar
    Contributor

    I am still trying to get a failure with jit compilation log.

  11. ehsankianifar commented on Oct 10, 2025

    @ehsankianifar
    Contributor

    I opened this PR to Fix this issue: #22763
    Without having the dim register on the dependency conditions, what stops the RA to follow this path for dimReg allocation?

    Image
  12. r30shah commented on Oct 12, 2025

    @r30shah
    Contributor

    @ehsankianifar - We need to get the log file with traceRA to confirm. Are you suggesting that R8 was spilled in some spill-slot in first OOL before helper call and reverse spilled - but in second OOL it did not spill it, only generated reverse spill? I think it is better to look at the log file with traceRA and see what we have done to understand this. Just think, we have live registers throughout the generated code that spans multiple node, if we spill some register and then expect that slot to contains the same value throughout - it would not work with lot of code that has multiple ICF.

    As I said, the fix you have with an addition to attach dimReg to dependency condition - even though it is not used in ICF is the conservative solution but I want to ensure that is tied to this failure, so please collect log file with additional traceRA in addition to traceCG to take a look. You can omit traceFull - that can reduce the time spent in logging activity and increase the likelihood of producing failure.

    Re: #22757 (comment) - Is it question, please take a look at the OOL [1], Backward RA will start from Control-Flow End -> Fast Path Section -> Helper Code -> Instruction Before Start if ICF. How would RA work if We do not allocate inline fast path (That is what your diagram suggests). ,

    Without taking a look at the log file as I said earlier - at least in this case, I am hesitant to attach PR you opened up fix with this failure, it may end up that we have some odd bug that the way your code uses OOL/dispatch is being triggered, We should understand the bug so that in future we can ensure that we make right decisions for ICF/OOL in our evaluators,

    [1]. https://github.com/eclipse-omr/omr/blob/36622ffd848edb4d67712978b6eff6f014e16b02/compiler/codegen/OutOfLineCodeSection.hpp#L38

  13. ehsankianifar commented on Oct 14, 2025

    @ehsankianifar
    Contributor

    I Was not able to get a compilation log file with RA and similar failure. I try to artificially add some register pressure and try again to see if i get better luck. I extracted the path that DimsReg has followed in the dump file and it seem we have a there is a lot of spill but all of it happened in the OOL code. You can see the change in this log file extracted from core dump:

    tmp2.log

  14. ehsankianifar commented on Oct 16, 2025

    @ehsankianifar
    Contributor

    #22763 was merged. It should resolve the bug mentioned in this issue.

  15. added a commit that references this issue on Nov 10, 2025
    f0f81f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

blockercomp:jitsegfaulttest failure

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions