RFR: 8342504: Remove NMT header and footer canaries [v2]
Julian Waters
jwaters at openjdk.org
Mon Nov 18 14:07:52 UTC 2024
On Mon, 18 Nov 2024 12:26:32 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp line 67:
>>
>>> 65: // realloc is the trickiest of the bunch. Test that realloc works and correctly takes over
>>> 66: // NMT header and footer to the resized block. We just test that nothing crashes - if the
>>> 67: // header/footer get corrupted, NMT heap corruption checker will trigger alert on os::free()).
>>
>> After removing canary, can NMT still check memory corruption?
>
> No, not anymore. The canaries are how we perform memory corruption checks. As mentioned in the PR description, I believe that since we have introduced UBSan and ASan it is no longer necessary for NMT to be able to detect memory corruption.
I would like to caution that this would trash the ability to check for corruption for platforms that don't support ubsan and asan. Windows, with the VC compiler, comes to mind (Actually, even the Windows/gcc Port cannot use ubsan and asan either, since the sanitizers haven't been properly ported for Windows in general)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21560#discussion_r1846647481
More information about the hotspot-runtime-dev
mailing list