RFR: 8342504: Remove NMT header and footer canaries [v2]

Thomas Stuefe stuefe at openjdk.org
Mon Dec 2 09:26:39 UTC 2024


On Mon, 18 Nov 2024 12:37:20 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Today NMT has two canaries: A header and a footer canary. These enable mainly two things:
>> 
>> 1. For NMT to aid in describing a pointer
>> 2. A basic form of out-of-bounds protection
>> 
>> With the introduction of UBSan and Asan into OpenJDK we have gained stronger tools for this sort of analysis, without requiring NMT to be activated. Therefore, I believe that point 2 is no longer something that NMT needs to support. For point number one, we will unfortunately be losing this ability.
>> 
>> I want to delete these canaries to open up a few free bytes. These can allow us to have "practically unlimited" (4 bytes) of memory tags.
>> 
>> tier1-tier2 tests succeeded.
>> 
>> I am awaiting discussion on the Hotspot-dev mailing list, but keeping this PR open for review.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename flags to tags

As I said in preparation of this work, I don't oppose it, but I am not happy. 

ASAN is not a replacement. ASAN is a special build, slow, needs tons of additional memory, stops at the first (often false) positive, and is often bitrotted since, to my knowledge, no vendor builds ASAN-enabled JVMs regularly. More importantly, if you have a problem in the field, it is easy to convince a customer to switch on NMT. You will not convince a customer to switch their production JVMs against an ASAN-enabled one.

But okay, let's remove it. I hope the capabilities this will enable are worth the loss of this capability.

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

PR Comment: https://git.openjdk.org/jdk/pull/21560#issuecomment-2510991731


More information about the hotspot-runtime-dev mailing list