JDK-8278874 : VerifyStack logic is too permissive
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-12-16
  • Updated: 2022-02-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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
842              /* SPARC */
843              (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + callee_size_of_parameters) ||
844              /* x86 */
845              (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + callee_max_locals) ||
846              (try_next_mask &&
847               (iframe->interpreter_frame_expression_stack_size() == (next_mask_expression_stack_size -
848                                                                      top_frame_expression_stack_adjustment))) ||
849              (is_top_frame && (exec_mode == Unpack_exception) && iframe->interpreter_frame_expression_stack_size() == 0) ||
850              (is_top_frame && (exec_mode == Unpack_uncommon_trap || exec_mode == Unpack_reexecute || el->should_reexecute()) &&
851               (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + cur_invoke_parameter_size))

This is extra conservative.  It applies both x86 and SPARC (obsolete) logic to all platforms.  The special case for Unpack_exception may not be needed.

I found a problem with arraylength (see JDK-8278384), but it goes unnoticed because the VerifyStack logic is too permissive.