Skip to content

Commit 8ea7310

Browse files
committed
8331735: UpcallLinker::on_exit races with GC when copying frame anchor
8286875: ProgrammableUpcallHandler::on_entry/on_exit access thread fields from native Reviewed-by: mbalao Backport-of: 91457e694353386737e325e6fa0253bcefb8d579
1 parent ac00cd2 commit 8ea7310

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/hotspot/share/prims/universalUpcallHandler.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,17 @@ void ProgrammableUpcallHandler::on_exit(OptimizedEntryBlob::FrameData* context)
131131
// restore previous handle block
132132
thread->set_active_handles(context->old_handles);
133133

134-
thread->frame_anchor()->zap();
135-
136134
debug_only(thread->dec_java_call_counter());
137135

136+
thread->frame_anchor()->copy(&context->jfa);
137+
138138
// Old thread-local info. has been restored. We are now back in native code.
139139
ThreadStateTransition::transition_from_java(thread, _thread_in_native);
140140

141-
thread->frame_anchor()->copy(&context->jfa);
142-
143141
// Release handles after we are marked as being in native code again, since this
144142
// operation might block
145143
JNIHandleBlock::release_block(context->new_handles, thread);
146144

147-
assert(!thread->has_pending_exception(), "Upcall can not throw an exception");
148-
149145
if (context->should_detach) {
150146
detach_current_thread();
151147
}

0 commit comments

Comments
 (0)