From 155697fc0ed69f1b4f871b00fe67685177bad59a Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Fri, 7 Mar 2025 09:13:06 +0000 Subject: [PATCH] 8349623: [ASAN] Gtest os_linux.glibc_mallinfo_wrapper_vm fails Reviewed-by: stuefe --- test/hotspot/gtest/runtime/test_os_linux.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/gtest/runtime/test_os_linux.cpp b/test/hotspot/gtest/runtime/test_os_linux.cpp index ebb4e53c80f..caa227c5e35 100644 --- a/test/hotspot/gtest/runtime/test_os_linux.cpp +++ b/test/hotspot/gtest/runtime/test_os_linux.cpp @@ -444,26 +444,28 @@ TEST_VM(os_linux, decoder_get_source_info_valid_overflow_minimal) { #endif // clang #ifdef __GLIBC__ +#ifndef ADDRESS_SANITIZER TEST_VM(os_linux, glibc_mallinfo_wrapper) { // Very basic test. Call it. That proves that resolution and invocation works. os::Linux::glibc_mallinfo mi; bool did_wrap = false; - os::Linux::get_mallinfo(&mi, &did_wrap); - void* p = os::malloc(2 * K, mtTest); ASSERT_NOT_NULL(p); + os::Linux::get_mallinfo(&mi, &did_wrap); + // We should see total allocation values > 0 ASSERT_GE((mi.uordblks + mi.hblkhd), 2 * K); - // These values also should exceed some reasonable size. + // These values also should less than some reasonable size. ASSERT_LT(mi.fordblks, 2 * G); ASSERT_LT(mi.uordblks, 2 * G); ASSERT_LT(mi.hblkhd, 2 * G); os::free(p); } +#endif // ADDRESS_SANITIZER #endif // __GLIBC__ #endif // LINUX