From 4451a927bc151b23246f733e8eb892080dd693af Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 9 Nov 2023 10:48:26 +0000 Subject: [PATCH] 8319748: [JVMCI] TestUseCompressedOopsFlagsWithUlimit.java crashes on libgraal Reviewed-by: never, thartmann --- src/hotspot/share/jvmci/jvmciEnv.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index f5a3e5b4d4d..47db09d6922 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -589,7 +589,9 @@ jboolean JVMCIEnv::transfer_pending_exception(JavaThread* THREAD, JVMCIEnv* peer JVMCIEnv::~JVMCIEnv() { if (_init_error_msg != nullptr) { - os::free((void*) _init_error_msg); + // The memory allocated in libjvmci was not allocated with os::malloc + // so must not be freed with os::free. + ALLOW_C_FUNCTION(::free((void*) _init_error_msg)); } if (_init_error != JNI_OK) { return;