[pypy-issue] [issue1162] Abort with OpenSSL and threads

Tobias Oberstein tracker at bugs.pypy.org
Sun Jun 10 18:43:02 CEST 2012


New submission from Tobias Oberstein <tobias.oberstein at gmail.com>:

In a Twisted 12.1 server running under PyPy (trunk, as of June, 10th), which is
also using threads, the server aborts when accepting on a SSL socket:

Fatal error: pthread_mutex_lock(&mutex_gil)
Abort trap: 6

I have a stripped down 20 lines example which doesn't even involve Twisted:

https://github.com/oberstet/scratchbox/blob/master/python/twisted/pypybug1/testcase4.py

This example will behave as follows:

[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$
~/python273/bin/python testcase4.py
foo() begin
import and create SSL begin
import and create SSL end
foo() end
[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$ pypy testcase4.py
foo() begin
import and create SSL begin
Fatal error: pthread_mutex_lock(&mutex_gil)
Abort trap: 6
[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$
~/python273/bin/python -V
Python 2.7.3
[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$ pypy -V
Python 2.7.2 (12c1f0538f76, Jun 10 2012, 07:56:58)
[PyPy 1.9.1-dev0 with GCC 4.2.1]
[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$ uname -a
FreeBSD autobahnws 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC
2012     root at obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
[autobahn at autobahnws ~/scm/scratchbox/python/twisted/pypybug1]$


==

I _think_ this reproduces my actual problem I have when running under Twisted.

The issue involves the interaction between PyOpenSSL and PyPy .. not sure who is
guilty, but the issue does definitely not arise with CPython.

There was some discussion on IRC a couple of weeks ago where I raised the issue
.. I did more testing/experimenting .. but got nowhere.

My ultimate goal is to be able to run Twisted/kqueue on FreeBSD while using SSL
and threads. I need to use threads with Twisted since database access is done
from a thread pool (not the networking of course).

----------
messages: 4398
nosy: oberstet, pypy-issue
priority: bug
status: unread
title: Abort with OpenSSL and threads

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1162>
________________________________________


More information about the pypy-issue mailing list