From 59f66a3b839c5b77c2770fa0bdd76f399d2d86d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Fri, 21 Jul 2023 12:21:35 +0000 Subject: [PATCH] 8312293: SIGSEGV in jfr.internal.event.EventWriter.putUncheckedByte after JDK-8312086 Reviewed-by: egahlin --- src/hotspot/share/jfr/support/jfrIntrinsics.cpp | 3 ++- src/hotspot/share/jfr/support/jfrIntrinsics.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jfr/support/jfrIntrinsics.cpp b/src/hotspot/share/jfr/support/jfrIntrinsics.cpp index 59d4b37f028e2..acc640077d46e 100644 --- a/src/hotspot/share/jfr/support/jfrIntrinsics.cpp +++ b/src/hotspot/share/jfr/support/jfrIntrinsics.cpp @@ -71,7 +71,7 @@ void* JfrIntrinsicSupport::write_checkpoint(JavaThread* jt) { return JfrJavaEventWriter::event_writer(jt); } -void JfrIntrinsicSupport::return_lease(JavaThread* jt) { +void* JfrIntrinsicSupport::return_lease(JavaThread* jt) { DEBUG_ONLY(assert_precondition(jt);) ThreadStateTransition::transition_from_java(jt, _thread_in_native); assert(jt->jfr_thread_local()->has_java_event_writer(), "invariant"); @@ -79,6 +79,7 @@ void JfrIntrinsicSupport::return_lease(JavaThread* jt) { JfrJavaEventWriter::flush(jt->jfr_thread_local()->java_event_writer(), 0, 0, jt); assert(jt->jfr_thread_local()->shelved_buffer() == nullptr, "invariant"); ThreadStateTransition::transition_from_native(jt, _thread_in_Java); + return nullptr; } void JfrIntrinsicSupport::load_barrier(const Klass* klass) { diff --git a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp index 2e59749a61d89..65a94164a9756 100644 --- a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp +++ b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp @@ -37,7 +37,7 @@ class JfrIntrinsicSupport : AllStatic { public: static void* write_checkpoint(JavaThread* jt); - static void return_lease(JavaThread* jt); + static void* return_lease(JavaThread* jt); static void load_barrier(const Klass* klass); static address epoch_address(); static address signal_address();