BUG: withOwnerThread closes MappedMemorySegment

Ty Young youngty1997 at gmail.com
Mon Sep 28 22:22:38 UTC 2020


On 9/28/20 9:17 AM, Maurizio Cimadamore wrote:
> The fix Jorn has identified has now been pushed. Would be helpful, if 
> you can, to get the latest panama code, and give your app another try, 
> to see if the crash is still there when intrinsics are enabled.


I set all the arguments to true and am not seeing any crashes so far.


>
> Thanks
> Maurizio
>
> On 25/09/2020 21:19, Ty Young wrote:
>> Forgot to mention, I'm using default GC.
>>
>>
>> On 9/25/20 10:00 AM, Jorn Vernee wrote:
>>> Hi Ty,
>>>
>>> I'm trying to reproduce your crash locally, but no luck so far. From 
>>> the error message, it seems like it might be caused by a thread 
>>> being suspended while inside a native call, which triggers a slow 
>>> path that seems to have a bug in it; not setting the thread state to 
>>> _thread_in_java again.
>>>
>>> The following patch fixes that mistake [1], but since I'm not able 
>>> so far to reproduce the crash I can't say for sure that that will 
>>> fix the problem you are seeing.
>>>
>>> It would help if you could provide some steps to reproduce, and/or 
>>> try out the patch at [1] if you can (should be enough to put it in a 
>>> file and then use `git apply <file>`).
>>>
>>> I'm also curious to know if you are running with the default GC, or 
>>> maybe another one?
>>>
>>> Thanks,
>>> Jorn
>>>
>>> [1] :
>>>
>>> diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp 
>>> b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
>>> index 51b9082cfae..887369fc5c8 100644
>>> --- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
>>> +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
>>> @@ -3810,11 +3810,12 @@ void NativeInvokerGenerator::generate() {
>>>    __ safepoint_poll(L_safepoint_poll_slow_path, r15_thread, 
>>> rscratch1);
>>>    __ cmpl(Address(r15_thread, JavaThread::suspend_flags_offset()), 0);
>>>    __ jcc(Assembler::notEqual, L_safepoint_poll_slow_path);
>>> -  // change thread state
>>> -  __ movl(Address(r15_thread, JavaThread::thread_state_offset()), 
>>> _thread_in_Java);
>>>
>>>    __ bind(L_after_safepoint_poll);
>>>
>>> +  // change thread state
>>> +  __ movl(Address(r15_thread, JavaThread::thread_state_offset()), 
>>> _thread_in_Java);
>>> +
>>>    __ block_comment("reguard stack check");
>>>    Label L_reguard;
>>>    Label L_after_reguard
>>>


More information about the panama-dev mailing list