eclipse-openj9 / openj9

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

DaaLoadTest_daa1 BigInteger would overflow supported range #19666

Closed pshipton closed 2 months ago

pshipton commented 3 months ago

https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_special.system_s390x_linux_Personal_testList_2/134 DaaLoadTest_daa1_special_5m_29 -Xgcpolicy:gencon -Xgc:dynamicBreadthFirstScanOrdering

14:21:17  DLT testFailure: testSign(net.openj9.test.arithmetics.TestValidityChecking): BigInteger would overflow supported range
14:21:17  DLT java.lang.ArithmeticException: BigInteger would overflow supported range
14:21:17  DLT   at java.base/java.math.BigInteger.reportOverflow(BigInteger.java:1171)
14:21:17  DLT   at java.base/java.math.BigInteger.<init>(BigInteger.java:528)
14:21:17  DLT   at java.base/java.math.BigInteger.<init>(BigInteger.java:676)
14:21:17  DLT   at net.openj9.test.Utils.getBigInteger(Utils.java:64)
14:21:17  DLT   at net.openj9.test.arithmetics.TestArithmeticComparisonBase.getWrongFormatPDHelper2(TestArithmeticComparisonBase.java:131)
14:21:17  DLT   at net.openj9.test.arithmetics.TestValidityChecking.testSign(TestValidityChecking.java:226)

https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_special.system_s390x_linux_Personal_testList_3/134 DaaLoadTest_daa1_special_5m_22 -XX:+UseCompressedOops -Xjit -Xgcpolicy:gencon -Xaggressive

14:39:19  DLT testFailure: randomTest(net.openj9.test.arithmetics.TestArithmetics): BigInteger would overflow supported range
14:39:19  DLT java.lang.ArithmeticException: BigInteger would overflow supported range
14:39:19  DLT   at java.base/java.math.BigInteger.reportOverflow(BigInteger.java:1171)
14:39:19  DLT   at java.base/java.math.BigInteger.<init>(BigInteger.java:528)
14:39:19  DLT   at java.base/java.math.BigInteger.<init>(BigInteger.java:676)
14:39:19  DLT   at net.openj9.test.arithmetics.TestArithmetics.getRandomBigInteger(TestArithmetics.java:69)
14:39:19  DLT   at net.openj9.test.arithmetics.TestArithmetics.testWithOffsetAndPrec(TestArithmetics.java:76)
14:39:19  DLT   at net.openj9.test.arithmetics.TestArithmetics.randomTest(TestArithmetics.java:48)

Changes from last build (a week) https://github.com/eclipse-openj9/openj9/compare/099aaee5c9...6fae8827bc5 https://github.com/eclipse-openj9/openj9-omr/compare/0f74862420bcf4...361c9df886c

pshipton commented 3 months ago

@hzongaro what looks like a regression. @ymanton is it related to https://github.com/eclipse-openj9/openj9/pull/19613 ?

ymanton commented 3 months ago

@ymanton is it related to https://github.com/eclipse-openj9/openj9/pull/19613 ?

At first glance, doesn't appear to be. The 3 methods we've recognized for #19556 and #19613 aren't involved.

One of the failing tests is https://github.com/eclipse-aqavit/openj9-systemtest/blob/0cc1cdb8e33b41de4478f8f07d53a461905e5f49/openj9.test.daa/src/test.daa/net/openj9/test/arithmetics/TestArithmetics.java#L53-L72 which creates random number strings and calls the BigInteger(string) constructor, which is not the constructor we recognize, nor does that constructor call the other two BigInteger methods we've recognized AFAICT.

The other test is hitting the same constructor.

The error is that the random number string is outside the range that BigInteger supports, but the largest number the first test creates is only 16 digits, which BigInteger should be able to represent.

hzongaro commented 3 months ago

what looks like a regression.

Investigating. . . .

pshipton commented 3 months ago

I haven't seen this in 0.46 builds so far, but I've targeted 0.46 for now since there have been many changes double delivered.

JasonFengJ9 commented 3 months ago

JDK22 s390x_linux(sles12s390x-svl-rt7-1)

[2024-06-08T20:17:46.497Z] variation: Mode610
[2024-06-08T20:17:46.497Z] JVM_OPTIONS:  -Xcompressedrefs -Xjit -Xgcpolicy:gencon 

