RFR: 8146416: java.lang.OutOfMemoryError triggers: assert(current_bci == 0) failed: bci isn't zero for do_not_unlock_if_synchronized

Jamsheed C m jamsheed.c.m at oracle.com
Wed May 25 16:12:49 UTC 2016



On 5/25/2016 9:21 PM, Roland Westrelin wrote:
>> in exception triggered deopt, the interpreter continuation pc will be
>> Interpreter::_rethrow_exception_entry without the pending_exception flag
>> reset*(the realloc set pending exception flag).
>> this causes code to take different path after
>> InterpreterRuntime::exception_handler_for_exception(as pending_exception
>> is still set). and pop frame logic doesnt work.
> I think the fix then is to not go to
> Interpreter::_rethrow_exception_entry with a pending exception. So in
> that case, Deoptimization::realloc_objects() should overwrite
> _exception_oop rather than set _pending_exception.
>
> Unfortunately, because of this code at the end of fetch_unroll_info_helper):
>
> #ifdef INCLUDE_JVMCI
>    if (exceptionObject() != NULL) {
>      thread->set_exception_oop(exceptionObject());
>      exec_mode = Unpack_exception;
>    }
> #endif
>
> that might not be good enough for JVMCI. So maybe we want something like
> this right after the code above:
>
> if (thread->has_pending_exception() && thread->exception_oop() != NULL) {
>    assert(thread->frames_to_pop_failed_realloc() > 0, "realloc should
> have failed");
>    thread->set_exception_oop(thread->pending_exception());
>    thread->clear_pending_exception();
> }
if realloc failure happened for non exception deoptimization then? we 
need to throw an exception at runtime exit..

this wouldn't take care that.

Best Regards,
Jamsheed


>
> Roland.
>
>> and in case of single frame case deopt. pop never happens and
>> do_not_unlock_if_synchronized is not made false.
>>
>> even in TemplateInterpreterGenerator::generate_deopt_entry_for case
>> pending exception is not expected!
>>
>> see..
>>   // handle exceptions
>>
>>    {
>>      Label L;
>>      __ cmpptr(Address(thread, Thread::pending_exception_offset()),
>> (int32_t) NULL_WORD);
>>      __ jcc(Assembler::zero, L);
>>      __ call_VM(noreg,
>>                 CAST_FROM_FN_PTR(address,
>>                                 
>> InterpreterRuntime::throw_pending_exception));
>>      __ should_not_reach_here();
>>      __ bind(L);
>>    }
>>
>>> With your test case, can the failure be reproduced with c2?
>> Yes.
>>
>> Thank you
>> Jamsheed
>>> Roland.



More information about the hotspot-compiler-dev mailing list