[aarch64-port-dev ] RFR: fix for crash caused by earlyret of compiled method
Sergey Nazarkin
snazarkin at azul.com
Tue Jun 13 13:24:27 UTC 2017
Hi!
Please review the fix [1] for the crash happens when compiled method is forced to return early. We found this issue when running vm/jvmti/ForceEarlyReturnObject/fero001/fero00103/fero00103.html JCK test on CPU with 47 cores.
The crash happens at the time when test code tries to check returned value and gets invalid oop. Despite correct object was acquired by load_earlyret_value(), it is accidentally substituted on the stack when remove_activation() is executed (see TemplateInterpreterGenerator::generate_earlyret_entry_for). Substitution, in turns, happens due to overlapping of expression and native stacks. Particularly esp equals to sp because frame with no expression is restored (that is correct).
After that execution of following code sequence replaces TOS with some irrelevant value.
push(tos) // -> puts value on expression stack
unlock_object() // -> calls call_VM() and save registers on native stack, in fact, at the same place as esp
pop(tos) // -> restores invalid value
The fix restores expression stack to max possible for deoptimized method size. Please consider if this fix covers the case workarounded by [2] (I was not able to trace back and find the reason for this changeset).
[1] http://cr.openjdk.java.net/~snazarki/earlyret_crash/
[2] http://hg.openjdk.java.net/aarch64-port/jdk8u60/hotspot/file/83f5fdfd56ec/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp#l1909
Sergey Nazarkin
More information about the aarch64-port-dev
mailing list