RFR: 8283044: Use asynchronous handshakes to deliver asynchronous exceptions [v4]
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Mon Mar 28 21:03:51 UTC 2022
On Mon, 28 Mar 2022 04:14:59 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address David's comments
>
> src/hotspot/share/runtime/thread.cpp line 1610:
>
>> 1608: assert(caller_fr.is_compiled_frame(), "what?");
>> 1609: if (caller_fr.is_deoptimized_frame()) {
>> 1610: log_info(exceptions)("deferred async exception at compiled safepoint");
>
> Where is, or should be, this logging in the new code?
It should be in ThreadSafepointState::handle_polling_page_exception(). Even in the old code that line should have been there since the previous place was just dead code (we don't call check_and_handle_async_exceptions() if is_at_poll_safepoint() is true). Added.
> src/hotspot/share/runtime/thread.cpp line 1651:
>
>> 1649: // We may be at method entry which requires we save the do-not-unlock flag.
>> 1650: UnlockFlagSaver fs(this);
>> 1651: Exceptions::throw_unsafe_access_internal_error(this, __FILE__, __LINE__, "a fault occurred in an unsafe memory access operation");
>
> This seems to be dead code in Exceptions now.
>
> Also the UnlockFlagSaver that was moved into thread.hpp could now be moved back to being a local class in interpreterRuntime.cpp.
Removed method Exceptions::throw_unsafe_access_internal_error(). I restored the UnlockFlagSaver though which I shouldn't have removed. I looked at the crash from 8246381 where this line was introduced and thought this cannot happen anymore after 8274379, since we will always check async exceptions on return from native to Java. But there is still the case where the unsafe access could happen from compiled Java code rather than from vm/native. If after that unsafe access we make a call to some synchronized method, interpreted version, then I think we could have the same issue.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7930
More information about the hotspot-runtime-dev
mailing list