RFR: 8283849: AsyncGetCallTrace may crash JVM on guarantee [v12]
Jaroslav Bachorik
jbachorik at openjdk.java.net
Wed May 18 06:45:41 UTC 2022
On Wed, 18 May 2022 05:30:53 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Change comment wording
>
> src/hotspot/share/code/codeCache.cpp line 662:
>
>> 660: bool is_zombie = result != NULL && result->is_zombie();
>> 661: bool is_result_safe = !is_zombie || result->is_locked_by_vm() || VMError::is_error_reported();
>> 662: guarantee(is_result_safe || is_in_asgct(), "unsafe access to zombie method");
>
> Why is this a guarantee? Does it still need to be one? We usually avoid paying for assert setup in release VMs, its rather uncommon to use guarantee.
Not the original author so it is just my best guess - the consequences of accidentally touching dead code blob (where the data structures could have been freed or reused) were considered bad enough to justify the 'guarantee'.
Unfortunately, if the code blob is not locked even this guarantee can pass but we can still return a zombie a moment later. But that is another story that will need to be ironed out for ASGCT(2?)
-------------
PR: https://git.openjdk.java.net/jdk/pull/8549
More information about the serviceability-dev
mailing list