From 43b98e9fed6861590bde030ee8bbbd6e7935a1ba Mon Sep 17 00:00:00 2001 From: Simon Tooke Date: Tue, 9 Jun 2026 11:41:49 -0400 Subject: [PATCH] fix crash and expected strings in test case --- test/hotspot/gtest/runtime/test_os.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index c6fa1e568fd..ed3882f4e6e 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -131,7 +131,7 @@ TEST_VM(os, test_print_markword) { markWord m0 = obj->mark(); static markWord markWords[] = { markWord(0), m0, m0.set_age(2), m0.copy_set_hash(0x12345) }; - static const char* expected[] = { "is null", "unknown", "age", "foo" }; + static const char* expected[] = { "is null", "mark(is_unlocked no_hash age=0) java.lang.Byte", "age=2", "is an unknown value" }; outputStream* out = fdStream::stdout_stream(); int nmark = sizeof(markWords) / sizeof(int64_t); int nresult = sizeof(expected) / sizeof(const char*); @@ -140,6 +140,7 @@ TEST_VM(os, test_print_markword) { if (UseCompactObjectHeaders) { for (int i = 0; i < nmark; i++) { stringStream st; + MutexLocker lock(ClassLoaderDataGraph_lock); os::print_location(&st, (intptr_t) markWords[i].to_pointer(), true); out->print("\n====================\nword 0x%p, '%s' result:\n%s\n", markWords[i].to_pointer(), expected[i], st.base()); ASSERT_THAT(st.base(), testing::HasSubstr(expected[i]));