[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: James McCoy <jamessan_at_jamessan.com>
Date: Mon, 10 Aug 2020 21:56:49 -0400

On Fri, Aug 07, 2020 at 08:47:07PM +0200, 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().
> ]]]

Is this superceded by your other patch?

Cheers,

-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB
Received on 2020-08-11 03:57:07 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.