[issue7672] _ssl module causes segfault
report at bugs.python.org
Mon Jan 11 18:43:49 CET 2010
Sean Soria <bugs.python at seansoria.com> added the comment:
Okay, what if I attack this problem from a "it's not thread-safe" point of view? If the callbacks are already loaded, then who knows what state the locks are in. If you replace the locking_callback while a thread already has the lock, and another thread comes in and tries to lock, it will succeed immediately, and two threads will be in the critical section.
Attaching a patch for how I think this should work.
>From Bill via email:
Hmmm, well, is there a standard way to unload Python? I could put a
__del__ method on the module which would remove the callbacks, I
suppose. I just never heard of "unloading" a module before.
Added file: http://bugs.python.org/file15829/ssl.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list