Skip to content

Stash all invokedynamic and invokehandle arguments for OSR - #20232

Merged
0xdaryl merged 1 commit into
eclipse-openj9:masterfrom
jdmpapin:mh-osr-arg-stash
Sep 26, 2024
Merged

Stash all invokedynamic and invokehandle arguments for OSR#20232
0xdaryl merged 1 commit into
eclipse-openj9:masterfrom
jdmpapin:mh-osr-arg-stash

Conversation

@jdmpapin

Copy link
Copy Markdown
Contributor

When stashing arguments for OSR at an invokedynamic or invokehandle bytecode instruction, the callee usually has an extra parameter (the appendix, if it's non-null). If the call is unresolved, it expects two extra parameters instead (the appendix and a MemberName). For the purpose of stashing, these are all ignored because they're not on the stack just prior to running the invoke bytecode instruction. However, in these cases stashArgumentsForOSR() has been ignoring the top one or two elements of the stack as well, as though the extra arguments were already pushed. However, they haven't actually been pushed at this point, so we would simply fail to stash the last one or two regular arguments. Failure to stash could cause stack slots to appear falsely to be dead, and they could therefore be left uninitialized after an OSR transition at runtime.

This commit changes stashArgumentsForOSR() to use the stack size as-is because the regular arguments are still at the top of the stack.

Also keep numArgsToNotStash in the J9VM_OPT_OPENJDK_METHODHANDLE #if.

Fixes #19369

When stashing arguments for OSR at an invokedynamic or invokehandle
bytecode instruction, the callee usually has an extra parameter (the
appendix, if it's non-null). If the call is unresolved, it expects two
extra parameters instead (the appendix and a MemberName). For the
purpose of stashing, these are all ignored because they're not on the
stack just prior to running the invoke bytecode instruction. However,
in these cases stashArgumentsForOSR() has been ignoring the top one or
two elements of the stack as well, as though the extra arguments were
already pushed. However, they haven't actually been pushed at this
point, so we would simply fail to stash the last one or two regular
arguments. Failure to stash could cause stack slots to appear falsely to
be dead, and they could therefore be left uninitialized after an OSR
transition at runtime.

This commit changes stashArgumentsForOSR() to use the stack size as-is
because the regular arguments are still at the top of the stack.

Also keep numArgsToNotStash in the J9VM_OPT_OPENJDK_METHODHANDLE #if.
@jdmpapin

Copy link
Copy Markdown
Contributor Author

@0xdaryl, could you please review? This one is targeted for 0.48

@0xdaryl

0xdaryl commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Jenkins test sanity all jdk21

1 similar comment
@0xdaryl

0xdaryl commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Jenkins test sanity all jdk21

@jdmpapin

Copy link
Copy Markdown
Contributor Author

AArch64 Linux sanity.functional failures...

We hit #20233 in cmdLineTester_criu_jitPostRestore_[34]

"Test SSL Failure Case with mismatched certificate" failed in cmdLineTester_criu_jitserverPostRestore_2 with "address already in use" (#14706)

"Check SSL Verbose Log for connection failure with mismatched certificate" failed in cmdLineTester_criu_jitserverPostRestore_2. I couldn't find an open issue for this one, but the output only says that some files were missing and none of the expected output messages were found. I would be very surprised if this were related to my changes.

Testing: 
Test start time: 2024/09/25 20:09:06 Coordinated Universal Time
Running command: bash /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_aarch64_linux_Personal_testList_0/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu/criuCatVlog.sh sslVlog2 true true
Time spent starting: 7 milliseconds
Time spent executing: 23 milliseconds
Test result: FAILED
Output from test:
 [OUT] start running script
 [OUT] vlog sslVlog2 does not exist
 [OUT] 
 [OUT] Outputting previous test output
 [OUT] 
 [OUT] Removed test output files
 [OUT] finished script
 [ERR] cat: testOutput: No such file or directory
 [ERR] cat: criuOutput: No such file or directory
 [ERR] grep: testOutput: No such file or directory
 [ERR] grep: criuOutput: No such file or directory
>> Success condition was not found: [Output match: CHECKPOINT RESTORE: Ready for restore]
>> Success condition was not found: [Output match: JITServer::StreamFailure: Failed to SSL_connect]
>> Success condition was not found: [Output match: Could not connect to a server]
>> Failure condition was not found: [Output match: Connected to a server]
>> Success condition was not found: [Output match: CAT VLOG FORCE PASS]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT crash for java/lang/StringConcatHelper.stringOf(Ljava/lang/Object;)Ljava/lang/String;

2 participants