psycopg2 2.0.8 - segmentation fault

"Gangadharan S.A." <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Hi,

We recently switched from psycopg to psycopg2 2.0.8 in our
organization. Since the switch, we have been getting the below
segmentation fault in one of our multi threaded python applications
which is db intensive. We are running this application on a 64 bit
linux machine.

> uname -a
Linux xyz 2.6.18.8-0.3-default #1 SMP Tue Apr 17 08:42:35 UTC 2007
x86_64 x86_64 x86_64 GNU/Linux

The application runs fine for sometime and then crashes with this
backtrace (pasted at the bottom). I am unable to reliably reproduce
this issue right now. Just that it happens within an hour or 2 of
starting this application.  The application creates and closes db
connections frequently and does various queries. From the logs, there
does not seem to be any correlation between a particular action and
the crash.

I noticed that this issue or something very similiar was fixed in
psycopg2 2.0.8 http://initd.org/pub/software/psycopg/ChangeLog-2.0 :

"* psycopg/pqpath.c (pq_complete_error): get rid of double free
	error in case when pgres is NULL."

But we are using 2.0.8 and are still getting this error. Any help or
insight will be greatly appreciated.

*** glibc detected *** /abc/vendor/bin/python: double free or
corruption (!prev): 0x0000000000f46f20 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2b3678e248fe]
/lib64/libc.so.6(cfree+0x76)[0x2b3678e25f36]
/abc/vendor/lib/python2.4/site-packages/psycopg2/_psycopg.so[0x2b367cf96a49]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d16006]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677cfb8e3]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d15f65]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677ce764a]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d4b228]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d4aff0]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_EvalFrame+0x57e0)[0x2b3677d473f7]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_EvalCodeEx+0xe4a)[0x2b3677d491f5]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677cea158]
/abc/vendor/lib/libpython2.4.so.1.0(PyObject_Call+0x3d)[0x2b3677cd09f7]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d4b9d9]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_EvalFrame+0x5972)[0x2b3677d47589]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d4b1e8]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d4aff0]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_EvalFrame+0x57e0)[0x2b3677d473f7]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_EvalCodeEx+0xe4a)[0x2b3677d491f5]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677cea158]
/abc/vendor/lib/libpython2.4.so.1.0(PyObject_Call+0x3d)[0x2b3677cd09f7]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677cda0c6]
/abc/vendor/lib/libpython2.4.so.1.0(PyObject_Call+0x3d)[0x2b3677cd09f7]
/abc/vendor/lib/libpython2.4.so.1.0(PyEval_CallObjectWithKeywords+0x118)[0x2b3677d4a7b6]
/abc/vendor/lib/libpython2.4.so.1.0[0x2b3677d7d758]
/lib64/libpthread.so.0[0x2b367803809e]
/lib64/libc.so.6(clone+0x6d)[0x2b3678e794cd]
======= Memory map: ========

Thanks,
Gangadharan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.