RFR: 8340392: Handle OopStorage in location decoder [v4]

David Holmes dholmes at openjdk.org
Thu Sep 19 06:17:35 UTC 2024


On Thu, 19 Sep 2024 05:42:18 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Another debugging QoL improvement.  Currently, when there is a pointer into `OopStorage` that we need to decode for the error log, we just print:
>> 
>>   0x00007ad45c169e10 into live malloced block starting at 0x00007ad45c169dd0, size 632, tag mtInternal
>> 
>> 
>> This is reported by NMT after [JDK-8304815](https://bugs.openjdk.org/browse/JDK-8304815). It is likely worse without NMT. We can actually decode which block in which `OopStorage` the address likely belongs to. This becomes handy when debugging GC crashes that involve `OopStorage`-handled roots.
>> 
>> This patch is able to print the following instead:
>> 
>> 
>>   0x0000000102c05bd0 is a pointer 2/64 into block 0 in oop storage "VM Global"
>
> Aleksey Shipilev has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Try to handle unaligned pointers well
>  - Indenting and formats

src/hotspot/share/gc/shared/oopStorage.cpp line 1140:

> 1138: bool OopStorage::print_containing(const oop* addr, outputStream* st) {
> 1139:   if (addr != nullptr) {
> 1140:     Block *block = find_block_or_null(addr);

Suggestion:

    Block* block = find_block_or_null(addr);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21072#discussion_r1766207638


More information about the hotspot-dev mailing list