/kolab/bin/python: double free or corruption (fasttop)
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Mon Dec 29 01:15:56 EST 2008
En Mon, 29 Dec 2008 04:12:02 -0200, Gabriel Genellina
<gagsl-py2 at yahoo.com.ar> escribió:
> En Sun, 28 Dec 2008 12:10:06 -0200, aspineux <aspineux at gmail.com>
> escribió:
>
>> I got this.
>> This is a test script, to help me to understand why I have unexpected
>> result in application.
>> But I got a more unexpected result, and probably wrong error message
>> about the read-only cursor.
>
>> def server():
>> dbenv, db=init_db(read_only=False)
>>
>> update_thread=threading.Thread(target=lambda : cleanup(db))
>> update_thread.setDaemon(True)
>> update_thread.start()
>
> I'd write it as
> update_thread = threading.Thread(target=cleanup, args=(db,))
> or:
> update_thread = threading.Thread(target=lambda db=db: cleanup(db))
>
> The original code is creating a closure and I'm unsure how closures
> interact with threads.
Anyway, the crash should not happen, this may be a bug in Python or bsddb:
http://bugs.python.org/
--
Gabriel Genellina
More information about the Python-list
mailing list