RFR: 8289093: BlockLocationPrinter fails to decode addresses with G1
Thomas Schatzl
tschatzl at openjdk.org
Sat Jun 25 19:56:02 UTC 2022
On Fri, 24 Jun 2022 22:12:16 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Hi all,
>>
>> can I have reviews for this change that fixes an assertion failure when trying to add annotations to the hs_err file?
>>
>> The `block_start` API from `CollectedHeap` assumes that useful values for all given addresses is returned, not asserting/crashing like some method deeper in the call chain does since [JDK-8270540](https://bugs.openjdk.org/browse/JDK-8270540), resulting in somewhat scrambled hs_err files and additional stack frames to look at in the debugger.
>>
>> Testing: local compilation, gha, tier1-3
>>
>> Thanks,
>> Thomas
>
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 2355:
>
>> 2353: // outside of the allocated area.
>> 2354: if (addr >= hr->top()) {
>> 2355: return hr->top();
>
> In the caller, `block_is_obj` from `if (p != NULL && CollectedHeapT::heap()->block_is_obj(p)) {` would choke on `top` as well, right? Returning `nullptr` makes more sense to me.
Or fixing `block_is_obj`...
-------------
PR: https://git.openjdk.org/jdk19/pull/68
More information about the hotspot-gc-dev
mailing list