RFR: 8369393: NMT: poison the malloc header and footer under ASAN build [v2]

Thomas Stuefe stuefe at openjdk.org
Fri Jan 16 14:11:56 UTC 2026


On Wed, 17 Dec 2025 09:02:19 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> Under ASAN builds and when NMT is enabled, the header and footer of MallocHeader are poisoned/unpoisoned at malloc/realloc/free times.
>> Checking the integrity of memory blocks is off under ASAN builds.
>
> Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into asan_poison_malloc_hdr_ftr_v2
>  - removed extra newlines.
>  - fixes.
>  - inlining
>  - review comments applied.
>  - revision
>  - jtreg test excluded when ASAN is enabled.
>  - 8369393: NMT: poison the malloc header and footer under ASAN build

src/hotspot/share/nmt/mallocHeader.hpp line 36:

> 34: 
> 35: #if INCLUDE_ASAN
> 36: #undef NMT_BLOCK_INTEGRITY_CHECKS

Can you add a comment like this:

// With ASAN, we omit NMT block integrity checks since ASAN does a better and faster
// job of alerting us to memory corruptions

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28503#discussion_r2698638579


More information about the hotspot-runtime-dev mailing list