[2024-06-08T20:18:26.272Z] DLT testFailure: testSign(net.openj9.test.arithmetics.TestValidityChecking): BigInteger would overflow supported range
[2024-06-08T20:18:26.272Z] DLT java.lang.ArithmeticException: BigInteger would overflow supported range
[2024-06-08T20:18:26.272Z] DLT  at java.base/java.math.BigInteger.reportOverflow(BigInteger.java:1220)
[2024-06-08T20:18:26.272Z] DLT  at java.base/java.math.BigInteger.<init>(BigInteger.java:573)
[2024-06-08T20:18:26.272Z] DLT  at java.base/java.math.BigInteger.<init>(BigInteger.java:721)
[2024-06-08T20:18:26.272Z] DLT  at net.openj9.test.Utils.getBigInteger(Utils.java:64)
[2024-06-08T20:18:26.272Z] DLT  at net.openj9.test.arithmetics.TestArithmeticComparisonBase.getWrongFormatPDHelper2(TestArithmeticComparisonBase.java:131)
[2024-06-08T20:18:26.272Z] DLT  at net.openj9.test.arithmetics.TestValidityChecking.testSign(TestValidityChecking.java:226)
[2024-06-08T20:18:26.272Z] DLT  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-06-08T20:18:26.272Z] DLT  at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-06-08T20:18:26.272Z] DLT  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[2024-06-08T20:18:26.272Z] DLT  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.Suite.runChild(Suite.java:128)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.Suite.runChild(Suite.java:27)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
[2024-06-08T20:18:26.273Z] DLT  at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
[2024-06-08T20:18:26.273Z] DLT  at net.adoptopenjdk.loadTest.adaptors.JUnitAdaptor.executeTest(JUnitAdaptor.java:130)
[2024-06-08T20:18:26.273Z] DLT  at net.adoptopenjdk.loadTest.LoadTestRunner$2.run(LoadTestRunner.java:182)
[2024-06-08T20:18:26.273Z] DLT  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[2024-06-08T20:18:26.273Z] DLT  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[2024-06-08T20:18:26.273Z] DLT  at java.base/java.lang.Thread.run(Thread.java:1582)
[2024-06-08T20:18:26.273Z] DLT testFinished: testSign(net.openj9.test.arithmetics.TestValidityChecking)

[2024-06-08T20:18:50.949Z] DaaLoadTest_daa1_5m_1_FAILED
hzongaro commented 3 months ago

I was able to reproduce this locally, 7/10 with TKG_ITERATIONS=10. Trying to narrow things down.

pshipton commented 3 months ago

