RFR: 8369393: NMT: poison the canaries of malloc header under ASAN build [v7]

Afshin Zafari azafari at openjdk.org
Fri Nov 7 08:40:03 UTC 2025


On Wed, 5 Nov 2025 09:22:32 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> In `.../clang/15.0.0/include/sanitizer/asan_interface.h`, the ASAN_(UN)POISON_MEMORY_REGION  macros would be empty as  
>> ```C++
>> // Macros provided for convenience.
>> #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
>> /// Marks a memory region as unaddressable.
>> ///
>> /// \note Macro provided for convenience; defined as a no-op if ASan is not
>> /// enabled.
>> ///
>> /// \param addr Start of memory region.
>> /// \param size Size of memory region.
>> #define ASAN_POISON_MEMORY_REGION(addr, size) \
>>   __asan_poison_memory_region((addr), (size))
>> 
>> /// Marks a memory region as addressable.
>> ///
>> /// \note Macro provided for convenience; defined as a no-op if ASan is not
>> /// enabled.
>> ///
>> /// \param addr Start of memory region.
>> /// \param size Size of memory region.
>> #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
>>   __asan_unpoison_memory_region((addr), (size))
>> #else
>> #define ASAN_POISON_MEMORY_REGION(addr, size) \
>>   ((void)(addr), (void)(size))
>> #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
>>   ((void)(addr), (void)(size))
>> #endif
>> 
>> 
>> I couldn't find yet why is that. So a fast/certain solution was to define the `__SANITIZE_ADDRESS__` explicitly.
>> Should be found before integrating this PR.
>
> @afshin-zafari , could you respond to this?

It was not needed. Removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27685#discussion_r2502139513


More information about the hotspot-runtime-dev mailing list