[pypy-issue] [issue1594] Assertion error with pypy-stm and tornado

kostia.lopuhin tracker at bugs.pypy.org
Sun Sep 1 21:00:39 CEST 2013

New submission from kostia.lopuhin <kostia.lopuhin at gmail.com>:

Running tornado with (maybe broken) stm support fails with the following error:

pypy: /home/kostia/pypy/rpython/translator/stm/src_stm/steal.c:338:
stm_normalize_stolen_objects: Assertion `L->h_tid &
Aborted (core dumped)

Executable was translated on Ubuntu 12.04, using 5904f9845d8c+

pypy ../../rpython/bin/rpython --opt=2 --gc=stmgc --gcrootfinder=stm --stm

I tested that it generally works (and stm also works and scales as expected on
small examples).

How to reproduce (assuming virtualenv with pypy-stm):

pip install -e git+git at github.com:lopuhin/tornado.git at stm#egg=tornado
git clone git at github.com:lopuhin/web_bench.git

Install siege (on Ubuntu the package name is siege), and run in one window (4 is
the number of threads).

pypy web_bench/trnado.py 4 8001

And in another

siege -c 200 -t 10s http://localhost:8001/foo/1000

and see pypy fail with assertion error.

Sertanly my tornado modification
may be broken, but if I fool transaction module to belive that pypy has no stm
support like this:

hg diff
diff -r 5904f9845d8c lib_pypy/transaction.py
--- a/lib_pypy/transaction.py   Fri Aug 23 20:10:41 2013 +0200
+++ b/lib_pypy/transaction.py   Sun Sep 01 22:47:27 2013 +0400
@@ -15,6 +15,7 @@
 import sys, thread, collections, cStringIO, linecache
+    raise ImportError
     from __pypy__.thread import atomic
 except ImportError:
     # Not a STM-enabled PyPy.  We can still provide a version of 'atomic'
@@ -41,6 +42,7 @@
     signals_enabled = _SignalsEnabled()
+    raise ImportError
     from __pypy__.thread import last_abort_info
 except ImportError:
     # Not a STM-enabled PyPy.

then all runs fine. Also, if I run only callbacks in parallel (and don't run
handlers in parallel) than the failure is the same.

messages: 6110
nosy: kostia.lopuhin, pypy-issue
priority: bug
status: unread
title: Assertion error with pypy-stm and tornado

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list