-
Bug
-
Resolution: Won't Fix
-
P4
-
9
-
generic
When the interpreter checks if there's enough free stack space to
executed the method being invoked, it doesn't take account the
biggest execution stack of the method (method->max_stack()).
InterpreterGenerator::generate_stack_overflow_check() verifies
that there's enough space for:
- space for extra locals (non argument local variables)
- monitor space
- fixed frame header
AbstractInterpreterGenerator::bang_stack_shadow_pages() verifies
that there's at least StackShadowPages available.
But no there's no test considering the execution stack used
by the interpreter while executing the method.
It might be possible to generate a valid method with a huge
execution stack, that passes the interpreter checks but hits the
Yellow zone during its execution.
Even worse, the stack banging is also wrong, because it starts
from the current SP, when the frame has an empty execution stack.
So, what the current code is doing is to ensure that there's
at least StackShadowPages*os::vm_page_size() - method->max_stack()
free space (rounded at page granularity) to execute VM code.
If method->max_stack() becomes huge, the real stack space available
for the VM can be much less than StackShadowPages.
executed the method being invoked, it doesn't take account the
biggest execution stack of the method (method->max_stack()).
InterpreterGenerator::generate_stack_overflow_check() verifies
that there's enough space for:
- space for extra locals (non argument local variables)
- monitor space
- fixed frame header
AbstractInterpreterGenerator::bang_stack_shadow_pages() verifies
that there's at least StackShadowPages available.
But no there's no test considering the execution stack used
by the interpreter while executing the method.
It might be possible to generate a valid method with a huge
execution stack, that passes the interpreter checks but hits the
Yellow zone during its execution.
Even worse, the stack banging is also wrong, because it starts
from the current SP, when the frame has an empty execution stack.
So, what the current code is doing is to ensure that there's
at least StackShadowPages*os::vm_page_size() - method->max_stack()
free space (rounded at page granularity) to execute VM code.
If method->max_stack() becomes huge, the real stack space available
for the VM can be much less than StackShadowPages.
- relates to
-
JDK-8072070 Improve interpreter stack banging
- Resolved