8364198: NMT should have a better corruption message

Reviewed-by: kvn, stuefe
This commit is contained in:
Johan Sjölen 2025-07-29 08:37:35 +00:00
parent 3fe0d29ec3
commit 2202156acc
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ inline OutTypeParam MallocHeader::resolve_checked_impl(InTypeParam memblock) {
OutTypeParam header_pointer = (OutTypeParam)memblock - 1;
if (!header_pointer->check_block_integrity(msg, sizeof(msg), &corruption)) {
header_pointer->print_block_on_error(tty, corruption != nullptr ? corruption : (address)header_pointer);
fatal("NMT corruption: Block at " PTR_FORMAT ": %s", p2i(memblock), msg);
fatal("NMT has detected a memory corruption bug. Block at " PTR_FORMAT ": %s", p2i(memblock), msg);
}
return header_pointer;
}

View File

@ -35,7 +35,7 @@
// This prefix shows up on any c heap corruption NMT detects. If unsure which assert will
// come, just use this one.
#define COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX "NMT corruption"
#define COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX "NMT has detected a memory corruption bug."
#define DEFINE_TEST(test_function, expected_assertion_message) \
TEST_VM_FATAL_ERROR_MSG(NMT, test_function, ".*" expected_assertion_message ".*") { \