-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync #18238
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
Closed
reinrich
wants to merge
5
commits into
openjdk:master
from
reinrich:8327990_jfr_enters_vm_without_wxwrite
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b34ad5f
Switch to WXWrite before entering the vm
reinrich 9075f4b
Set WXWrite at more locations
reinrich 1b4d760
Merge branch 'master' into 8327990_jfr_enters_vm_without_wxwrite
reinrich fc38372
2 more locations
reinrich 8239638
Merge branch 'master' into 8327990_jfr_enters_vm_without_wxwrite
reinrich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand you placed this here to cover the transition inside
create_classes_array
and the immediate one at line 170, but doesn't this risk having the wrong WX state for code in between?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've asked this myself (after making the change).
Being in
WXWrite
mode would be wrong if the thread would execute dynamically generated code. There's not too much happening outside the scope of theThreadInVMfromNative
instances. I see jni calls (GetObjectArrayElement
,ExceptionOccurred
) and a jvmti call (RetransformClasses
) but these are safe because the callees enter the vm right away. We even avoid switching toWXWrite
and back there.So I thought it would be ok to coarsen the WXMode switching.
But maybe it's still better to avoid any risk especially since there's likely no performance effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or could the
ThreadInVMfromNative tvmfn(THREAD);
incheck_exception_and_log
be move out toJfrJvmtiAgent::retransform_classes
? And then only use oneThreadInVMfromNative
inJfrJvmtiAgent::retransform_classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would require hoisting the
ThreadInVMfromNative
out of the loop with thecheck_exception_and_log
call but then the thread would be in_thread_in_vm
when doing theGetObjectArrayElement
jni call which would be wrong.