Skip to content

Commit 99e9d62

Browse files
rgithubliVictor Rudometov
authored andcommitted
8364198: NMT should have a better corruption message
Backport-of: 2202156acc78d7d9ec128f8df5c09fcdff83697c
1 parent a4e9098 commit 99e9d62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/hotspot/share/nmt/mallocHeader.inline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ inline OutTypeParam MallocHeader::resolve_checked_impl(InTypeParam memblock) {
104104
OutTypeParam header_pointer = (OutTypeParam)memblock - 1;
105105
if (!header_pointer->check_block_integrity(msg, sizeof(msg), &corruption)) {
106106
header_pointer->print_block_on_error(tty, corruption != nullptr ? corruption : (address)header_pointer);
107-
fatal("NMT corruption: Block at " PTR_FORMAT ": %s", p2i(memblock), msg);
107+
fatal("NMT has detected a memory corruption bug. Block at " PTR_FORMAT ": %s", p2i(memblock), msg);
108108
}
109109
return header_pointer;
110110
}

test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// This prefix shows up on any c heap corruption NMT detects. If unsure which assert will
3737
// come, just use this one.
38-
#define COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX "NMT corruption"
38+
#define COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX "NMT has detected a memory corruption bug."
3939

4040
#define DEFINE_TEST(test_function, expected_assertion_message) \
4141
TEST_VM_FATAL_ERROR_MSG(NMT, test_function, ".*" expected_assertion_message ".*") { \

0 commit comments

Comments
 (0)