On Thu, 2013-06-20 at 19:34 +0530, Gangadharan S.A. wrote:
> It looks like the "double free" segfault from pyscopg2 2.0.8
> ( http://comments.gmane.org/gmane.comp.python.db.psycopg.devel/4964 )
> is back in version 2.5:
> As before, the problem seems to be that when de-allocing the
> connection, we are calling conn_close before untracking the object.
> conn_close allows other threads to run and call the garbage collector,
> which ends up running dealloc a second time on this object. So we free
> the same memory a second time and hence the double free error.
> The fix would be to call conn_close after untracking the object in
I see: sorry, I've broken it in commit 5aafe38f. Looks like in that
commit I've fixed the cursor and broken the connection.
> The script used to reproduce the issue back in
> http://comments.gmane.org/gmane.comp.python.db.psycopg.devel/4964 will
> not reproduce the issue any more because we don't rollback the
> in-progress transaction during connection close anymore. The only way
> I reliably could reproduce the issue in a test script was to introduce
> a sleep in the C code at connection_int.c:conn_close() after
> Py_BEGIN_ALLOW_THREADS and then run garbage collector from another
> thread during the sleep.
Thank *you* very much. Open ticket #166. I had in mind to release a new
version in the next days: will include this correction too.
In response to
psycopg by date
|Next:||From: Daniele Varrazzo||Date: 2013-06-20 15:42:21|
|Subject: Re: "double free" segfault back in pyscopg2 2.5|
|Previous:||From: Gangadharan S.A.||Date: 2013-06-20 14:04:29|
|Subject: "double free" segfault back in pyscopg2 2.5|