RFR: 8334738: os::print_hex_dump should optionally print ASCII [v2]

Thomas Stuefe stuefe at openjdk.org
Thu Jun 27 07:30:12 UTC 2024


On Thu, 27 Jun 2024 06:57:49 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with five additional commits since the last revision:
>> 
>>  - copyrights
>>  - const_address instead of const uint8_t*
>>  - use dot instead of underscore for unprintable
>>  - rely on default true
>>  - Revert "fix copyrights"
>>    
>>    This reverts commit 2b8bc55e53a88d13cd268dc89ebaac7fe42f60d5.
>
> src/hotspot/share/runtime/os.cpp line 949:
> 
>> 947:   uintptr_t i = (uintptr_t)SafeFetchN((intptr_t*)p, errval);
>> 948:   if (i == errval) {
>> 949:     i = (uintptr_t)SafeFetchN((intptr_t*)p, ~errval);
> 
> Pre-existing but if the initial fetch fails why do we think the second one can succeed ???

There is a one-in-2^(32|64) chance the errval numerical value happend to be in memory. By reading twice, with different errval, we diminish the chance of mistaking a successful read for an error.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19835#discussion_r1656601176


More information about the hotspot-dev mailing list