Re: backtrace in 2.4.2

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: David Butler <dave(at)croepha(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: backtrace in 2.4.2
Date: 2011-08-22 15:40:06
Message-ID: CA+mi_8ZgPmBZ0+PuA=TgFEqg=RAfk2g3=BmMOZ2TR2+Bx7ztvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Mon, Aug 22, 2011 at 3:53 PM, David Butler <dave(at)croepha(dot)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

In response to

Browse psycopg by date

  From Date Subject
Next Message Massimo Di Pierro 2011-09-02 13:50:37 psycopg2.extensions.adap
Previous Message David Butler 2011-08-22 14:53:03 backtrace in 2.4.2