RFR: 8283849: AsyncGetCallTrace may crash JVM on guarantee [v2]
David Holmes
dholmes at openjdk.java.net
Tue May 3 01:33:23 UTC 2022
On Mon, 2 May 2022 07:51:35 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:
>> A gist of the fix is to allow relaxed instantiation of a frame when done from a signal handler - eg. for profiling purposes.
>>
>> Currently, a frame instantiation will fail on guarantee when we happen to hit a zombie method which is still on stack. While this would indicate a serious error for the normal execution flow, in case of profiling where the executing thread can be expected at any possible method this is something which may happen and we really should not take the profiled JVM down due to it.
>>
>> The behaviour defaults to checking the code blob status in the guarantee so nothing will change for the rest of the callers - just ASGCT will be affected.
>>
>> <hr>
>> Unfortunately, I am not able to create a simple reproducer for the crash other that testing in our production where the crash is happening sporadically.
>> However, thanks to @parttimenerd and his [ASGCT stress test](https://github.com/parttimenerd/asgct2-tester.git) the problem can be reproduced quite reliably.
>
> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix indentation
Changes requested by dholmes (Reviewer).
src/hotspot/cpu/ppc/frame_ppc.inline.hpp line 39:
> 37: assert(pc != NULL, "precondition: must have PC");
> 38:
> 39: if (!forSignalHandler) {
To reduce the duplication I suggest adding a helper method to CodeCache:
CodeBlob* find_blob(address pc, bool for_signal_handler) {
if (!for_signal_handler) {
return find_blob(pc);
} else {
CodeBlob* tmp = find_blob_unsafe(pc);
if (tmp != NULL && temp->is_zombie()) {
tmp = null;
}
return tmp;
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/8061
More information about the hotspot-dev
mailing list