RFR: 8332671: Logging for pretouching thread stacks shows wrong memory range [v2]

Thomas Stuefe stuefe at openjdk.org
Thu May 23 12:19:27 UTC 2024


On Thu, 23 May 2024 09:53:47 GMT, Aleksey Shipilev <shade 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 branch 'openjdk:master' into JDK-8332671-Logging-for-pretouching-thread-stacks-shows-wrong-memory-range
>>  - JDK-8332671-Logging-for-pretouching-thread-stacks-shows-wrong-memory-range
>
> src/hotspot/share/runtime/javaThread.cpp line 2234:
> 
>> 2232:       char* p2 = (char*) alloca(to_alloc);
>> 2233:       log_trace(os, thread)("Pretouching thread stack for " UINTX_FORMAT ": " RANGEFMT " (" SIZE_FORMAT ").",
>> 2234:                             (uintx) osthread()->thread_id(), RANGEFMTARGS(p2, to_alloc), to_alloc);
> 
> Looks to me `RANGEFMTARGS` already prints the number of bytes in range, so printing `to_alloc` is excessive?

Grr. Shows that you can make an error in a trivial one line change. Thanks for catching.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19342#discussion_r1611586978


More information about the hotspot-runtime-dev mailing list