Skip to content

Anchor the value node before the removal of the call node - #21805

Merged
hzongaro merged 1 commit into
eclipse-openj9:masterfrom
a7ehuo:fix-JProfiling-lowerCalls
May 7, 2025
Merged

Anchor the value node before the removal of the call node#21805
hzongaro merged 1 commit into
eclipse-openj9:masterfrom
a7ehuo:fix-JProfiling-lowerCalls

Conversation

@a7ehuo

@a7ehuo a7ehuo commented May 6, 2025

Copy link
Copy Markdown
Contributor

Need to anchor the value node before the helper call node is removed. Otherwise, the child value node could be currently anchored under the helper call node. When the helper call node is removed, the value node will be moved down and anchored where the next reference is. It will be a problem if there is a store into this value between the helper call node and the next reference. After the helper call node is removed, the reference will load the updated value instead of the original value.

Fixes: #21256

@a7ehuo
a7ehuo requested a review from hzongaro May 6, 2025 13:28
@a7ehuo a7ehuo added the comp:jit label May 6, 2025
@a7ehuo

a7ehuo commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

@hzongaro May I ask you to review this change? Thank you!
@vijaysun-omr fyi

@hzongaro hzongaro self-assigned this May 6, 2025
@vijaysun-omr

Copy link
Copy Markdown
Contributor

@r30shah fyi

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @a7ehuo for the link with detailed explanation. Change looks good to me.

Comment thread runtime/compiler/optimizer/JProfilingValue.cpp Outdated
@vijaysun-omr

vijaysun-omr commented May 6, 2025

Copy link
Copy Markdown
Contributor

I agree with Rahil to be conservative. Note that local CSE can common aladd/aiadd without setting any internal pointer information like pinning array etc. if the said commoning was across a span of IL trees where there was no GC point. If the block was split by JProfiling across such a span of IL trees and resulted in uncommoning etc. it may be necessary to store the result of the aladd/aiadd into a temp, and in such a scenario, the splitting of the block code may create an internal pointer temp (not sure but I thought I would at least draw attention to this scenario where an internal pointer did not exist before JProfiling but may be possible afterwards). I don't suggest spending time trying to handle this case in any sophisticated way though, i.e. a conservative approach is fine.

Need to anchor the value node before the helper call node is removed.
Otherwise, the child value node could be currently anchored under the
helper call node. When the helper call node is removed, the value node
will be moved down and anchored where the next reference is.
It will be a problem if there is a store into this value between the
helper call node and the next reference. After the helper call node
is removed, the reference will load the updated value instead of
the original value.

Fixes: eclipse-openj9#21256
Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
@a7ehuo
a7ehuo force-pushed the fix-JProfiling-lowerCalls branch from 5cf7d34 to c365d1a Compare May 6, 2025 18:52

@hzongaro hzongaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@hzongaro

hzongaro commented May 6, 2025

Copy link
Copy Markdown
Member

Jenkins test sanity.functional,sanity.openjdk all jdk8,jdk21

@hzongaro

hzongaro commented May 6, 2025

Copy link
Copy Markdown
Member

Jenkins test sanity.functional,sanity.openjdk xmac jdk21

@a7ehuo

a7ehuo commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

I'm triaging the failed tests. So far, 2 and 4 are known issues. Not sure the other two yet, but the first one crash definitely looks suspicious

  1. Test_openjdk21_j9_sanity.openjdk_ppc64le_linux:
