RFR: JDK-8275320: NMT should perform buffer overrun checks [v2]

Volker Simonis simonis at openjdk.java.net
Thu Nov 18 17:09:42 UTC 2021


On Thu, 18 Nov 2021 14:16:12 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/services/mallocTracker.hpp line 314:
>> 
>>> 312:   static const uint8_t  _footer_canary_dead_mark = 0xFB;
>>> 313:   NOT_LP64(static const uint32_t _header_alt_canary_life_mark = 0xFAFA1F1F;)
>>> 314:   NOT_LP64(static const uint32_t _header_alt_canary_dead_mark = 0xFBFB1F1F;)
>> 
>> Just out of interest, how did you choose these canary marks? Is there some evidence that they appear less frequently in real code/data than other values?
>
> I did an extensive statistical analysis of many core dumps.
> 
> ...
> 
> ...
> 
> Just kidding, I chose them on a whim to be not zero :) Do you have a better suggestion? I thought about making them ASCII pattern, but those are actually more common in payload data.

I was just thinking of the usual suspects like 0xcafebabe, 0xbaadbabe or 0xdeadbeef because that would simplify the detection of these markers in core dumps, hs_err files or during debugging. But I'm fine with whatever you choose :)

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

PR: https://git.openjdk.java.net/jdk/pull/5952


More information about the hotspot-dev mailing list