You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Thomas Singer <th...@syntevo.com> on 2020/09/09 11:39:25 UTC

Re: [PATCH] Fix JavaHL crash in TunnelAgent.CloseTunnelCallback after GC

Has this patch been merged yet? If not, what input is needed to get it 
accepted?

Tom


On 2020-08-07 20:47, Alexandr Miloslavskiy wrote:
> Please find test snippet and patch attached.
> 
> [[[
> Fix JavaHL crash in TunnelAgent.CloseTunnelCallback after GC
> 
> When jobject reference is kept across different JNI calls, a new global
> reference must be requested with NewGlobalRef(). Otherwise, GC is free
> to remove the object. Even if Java code keeps a reference to the object,
> GC can still move the object around, invalidating the kept jobject,
> which results in a native crash when trying to access it.
> 
> [in subversion/bindings/javahl]
> * native/OperationContext.cpp
>    (OperationContext::openTunnel): Add NewGlobalRef() for kept jobject.
>    (OperationContext::closeTunnel): Add a matching DeleteGlobalRef().
> ]]]