RFR: JDK-8327971: Multiple ASAN errors reported for metaspace [v4]
Guoxiong Li
gli at openjdk.org
Wed Mar 13 10:46:15 UTC 2024
On Wed, 13 Mar 2024 10:26:40 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> When adding ASAN support for metaspace, we decided to track poisoning not at the OS border (map) but at the border between metaspace and outer JVM code (or, more precisely, at the border of ChunkManager chunk allocation/deallocation).
>>
>> Chunks handed out by the chunk manager are unpoisoned, poisoned when handed back.
>>
>> This causes some problems, since within metaspace we access memory that is committed but not yet handed to the user. So from the ASANs view, that memory is poisoned; from the view of the metaspace allocator, these accesses are perfectly valid.
>>
>> Basic problem here is ASAN does not distinguish between illegal access from JVM caller code and legal access from within metaspace.
>>
>> The fixes required are minor. Without them even the ASAN build will fail. The ASAN errors are mostly caused by sections that are guarded with `MetaspaceTestInterval`.
>>
>> With the patch, ASAN build succeeds, and we survive metaspace gtests with `MetaspaceTestInterval` cranked up to the highest level.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>
> move code around
I just provided some thoughts or suggestions based on my understanding. If my understanding is not right or low, please ignore it. Thanks again for your guidance.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18230#issuecomment-1994084737
More information about the hotspot-runtime-dev
mailing list