logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Python core dumping: msg#00040

Subject: Re: Python core dumping
Il sab, 2003-12-20 alle 20:34, Sebastien Bigaret ha scritto:
[snip]
> @@ -349,7 +349,9 @@
>      for (i = 0; i < len; i++) {
>          tmpobj = PyList_GetItem(self->cursors, i);
>          assert(tmpobj);
> +        Py_INCREF(tmpobj);
>          curs_switch_isolation_level((cursobject *)tmpobj, level);
> +        Py_DECREF(tmpobj);
>      }
>  }
> 
> 
>   Is this possible that this could cause the crash? Federico was this
>   what you were thinking about, or was it something else?

if you look at the gdb dump, the cursor code received a NULL pointer.
this is very strange, indeed, because it means that PyList_GetItem
failed (for example because the index was out of range). and i can't
imagine how PyList_GetItem can fail, unless some other thread delete a
cursor from the same connection inside the ALLOW_THREADS code.

my idea was to lock the connection during the isolation level switch,
but your fix may also work because a cursor does not remove itself from
the connection untill all references to it are removed. I will
investigate a little bit more and choose the right (I hope) one. 

ciao,
federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                
fog-8fiUuRrzOP0dnm+yROfE0A@xxxxxxxxxxxxxxxx
INIT.D Developer                                           
fog-NGVKUo/i/6DYtjvyW6yDsg@xxxxxxxxxxxxxxxx
              La felicità è una tazza di cioccolata calda. Sempre. -- Io

Attachment: signature.asc
Description: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx
http://lists.initd.org/mailman/listinfo/psycopg
<Prev in Thread] Current Thread [Next in Thread>