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

Thomas Stuefe stuefe at openjdk.java.net
Thu Nov 18 13:58:40 UTC 2021


On Thu, 18 Nov 2021 12:12:17 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> Thomas Stuefe 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 two additional commits since the last revision:
>> 
>>  - Merge
>>  - Let NMT do overflow detection
>
> src/hotspot/share/services/mallocTracker.cpp line 143:
> 
>> 141:   from2 = MAX2(to, from2);
>> 142:   address to2 = from2 + 96;
>> 143:   if (to2 > to) {
> 
> Don't understand this. If `from2 = MAX2(to, from2)` then `from2 >= to`. So shouldn't `to2` (which is `from2 + 96`) always be bigger then `to`?

You are absolutely right, and the code is not very clear either, I'll improve it.

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

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


More information about the hotspot-dev mailing list