8338819: JFR: Internal events causes crash when no other events are in use

Reviewed-by: mgronlun, sjohanss
This commit is contained in:
Erik Gahlin 2024-08-23 09:59:15 +00:00
parent 965dd1acd0
commit 21d1e4d803

View File

@ -191,6 +191,10 @@ void JfrUpcalls::new_bytes_eager_instrumentation(jlong trace_id,
bool JfrUpcalls::unhide_internal_types(TRAPS) {
DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD));
if (!initialize(THREAD)) {
log_error(jfr, system)("JfrUpcall could not be initialized.");
return false;
}
JavaValue result(T_VOID);
const Klass* klass = SystemDictionary::resolve_or_fail(jvm_upcalls_class_sym, true, CHECK_false);
assert(klass != nullptr, "invariant");