RFR: JDK-8327971: Multiple ASAN errors reported for metaspace [v4]
Johan Sjölen
jsjolen at openjdk.org
Wed Mar 13 10:58:13 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
src/hotspot/share/memory/metaspace/metachunk.cpp line 2:
> 1: /*
> 2: * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
Not RedHat?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18230#discussion_r1523001147
More information about the hotspot-runtime-dev
mailing list