Interestingly it failed in the nightly build (Jason's is a nightly as well), so it's not a failure we'd only see in the weekly builds. Meaning the change that caused it is likely a more recent one. https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_sanity.system_s390x_linux_Nightly_testList_0/741 https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_sanity.system_s390x_linux_Nightly_testList_2/741 https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_extended.system_s390x_linux_Nightly_testList_2/742 https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.system_s390x_linux_Nightly_testList_0/245/ https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_extended.system_s390x_linux_Nightly_testList_1/245

pshipton commented 3 months ago

Changes from the previous nightly build that didn't fail.

https://github.com/eclipse-openj9/openj9/compare/cc375ba4845...6fae8827bc5

Also it does seem to be specific to Z.

hzongaro commented 3 months ago

@VermaSh, @rmnattas, may I ask you to take a look at this issue? Looking at a log file for a failing case, I see TREE VERIFICATION ERROR and BLOCK VERIFICATION ERROR in a scorching compilation of BigInteger.<init>(Ljava/lang/String;I)V after Idiom Recognition. For instance, before Idiom Recognition, n3674n has rc=1:

n3639n    BBStart <block_208> (freq 1997) (in loop 930)                                       [     0x3ff2c756130] bci=[19,1,47] rc=0 vc=15771 vn=- li=-1 udi=- nc=0
n3678n    ificmplt --> block_200 BBStart at n3668n ()                                         [     0x3ff2c756d60] bci=[19,1,47] rc=0 vc=15771 vn=- li=-1 udi=- nc=2 flg=0x20
n3674n      iload  cursor<auto slot 3>[#404  Auto] [flags 0x3 0x0 ] (cannotOverflow )         [     0x3ff2c756c20] bci=[19,0,47] rc=1 vc=15771 vn=- li=- udi=1492 nc=0 flg=0x1000
n3675n      iconst 0 (X==0 X>=0 X<=0 )                                                        [     0x3ff2c756c70] bci=[19,1,47] rc=1 vc=15771 vn=- li=- udi=- nc=0 flg=0x302
n3673n    BBEnd </block_208> =====                                                            [     0x3ff2c756bd0] bci=[19,1,47] rc=0 vc=15771 vn=- li=-1 udi=- nc=0

after Idiom Recognition, it was a refcount of 2:

n3639n    BBStart <block_208> (freq 1997) (in loop 930)                                       [     0x3ff2c756130] bci=[19,1,47] rc=0 vc=16095 vn=- li=- udi=- nc=0
n3678n    ificmplt --> block_200 BBStart at n3668n ()                                         [     0x3ff2c756d60] bci=[19,1,47] rc=0 vc=16095 vn=- li=- udi=- nc=2 flg=0x20
n3674n      iload  cursor<auto slot 3>[#404  Auto] [flags 0x3 0x0 ] (cannotOverflow )         [     0x3ff2c756c20] bci=[19,0,47] rc=2 vc=16095 vn=- li=- udi=1209 nc=0 flg=0x1000
n3675n      iconst 0 (X==0 X>=0 X<=0 )                                                        [     0x3ff2c756c70] bci=[19,1,47] rc=1 vc=16095 vn=- li=- udi=- nc=0 flg=0x302
n3673n    BBEnd </block_208> =====                                                            [     0x3ff2c756bd0] bci=[19,1,47] rc=0 vc=16095 vn=- li=- udi=- nc=0
TREE VERIFICATION ERROR -- node [     0x3ff2c756c20] ref count is 2 and should be 1

One of the changes in the range mentioned in @pshipton's previous comment was in Idiom Recognition: commit a8295da97d41181047db882efa05542a8e71e557

hzongaro commented 3 months ago

As the suspected cause of the failure wasn't delivered to the v0.46.0-release branch, I've reassigned this to the 0.48 release.

hzongaro commented 3 months ago

see TREE VERIFICATION ERROR and BLOCK VERIFICATION ERROR

I should have mentioned that those verification errors appear in logs for a build — https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK17_s390x_linux_Personal/858/OpenJ9-JDK17-s390x_linux-20240608-080546.tar.gz — that exhibits the unexpected Exception, while an earlier build for which the test passes — https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK17_s390x_linux_Nightly/763/OpenJ9-JDK17-s390x_linux-20240607-202826.tar.gz — does not show those verification errors.

VermaSh commented 3 months ago

looking into the failure

rmnattas commented 3 months ago

In the meantime we can revert this one commit https://github.com/eclipse-openj9/openj9/pull/19697 to have builds passing. https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/41359/ Testing with the revert.

The commit need to be squashed with an upcoming commit (still doesn't fix the issue) in addition to a fix to this issue.

VermaSh commented 3 months ago

Testing out a fix for the failure. Old code was duplicating base array node duplicate through createLoad(). This wasn't copied over in the off-heap change which I suspect is what lead to the BLOCK VERIFICATION errors. I'll create a PR for the fix as soon as I am done testing it.

TREE VERIFICATION ERROR -- node [     0x3ff2c756c20] ref count is 2 and should be 1
TREE VERIFICATION ERROR -- node [     0x3ff2c756e00] ref count is 3 and should be 1
TREE VERIFICATION ERROR -- node [     0x3fea9963e30] ref count is 2 and should be 1
TREE VERIFICATION ERROR -- node [     0x3fea9963c00] ref count is 3 and should be 1
BLOCK VERIFICATION ERROR -- node [     0x3ff2c756c20] accessed outside of its (extended) basic block: 1 time(s)
BLOCK VERIFICATION ERROR -- node [     0x3ff2c756e00] accessed outside of its (extended) basic block: 2 time(s)
BLOCK VERIFICATION ERROR -- node [     0x3fea9963e30] accessed outside of its (extended) basic block: 1 time(s)
BLOCK VERIFICATION ERROR -- node [     0x3fea9963c00] accessed outside of its (extended) basic block: 2 time(s)
VermaSh commented 3 months ago

Personal build and grinder with fix: https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/22784/ https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/41417/

r30shah commented 3 months ago

Thanks @VermaSh . @pshipton / @rmnattas We are waiting for Shubham's tests to finish before opening up the PR. DO you still want to go ahead with the reverting the problematic change ?

rmnattas commented 3 months ago

Would be better to just merge the fix, there's also the other related commit https://github.com/eclipse-openj9/openj9/commit/f3241fca1af209d99e5e2d851debea6fae5857fb to merge with it too. It's already in another WIP PR I have but if @VermaSh would grab it and include it in his PR I can remove it from mine. Or I can take his fix and include it in my PR.

pshipton commented 3 months ago

We've gone a week without reverting, we can wait for the fix.

VermaSh commented 3 months ago

WIP PR with fix and @rmnattas's commit https://github.com/eclipse-openj9/openj9/pull/19724

VermaSh commented 3 months ago

The failure is still there https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk21_j9_sanity.system_s390x_linux_Personal_testList_2/45/consoleFull. Continuing the investigation.

VermaSh commented 3 months ago

Haven't been able to reproduce the failure consistently on my dev machine so launched a grinder to collect diagnostic files.

VermaSh commented 3 months ago

xdump option in the grinder to get core file got overwritten by test xdump so wasn't able to get core dump. I have launched a new grinder without the default xdump options.

VermaSh commented 3 months ago

Looking into the core dump, I don't see anything suspicious so far. Will post another update after I have had a chance to do a deeper dive into the core dump.

VermaSh commented 3 months ago

The string that was passed in to the constructor[1] was 00[2] so we should have returned at cursor == len [3]. cursor was 0 but should have been incremented to 2, same value as len, in [4]. I have launched another grinder to get trace log to better understand some of the instructions.

[1] https://github.com/ibmruntimes/openj9-openjdk-jdk/blob/ff40ef0fed223100852dca63a72804b4b03ad48d/src/java.base/share/classes/java/math/BigInteger.java#L567-L575 "Big Integer constructor"

[2] string object passed into [1] ``` (kca) obj 0xfcb01e68 Object class type: {java/lang/String} J9Class 0x00000000010ffb00 Super class fields: {java/lang/Object} Number of Fields: 0 Class fields: Number of Fields: 16 > value ( +4) = 0x00000000fcb01e58 ([B) - 20020012 Private Final : Obj - {[B} > ( +8) = 0x00000000 () - 0 > coder (+12) = 0x00000000 (B) - 200012 Private Final > hash (+16) = 0x00000000 (I) - 300002 Private > hashIsZero (+20) = 0x00000000 (Z) - 80002 Private serialVersionUID = 0xa0f0a4387a3bb342 (J) - 7c001a Private Static Final COMPACT_STRINGS = 0x0000000082a4b6c8 (Z) - 80018 Static Final emptyValue = 0x0000000082a4b6d8 ([B) - 2001a Private Static Final : Obj - {[L[Bbyte}T compressedAsciiTable = 0x0000000082a4bae0 ([[B) - 2001a Private Static Final : Obj - {[L[Bbyte}T decompressedAsciiTable = 0x0000000082a4b548 ([[B) - 2001a Private Static Final : Obj - {com/ibm/jit/JITHelpers}T helpers = 0x0000000082ac6d08 (Lcom/ibm/jit/JITHelpers;) - 2001a Private Static Final : Obj - {java/lang/String$StringCompressionFlag}T compressionFlag = 0x0000000082a4bee8 (Ljava/lang/String$StringCompressionFlag;) - 2000a Private Static : Obj - {[Ljava/io/ObjectStreamField}T serialPersistentFields = 0x0000000082a4bef8 ([Ljava/io/ObjectStreamField;) - 2001a Private Static Final : Obj - {java/lang/String$CaseInsensitiveComparator}T REPL = 0x0000fffd (C) - 40001a Private Static Final CASE_INSENSITIVE_ORDER = 0x0000000100000000 (Ljava/util/Comparator;) - 40020019 Public Static Final : LATIN1 = 0x00000000 (B) - 600018 Static Final (kca) obj 0x00000000fcb01e58 Object is an Array of: Class Path/Name: {[B} J9Class 0x00000000010fae00 ClassObject: 0x0000000082a10a10 Access: Public Final Abstract (10411) ClassLoader: 0x000003ffac0a8f78 Object: 0x0000000082a4b3c0 {jdk/internal/loader/ClassLoaders$BootClassLoader}T SubClassLink: 0x00000000010faa00 {[D} Hierarchy: (depth 1) {java/lang/Object} J9Class 0x00000000010f0f00 Interfaces: {java/lang/Cloneable} J9Class 0x00000000010f9c00 {java/io/Serializable} J9Class 0x00000000010f3600 J9Methods: 0x00000000010fac00 (0 methods) Dump of Contiguous Array Elements (2 elements): 0x00000000fcb01e60: 30 30 ```

[3] https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/bdd0f758a673263028fd2fb07eb31be1099e68fe/src/java.base/share/classes/java/math/BigInteger.java#L518 "cursor == len condition"

[4] https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/bdd0f758a673263028fd2fb07eb31be1099e68fe/src/java.base/share/classes/java/math/BigInteger.java#L513-L516 "loop to skip leading zeros"

VermaSh commented 3 months ago

Disabling OSR fixes the failure. My 20x grinder finished without any failures. I have launched another 100x grinder to verify this. Will take a closer look at OSR to figure out the transformation responsible for the failure.

VermaSh commented 3 months ago

I didn't notice anything suspicious in trace log of BigInteger constructor from the failing. The trees and generated instructions look ok for the while loop. The string being passed in looks good as well, however, I wasn't able to verify the value of the index cursor used to iterate over characters in the string. I am planning to compare scorching logs from failing and passing log to see if we are doing anything different on the failing run.

Here are trace logs from passing and failing runs.

VermaSh commented 3 months ago

Comparing the two logs, only difference I saw was that in the failing run we inline java/lang/CharacterData.digit(II)I and java/lang/CharacterData.of(I)Ljava/lang/CharacterData; into BigInteger constructor, but the trees are pretty much the same. So planning to see if removing off-heap commits helps identify the change which caused the failure.

For future reference Machine used for this investigation: rtj-ubu24s390x-svl-test-6lslg-1.fyre.ibm.com cmd:

> make _DaaLoadTest_daa1_special_5m_29 \
  TEST_JDK_HOME=$prototype_build BUILD_LIST=system TKG_ITERATIONS=20 \
  EXTRA_OPTIONS='-Xnoaot -Xnoclassgc -Xjit:verbose=\{compileStart\|compileEnd\|inlining\},vlog=verbose.vlog,\{java/math/BigInteger.\<init\>\(Ljava/lang/String\;I\)V\}\(traceFull,traceCG,log=method.log\)'
VermaSh commented 3 months ago

Opened a WIP PR with the fix: https://github.com/eclipse-openj9/openj9/pull/19810

VermaSh commented 2 months ago

We should have returned from[1] but didn't because we used an incorrect cursor value after the last iteration of[2]. We enter the constructor with array of three 0s and after looking at the 3rd element jump to block_2651 from n28666n. But since the isub hasn't been stored back to cursor auto slot, we must subtract -3 from cursor again in block_2651. We write the new cursor value to the auto slot(#404) after each iteration but always uses the initial value of 0 from n3674n to calculate the new value. So when we add 3 to #404 in n30193n we end up with 5 as the new cursor value[3], value greater than array length. This is why we don't enter [1] and end up throwing an exception later on instead. With the fix, the slot used in isub (n30178n) of the exit block is the same as the loop n28647n[4].

[1] java.base/share/classes/java/math/BigInteger.java#L561-L565 "if check"

[2] java.base/share/classes/java/math/BigInteger.java#L556-L559 "skip leading zeros"

[3] Failing build: increment `cursor` after the last iteration ``` n28669n BBStart (freq 1996) (extension of previous block) (in loop 930) [ 0x3ff6b64f0f0] bci=[-1,150,511] rc=0 vc=12 vn=- li=2474 udi=- nc=0 n28670n ificmpne --> block_2807 BBStart at n32299n () [ 0x3ff6b64f140] bci=[-1,153,511] rc=0 vc=12 vn=- li=2474 udi=- nc=3 flg=0x20 n28681n ==>b2i n12258n ==>iconst 0 ... n28597n BBStart (freq 1194) (extension of previous block) (in loop 930) [ 0x3ff6b64da70] bci=[-1,138,510] rc=0 vc=12 vn=- li=2464 udi=- nc=0 n28602n ificmpge --> block_2649 BBStart at n30180n () [ 0x3ff6b64dc00] bci=[-1,141,510] rc=0 vc=12 vn=- li=2464 udi=- nc=3 flg=0x20 n28599n isub (X>=0 cannotOverflow ) [ 0x3ff6b64db10] bci=[-1,156,512] rc=3 vc=12 vn=- li=2464 udi=- nc=2 flg=0x1100 n3674n ==>iload n29807n iconst -2 (X!=0 X<=0 ) [ 0x3ff1b4e54b0] bci=[-1,156,512] rc=1 vc=12 vn=- li=2464 udi=- nc=0 flg=0x204 n37300n ==>iRegLoad n37335n GlRegDeps () [ 0x3fee35a85c0] bci=[-1,141,510] rc=1 vc=12 vn=- li=2464 udi=- nc=5 flg=0x20 n37296n ==>aRegLoad n37297n ==>aRegLoad n37299n ==>iRegLoad n37300n ==>iRegLoad n37301n ==>iRegLoad n28604n BBEnd [ 0x3ff6b64dca0] bci=[-1,138,510] rc=0 vc=12 vn=- li=2464 udi=- nc=0 n30178n BBStart (freq 1194) (extension of previous block) (in loop 930) [ 0x3ff1b4ec8a0] bci=[19,4,47] rc=0 vc=12 vn=- li=2648 udi=- nc=0 n28598n istore cursor[#404 Auto] [flags 0x3 0x0 ] [ 0x3ff6b64dac0] bci=[-1,156,512] rc=0 vc=12 vn=- li=2648 udi=- nc=1 n28599n ==>isub n28706n ificmpge --> block_2808 BBStart at n32304n () [ 0x3ff6b64fc80] bci=[19,7,47] rc=0 vc=12 vn=- li=2648 udi=- nc=3 flg=0x20 n28599n ==>isub n3683n ==>iloadi n37339n GlRegDeps () [ 0x3fee35a8700] bci=[19,7,47] rc=1 vc=12 vn=- li=2648 udi=- nc=1 flg=0x20 n37300n ==>iRegLoad n28710n BBEnd ... n28661n BBStart (freq 1194) (extension of previous block) (in loop 930) [ 0x3ff6b64ee70] bci=[-1,138,510] rc=0 vc=12 vn=- li=2473 udi=- nc=0 n28666n ificmpge --> block_2651 BBStart at n30189n () [ 0x3ff6b64f000] bci=[-1,141,510] rc=0 vc=12 vn=- li=2473 udi=- nc=3 flg=0x20 n28663n isub (X>=0 cannotOverflow ) // calculate new cursor value [ 0x3ff6b64ef10] bci=[-1,156,512] rc=3 vc=12 vn=- li=2473 udi=- nc=2 flg=0x1100 n3674n ==>iload n29811n iconst -3 (X!=0 X<=0 ) [ 0x3ff1b4e55f0] bci=[-1,156,512] rc=1 vc=12 vn=- li=2473 udi=- nc=0 flg=0x204 n37300n ==>iRegLoad // (array length == 3) n37347n GlRegDeps () [ 0x3fee35a8980] bci=[-1,141,510] rc=1 vc=12 vn=- li=2473 udi=- nc=5 flg=0x20 n37296n ==>aRegLoad n37297n ==>aRegLoad n37299n ==>iRegLoad n37300n ==>iRegLoad n37301n ==>iRegLoad n28668n BBEnd [ 0x3ff6b64f0a0] bci=[-1,138,510] rc=0 vc=12 vn=- li=2473 udi=- nc=0 n30187n BBStart (freq 1194) (extension of previous block) (in loop 930) [ 0x3ff1b4ecb70] bci=[19,4,47] rc=0 vc=12 vn=- li=2650 udi=- nc=0 n28662n istore cursor[#404 Auto] [flags 0x3 0x0 ] [ 0x3ff6b64eec0] bci=[-1,156,512] rc=0 vc=12 vn=- li=2650 udi=- nc=1 n28663n ==>isub n28770n ificmpge --> block_2808 BBStart at n32304n () [ 0x3ff6b971090] bci=[19,7,47] rc=0 vc=12 vn=- li=2650 udi=- nc=3 flg=0x20 n28663n ==>isub n3683n ==>iloadi n37351n GlRegDeps () [ 0x3fee35a8ac0] bci=[19,7,47] rc=1 vc=12 vn=- li=2650 udi=- nc=1 flg=0x20 n37300n ==>iRegLoad n28774n BBEnd ... n30189n BBStart (freq 1194) (in loop 1315) [ 0x3ff1b4ecc10] bci=[-1,138,510] rc=0 vc=12 vn=- li=2651 udi=- nc=1 n33084n GlRegDeps () [ 0x3fee3385500] bci=[-1,138,510] rc=1 vc=12 vn=- li=2651 udi=- nc=5 flg=0x20 n33085n aRegLoad GPR2 val[#400 Parm] [flags 0xc0000107 0x0 ] [ 0x3fee3385550] bci=[-1,138,510] rc=2 vc=12 vn=- li=2651 udi=- nc=0 n33086n aRegLoad GPR1 [#1692 Auto] [flags 0x4007 0x0 ] (SeenRealReference ) [ 0x3fee33855a0] bci=[-1,125,506] rc=2 vc=12 vn=- li=2651 udi=- nc=0 flg=0x8000 n33088n iRegLoad GPR8 radix[#401 Parm] [flags 0xc0000103 0x0 ] [ 0x3fee3385640] bci=[-1,138,510] rc=2 vc=12 vn=- li=2651 udi=- nc=0 n33089n iRegLoad GPR9 [#1693 Auto] [flags 0x3 0x0 ] (SeenRealReference ) [ 0x3fee3385690] bci=[-1,139,510] rc=3 vc=12 vn=- li=2651 udi=- nc=0 flg=0x8000 n33090n iRegLoad GPR11 sign[#414 Auto] [flags 0x3 0x0 ] [ 0x3fee33856e0] bci=[-1,138,510] rc=2 vc=12 vn=- li=2651 udi=- nc=0 n32286n astore [#1477 Auto] [flags 0x7 0x0 ] [ 0x3feeb465b90] bci=[-1,125,506] rc=0 vc=12 vn=- li=2651 udi=- nc=1 n33086n ==>aRegLoad n30192n istore cursor[#404 Auto] [flags 0x3 0x0 ] [ 0x3ff1b4ecd00] bci=[-1,156,512] rc=0 vc=12 vn=- li=2651 udi=- nc=1 n30193n isub (X>=0 cannotOverflow ) [ 0x3ff1b4ecd50] bci=[-1,156,512] rc=1 vc=12 vn=- li=2651 udi=- nc=2 flg=0x1100 n30194n iload cursor[#404 Auto] [flags 0x3 0x0 ] (cannotOverflow ) [ 0x3ff1b4ecda0] bci=[19,0,47] rc=1 vc=12 vn=- li=2651 udi=- nc=0 flg=0x1000 n30195n iconst -3 (X!=0 X<=0 ) [ 0x3ff1b4ecdf0] bci=[-1,156,512] rc=1 vc=12 vn=- li=2651 udi=- nc=0 flg=0x204 n32202n iRegStore GPR10 [ 0x3feeb464150] bci=[-1,139,510] rc=0 vc=12 vn=- li=2651 udi=- nc=1 n33089n ==>iRegLoad n30191n goto --> block_2610 BBStart at n29364n [ 0x3ff1b4eccb0] bci=[-1,138,510] rc=0 vc=12 vn=- li=2651 udi=- nc=1 n33097n GlRegDeps () [ 0x3fee3385910] bci=[-1,138,510] rc=1 vc=12 vn=- li=2651 udi=- nc=4 flg=0x20 n33085n ==>aRegLoad n33088n ==>iRegLoad n33096n PassThrough GPR10 [ 0x3fee33858c0] bci=[-1,139,510] rc=1 vc=12 vn=- li=2651 udi=- nc=1 n33089n ==>iRegLoad n33090n ==>iRegLoad n30190n BBEnd ===== ```
[4] Fixed build: increment `cursor` after the last iteration ``` n30048n istore [#1631 Auto] [flags 0x3 0x0 ] [ 0x3fe782ea000] bci=[19,0,47] rc=0 vc=0 vn=- li=- udi=- nc=1 n3674n iload cursor[#404 Auto] [flags 0x3 0x0 ] (cannotOverflow ) [ 0x3ff05356c20] bci=[19,0,47] rc=11 vc=2018 vn=- li=- udi=1067 nc=0 flg=0x1000 ... n28653n BBStart (freq 2043) (extension of previous block) [ 0x3fe8e4febf0] bci=[-1,150,511] rc=0 vc=3 vn=- li=- udi=- nc=0 n28654n ificmpne --> block_2610 BBStart at n29348n () [ 0x3fe8e4fec40] bci=[-1,153,511] rc=0 vc=1996 vn=- li=- udi=- nc=2 flg=0x20 n28665n ==>b2i n12258n ==>iconst 0 n28657n BBEnd [ 0x3fe8e4fed30] bci=[-1,153,511] rc=0 vc=3 vn=- li=- udi=- nc=0 n28645n BBStart (freq 1221) (extension of previous block) [ 0x3fe8e4fe970] bci=[-1,138,510] rc=0 vc=3 vn=- li=- udi=- nc=0 n28650n ificmpge --> block_2651 BBStart at n30174n () [ 0x3fe8e4feb00] bci=[-1,141,510] rc=0 vc=1994 vn=- li=- udi=- nc=2 flg=0x20 n28647n isub (X>=0 cannotOverflow ) [ 0x3fe8e4fea10] bci=[-1,156,512] rc=3 vc=1995 vn=- li=- udi=- nc=2 flg=0x1100 n3674n ==>iload n29795n iconst -3 (X!=0 X<=0 ) [ 0x3fe782e50f0] bci=[-1,156,512] rc=1 vc=1995 vn=- li=- udi=- nc=0 flg=0x204 n11594n ==>iload // (array length == 3) n28652n BBEnd [ 0x3fe8e4feba0] bci=[-1,138,510] rc=0 vc=3 vn=- li=- udi=- nc=0 n30172n BBStart (freq 1221) (extension of previous block) [ 0x3fe782ec6c0] bci=[-1,138,510] rc=0 vc=0 vn=- li=- udi=- nc=0 n28646n istore cursor[#404 Auto] [flags 0x3 0x0 ] [ 0x3fe8e4fe9c0] bci=[-1,156,512] rc=0 vc=1995 vn=- li=- udi=258 nc=1 n28647n ==>isub n30173n BBEnd ... n30174n BBStart (freq 1221) [ 0x3fe782ec760] bci=[-1,138,510] rc=0 vc=0 vn=- li=- udi=- nc=0 n30177n istore cursor[#404 Auto] [flags 0x3 0x0 ] [ 0x3fe782ec850] bci=[-1,156,512] rc=0 vc=1995 vn=- li=- udi=258 nc=1 n30178n isub (X>=0 cannotOverflow ) [ 0x3fe782ec8a0] bci=[-1,156,512] rc=1 vc=1995 vn=- li=- udi=- nc=2 flg=0x1100 n30179n iload [#1631 Auto] [flags 0x3 0x0 ] (cannotOverflow ) [ 0x3fe782ec8f0] bci=[19,0,47] rc=1 vc=2018 vn=- li=- udi=1067 nc=0 flg=0x1000 n30180n iconst -3 (X!=0 X<=0 ) [ 0x3fe782ec940] bci=[-1,156,512] rc=1 vc=1995 vn=- li=- udi=- nc=0 flg=0x204 n30176n goto --> block_2610 BBStart at n29348n [ 0x3fe782ec800] bci=[-1,138,510] rc=0 vc=0 vn=- li=- udi=- nc=0 n30175n BBEnd ===== ```
r30shah commented 2 months ago

Thanks @VermaSh for the summary , it is an interesting manifestation of incorrect reference count set on nodes, highlights the importance of testing the changes with paranoidOptCheck in development stage.