You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2006/01/04 23:32:51 UTC

Re: Reuse of ra_dav sessions considered harmful

Garrett Rooney <ro...@electricjellyfish.net> writes:

> because svn_ra_dav__get_commit_editor uses ne_hook_create_request and
> ne_hook_pre_send to create two hooks, which use batons allocated out
> of the subpool.  These hooks never go away (and in fact I can't find
> any API that even lets you make them go away in the current version of
> neon), so the next time through the loop you try to call them again,
> except that the baton is now pointing off into memory that's been
> reused, and you crash.

I've seen something like that before, see setup_neon_request_hook and
r14295.  Perhaps you could use a similar approach?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Reuse of ra_dav sessions considered harmful

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 1/4/06, Philip Martin <ph...@codematters.co.uk> wrote:
> Garrett Rooney <ro...@electricjellyfish.net> writes:
>
> > because svn_ra_dav__get_commit_editor uses ne_hook_create_request and
> > ne_hook_pre_send to create two hooks, which use batons allocated out
> > of the subpool.  These hooks never go away (and in fact I can't find
> > any API that even lets you make them go away in the current version of
> > neon), so the next time through the loop you try to call them again,
> > except that the baton is now pointing off into memory that's been
> > reused, and you crash.
>
> I've seen something like that before, see setup_neon_request_hook and
> r14295.  Perhaps you could use a similar approach?

That seems like about the best we can do with the current APIs.  One
thing that occurs to me about the way the lock code is doing this
though, perhaps it should be setting lrb->pool to the current pool, as
opposed to the session pool, so as to avoid leaking memory inside the
hook callbacks.

Thanks for the pointer!

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org