JDK-8279701 : Consolidate comments and code related to async exceptions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2022-01-10
  • Updated: 2022-08-01
  • Resolved: 2022-08-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20Resolved
Related Reports
Duplicate :  
Relates :  
Description
Processing async exceptions while coming from compiled code has a couple of issues:

1) The exception table might not be valid so there might not be a proper exception handler for it. Solution: Deoptimize the compiled frame.
2) For normal safepoint poll path (is_at_poll_safepoint()) we cannot deoptimize and install the exception at the same time because live registers get clobbered on the exception path before deoptimization is able to retrieve them. Solution: Don't process async exceptions at normal safepoint poll.
3) If we don't deoptimize after setting an async condition for the normal safepoint poll path, then we might never deliver it since we might never hit a path that process asynchronous exceptions. Solution: Same as 1), deoptimize the frame.

The comments and code for the three issues above are mixed and duplicated between methods check_and_handle_async_exceptions(), send_thread_stop(), and handle_polling_page_exception() and it's hard to put everything together to understand what's actually needed for each code path. Furthermore there are some inconsistencies, like we don't deoptimize for all code paths if the async exception happens to be an InternalError. Also the code in check_and_handle_async_exceptions() that tries to identify if we are in the is_at_poll_safepoint() case is never reached since we specifically don't process async exceptions in that path. 

All the code and comments could be consolidated in check_and_handle_async_exceptions() in a more clear way.
Comments
Ok, thanks Dan I'll close it as duplicate then.
01-08-2022

Only fixed with associated changesets should be closed as fixed. I believe you should close this bug as a duplicate of JDK-8283044.
01-08-2022

This has been addressed in change 8283044.
01-08-2022