[2025-05-06T20:13:11.611Z] Compiled_method=java/lang/String.split(CIZ)[Ljava/lang/String;
[2025-05-06T20:13:11.611Z] Target=2_90_20250506_361 (Linux 6.8.0-51-generic)
[2025-05-06T20:13:11.611Z] CPU=ppc64le (4 logical CPUs) (0x1fa150000 RAM)
[2025-05-06T20:13:11.611Z] ----------- Stack Backtrace -----------
[2025-05-06T20:13:11.611Z]  (0x000071C91B08F19C [<unknown>+0x0])
[2025-05-06T20:13:11.611Z] runJavaThread+0x250 (0x000071CA0C818600 [libj9vm29.so+0x18600])
[2025-05-06T20:13:11.611Z] javaProtectedThreadProc+0xc8 (0x000071CA0C8BE688 [libj9vm29.so+0xbe688])
[2025-05-06T20:13:11.611Z] omrsig_protect+0x3e4 (0x000071CA0CB296D4 [libj9prt29.so+0x396d4])
[2025-05-06T20:13:11.611Z] javaThreadProc+0x60 (0x000071CA0C8B9B20 [libj9vm29.so+0xb9b20])
[2025-05-06T20:13:11.611Z] thread_wrapper+0x190 (0x000071CA0C7CCC00 [libj9thr29.so+0xcc00])
[2025-05-06T20:13:11.611Z]  (0x000071CA0D2B2A9C [libc.so.6+0xb2a9c])
[2025-05-06T20:13:11.611Z] ---------------------------------------
...
[2025-05-06T20:21:11.674Z] -----------------------------------
[2025-05-06T20:21:11.674Z] jdk_lang_j9_0_FAILED
[2025-05-06T20:21:11.674Z] -----------------------------------
  1. Test_openjdk8_j9_sanity.openjdk_ppc64le_linux
[2025-05-06T20:11:51.551Z]         com.sun.javatest.regtest.agent.MainWrapper /home/jenkins/workspace/Test_openjdk8_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2/aqa-tests/TKG/output_17465607271515/jdk_util_1/work/java/util/logging/FileHandlerAccessTest.d/main.0.jta 20
[2025-05-06T20:11:51.551Z] 
[2025-05-06T20:11:51.551Z] TEST RESULT: Error. Program `/home/jenkins/workspace/Test_openjdk8_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2/jdkbinary/j2sdk-image/bin/java' timed out (timeout set to 960000ms, elapsed time including timeout handling was 960387ms).
[2025-05-06T20:11:51.551Z] --------------------------------------------------
[2025-05-06T20:11:51.551Z] Test results: passed: 657; error: 1
[2025-05-06T20:11:51.551Z] Report written to /home/jenkins/workspace/Test_openjdk8_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2/aqa-tests/TKG/output_17465607271515/jdk_util_1/report/html/report.html
[2025-05-06T20:11:51.551Z] Results written to /home/jenkins/workspace/Test_openjdk8_j9_sanity.openjdk_ppc64le_linux_Personal_testList_2/aqa-tests/TKG/output_17465607271515/jdk_util_1/work
[2025-05-06T20:11:51.551Z] Error: Some tests failed or other problems occurred.
[2025-05-06T20:11:51.551Z] -----------------------------------
[2025-05-06T20:11:51.551Z] jdk_util_1_FAILED
  1. Test_openjdk8_j9_sanity.functional_s390x_linux
[2025-05-06T21:15:20.190Z] --- Test PASSED ---
[2025-05-06T21:15:20.190Z] 
[2025-05-06T21:15:20.190Z] 71 passed / 1 failed
[2025-05-06T21:15:20.190Z] -----------------------------------
[2025-05-06T21:15:20.190Z] J9vmTest_3_FAILED
[2025-05-06T21:15:20.190Z] -----------------------------------
...
[2025-05-06T21:22:09.466Z] --- Test PASSED ---
[2025-05-06T21:22:09.466Z] 
[2025-05-06T21:22:09.466Z] 71 passed / 1 failed
[2025-05-06T21:22:09.466Z] -----------------------------------
[2025-05-06T21:22:09.466Z] J9vmTest_4_FAILED
[2025-05-06T21:22:09.466Z] -----------------------------------
  1. Test_openjdk8_j9_sanity.functional_ppc64le_linux
[2025-05-06T20:30:07.871Z] Dumping the contents of log file: /home/jenkins/workspace/Test_openjdk8_j9_sanity.functional_ppc64le_linux_Personal_testList_0/aqa-tests/TKG/output_17465610351017/testJITServer_0/testServerComesUpAfterClientAndGoesDownAgain.server.out
[2025-05-06T20:30:07.871Z] ////////////////////////////////////////////////////////////////////////
[2025-05-06T20:30:07.871Z] //// can't bind server address: Address already in use
[2025-05-06T20:30:07.871Z] //// Failed to open server socket on port 46328
[2025-05-06T20:30:07.871Z] ////////////////////////////////////////////////////////////////////////
...
[2025-05-06T20:36:53.493Z] FAILED: testServerComesUpAfterClientAndGoesDownAgain
[2025-05-06T20:36:53.493Z] java.lang.AssertionError: Failed to properly start server, it terminated prematurely with exit value: 1
[2025-05-06T20:36:53.493Z] 	at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
[2025-05-06T20:36:53.493Z] 	at jit.test.jitserver.JITServerTest.startProcess(JITServerTest.java:382)
[2025-05-06T20:36:53.493Z] 	at jit.test.jitserver.JITServerTest.testServerComesUpAfterClientAndGoesDownAgain(JITServerTest.java:588)
...
[2025-05-06T20:36:53.493Z] -----------------------------------
[2025-05-06T20:36:53.493Z] testJITServer_0_FAILED
[2025-05-06T20:36:53.493Z] -----------------------------------

@a7ehuo

a7ehuo commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

We can also rule out issue 3 (J9vmTest_3/4 test) since J9vmTest_3 also failed in another PR build test: https://openj9-jenkins.osuosl.org/job/Pipeline_Build_Test_JDK8_s390x_linux/3014/

@hzongaro

hzongaro commented May 7, 2025

Copy link
Copy Markdown
Member

Issue 1 has previously been reported in #21378 (comment)

@hzongaro

hzongaro commented May 7, 2025

Copy link
Copy Markdown
Member

Test failures are all due to known issues. Merging.

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

Labels

Projects

None yet

4 participants