Re: backtrace in 2.4.2 - Mailing list psycopg

From Daniele Varrazzo
Subject Re: backtrace in 2.4.2
Date
Msg-id CA+mi_8ZgPmBZ0+PuA=TgFEqg=RAfk2g3=BmMOZ2TR2+Bx7ztvA@mail.gmail.com
Whole thread Raw
In response to backtrace in 2.4.2  (David Butler <dave@croepha.com>)
List psycopg
On Mon, Aug 22, 2011 at 3:53 PM, David Butler <dave@croepha.com> wrote:
> I have been trying to figure out why my program keeps crashing, It can take
> several hours before I can duplicate this problem.  The issue seems to have
> something to do with psycopg.... here is the stack trace I got with gdb:
> #0  0xb7f36a37 in PyErr_Occurred () from /usr/lib/libpython2.7.so.1.0
...
> This is purely speculation, but I think it has something to do with
> connecting again, after a connection dies because of a time out...
> Thanks, any ideas, questions or comments are welcome

Yes, I think we've already a patch for this bug: for a mistake we
query whether a Python error occurred without grabbing the GIL before
(which is Bad™). Trying to begin a transaction with a broken
connection is a possible way to trigger the bug.

The patch is already in the devel branch and is scheduled for release
in psycopg 2.4.3: you can grab it from
https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git;a=commit;h=de6f2ac387231fcd57c05031c82471ea57255e2b

It would be great if you could compile a copy of psycopg from the
devel branch (or just apply the patch over a checkout from head) and
test if it fixes the bug for you.

Sorry for the inconvenience.

-- Daniele

psycopg by date:

Previous
From: David Butler
Date:
Subject: backtrace in 2.4.2
Next
From: Massimo Di Pierro
Date:
Subject: psycopg2.extensions.adap