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
8262894: [macos_aarch64] SIGBUS in Assembler::ld_st2 #3241
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3723,6 +3723,10 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) { | |
|
||
// Since this is not a JVM_ENTRY we have to set the thread state manually before entering. | ||
JavaThread* thread = JavaThread::current(); | ||
|
||
// We are going to VM, change W^X state to the expected one. | ||
MACOS_AARCH64_ONLY(WXMode oldmode = thread->enable_wx(WXWrite)); | ||
|
||
ThreadStateTransition::transition_from_native(thread, _thread_in_vm); | ||
if (Threads::destroy_vm()) { | ||
// Should not change thread state, VM is gone | ||
|
@@ -3731,6 +3735,7 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) { | |
return res; | ||
} else { | ||
ThreadStateTransition::transition(thread, _thread_in_vm, _thread_in_native); | ||
MACOS_AARCH64_ONLY(thread->enable_wx(oldmode)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually unnecessary as Threads::destroy_vm never returns anything but true (we should change it to a void method and clean this up). If it were to fail you would have to know at what point it failed to determine whether you can actually touch the current thread any more. |
||
res = JNI_ERR; | ||
return res; | ||
} | ||
|
@@ -3910,6 +3915,9 @@ jint JNICALL jni_DetachCurrentThread(JavaVM *vm) { | |
return JNI_ERR; | ||
} | ||
|
||
// We are going to VM, change W^X state to the expected one. | ||
MACOS_AARCH64_ONLY(thread->enable_wx(WXWrite)); | ||
|
||
// Safepoint support. Have to do call-back to safepoint code, if in the | ||
// middle of a safepoint operation | ||
ThreadStateTransition::transition_from_native(thread, _thread_in_vm); | ||
|
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.
No need to save old state - see below.