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

Re: svn commit: r31145 - trunk/subversion/bindings/swig/python/libsvn_swig_py

From: <epg_at_google.com>
Date: Fri, 16 May 2008 12:12:14 -0700

epg_at_google.com writes:

> djames_at_tigris.org writes:
>
> > Author: djames
> > Date: Mon May 12 16:04:59 2008
> > New Revision: 31145
> >
> > Log:
> > Sweep through swigutil_py.c, fixing reference-count memory leaks.
> >
> > Review by: epg
>
> Well, it *looked* fine...
>
> > @@ -2099,18 +2107,23 @@ svn_error_t *svn_swig_py_delta_path_driv
> > apr_pool_t *pool)
> > {
> > PyObject *function = callback_baton;
> > - PyObject *result;
> > + PyObject *result, *py_parent_baton;
> > svn_error_t *err = SVN_NO_ERROR;
> >
> > if (function == NULL || function == Py_None)
> > return err;
> >
> > svn_swig_py_acquire_py_lock();
> > +
> > + py_parent_baton = svn_swig_NewPointerObjString(parent_baton,
> > + "void *",
> > + NULL);
> > +
> > result = PyObject_CallFunction(function, (char *)"OsO&",
> > - svn_swig_NewPointerObjString(parent_baton,
> > - "void *",
> > - application_py
> > _pool),
> > + py_parent_baton,
> > path, make_ob_pool, pool);
> > +
> > +
> > if (result == NULL)
> > {
> > err = callback_exception_error();
> > @@ -2127,6 +2140,8 @@ svn_error_t *svn_swig_py_delta_path_driv
> > }
> > }
> >
> > + Py_XDECREF(result);

Ah, this is it. We return result as the dir_baton, so we mustn't
free it here.

> > + Py_XDECREF(py_parent_baton);
> > svn_swig_py_release_py_lock();
> > return err;
> > }
>
> After this change, using svn_swig_py_delta_path_driver leads to a
> segfault later on. I'm not sure why our own test suite does not
> trigger it, but gvn's definitely does. I thought it might be
> that you use NULL where I used application_py_poo (I still don't
> understand what's up with those pools), but changing that didn't
> help. Dropping the decref of py_parent_baton didn't, either.
>
> This segfault has been merged to 1.5.x, so we need to get to the
> bottom of it ASAP. Let me know if you need anything else from
> me.
>
> (gdb) bt
> #0 0xf7b33b21 in add_child (child=0xffffa184, cc=0x74696e75,
> parent=0x74736574, name=0x838e6b0 "greek-tree", created=0, revision=4,
> pool=0x8364510) at subversion/libsvn_ra_neon/commit.c:373
> #1 0xf7b34b07 in commit_open_dir (
> path=0x838a710 "changes/unittest/ood/projects/greek-tree",
> parent_baton=0x838e688, base_revision=4, dir_pool=0x838e620,
> child_baton=0xffffa1e0) at subversion/libsvn_ra_neon/commit.c:936
> #2 0xf7bbd9df in open_dir (db_stack=0x8348540, editor=0x8328fe8,
> path=0x838a710 "changes/unittest/ood/projects/greek-tree", revision=4,
> pool=0x83484e0) at subversion/libsvn_delta/path_driver.c:66
> #3 0xf7bbdf0c in svn_delta_path_driver (editor=0x8328fe8,
> edit_baton=0x83285c8, revision=4, paths=0x8348518,
> callback_func=0xf7dbe400 <svn_swig_py_delta_path_driver_cb_func>,
> callback_baton=0xf76eee64, pool=0x83484e0)
> at subversion/libsvn_delta/path_driver.c:230
> #4 0xf7aa672b in _wrap_svn_delta_path_driver (self=0x0, args=0xf7876efc)
> at subversion/bindings/swig/python/svn_delta.c:4960
> #5 0x0805946c in PyObject_Call ()
> #6 0x080b0583 in PyEval_CallObjectWithKeywords ()
> #7 0x080a8f3d in ?? ()
> #8 0xf7d44f2c in ?? ()
> #9 0xf7876efc in ?? ()
> #10 0x00000000 in ?? ()
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-16 21:12:40 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.