From 92fa4f13c6aec8a7958867ce67d89b778c87de7b Mon Sep 17 00:00:00 2001 From: Afshin Zafari Date: Tue, 24 Feb 2026 09:19:11 +0000 Subject: [PATCH] 8372231: Test gtest/NMTGtests.java#nmt-summary crashed Reviewed-by: phubner, jsjolen --- .../test_nmt_buffer_overflow_detection.cpp | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp index c65808d3f4d..e3b03440141 100644 --- a/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,6 @@ "fake message ignore this - " expected_assertion_message); \ } \ } - /////// #if !INCLUDE_ASAN @@ -86,31 +85,6 @@ DEFINE_TEST(test_overwrite_back_long_unaligned_distance, "footer canary broken") /////// -static void test_double_free() { - address p = (address) os::malloc(1, mtTest); - os::free(p); - // Now a double free. Note that this is susceptible to concurrency issues should - // a concurrent thread have done a malloc and gotten the same address after the - // first free. To decrease chance of this happening, we repeat the double free - // several times. - for (int i = 0; i < 100; i ++) { - os::free(p); - } -} - -// What assertion message we will see depends on whether the VM wipes the memory-to-be-freed -// on the first free(), and whether the libc uses the freed memory to store bookkeeping information. -// If the death marker in the header is still intact after the first free, we will recognize this as -// double free; if it got wiped, we should at least see a broken header canary. -// The message would be either -// - "header canary broken" or -// - "header canary dead (double free?)". -// However, since gtest regex expressions do not support unions (a|b), I search for a reasonable -// subset here. -DEFINE_TEST(test_double_free, "header canary") - -/////// - static void test_invalid_block_address() { // very low, like the result of an overflow or of accessing a null this pointer os::free((void*)0x100);