You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bm_tornado_http crashes on PyPy 3.11: "BufferError: Existing exports of data: object cannot be re-sized" #510
Running python -m pyperformance run -b all --debug-single-value (what the test_run_and_show test does in CI) fails only on PyPy because bm_tornado_http
dies:
The benchmark crashes with BufferError: Existing exports of data: object cannot be re-sized, raised from tornado's IOStream._consume where del self._read_buffer[:loc] resizes a buffer that PyPy considers to still have an
active export. tornado then closes the connection, the client sees HTTPStreamClosedError: Stream closed, and the benchmark process exits non-zero.
Traceback
File ".../tornado/iostream.py", line 993, in _consume
del self._read_buffer[:loc]
BufferError: Existing exports of data: object cannot be re-sized
Uncaught exception, closing connection.
...
File ".../bm_tornado_http/run_benchmark.py", line 74, in run_client
tornado.simple_httpclient.HTTPStreamClosedError: Stream closed
...
RuntimeError: Benchmark died
Reproducibility
Not a flake — it reproduces on every pypy-3.11 CI run. Both a recent pull-request
run and the main branch run fail identically on tornado_http, so this is
independent of any in-flight change.
Notes
BufferError: Existing exports of data: object cannot be re-sized is a PyPy
buffer-protocol behavior: slice-deleting a buffer that still has an active
export (e.g. a memoryview) is rejected, where CPython does not enforce it here.
The crash comes from IOStream._consume() resizing _read_buffer while a
temporary memoryview of it is still alive. PyPy 8.0 enforces this rule like
CPython but does not release the temporary view until garbage collection, so del self._read_buffer[:loc] raises BufferError: Existing exports of data: object cannot be re-sized.
tornado fixed this in 6.6.0 via tornadoweb/tornado#3750 ("iostream: Release
memoryviews explicitly for PyPy 8.0 compatibility"; see also #3756 and #3757).
In pyperformance, #502 bumped pyperformance/data-files/benchmarks/bm_tornado_http/requirements.txt from tornado==6.5.2 to tornado==6.6, so the benchmark now runs on a fixed
tornado. CI confirms it: the pypy-3.11 job on main installs tornado==6.6,
runs [84/91] tornado_http... successfully, and is green (e.g. run
42538627568).
Closing as fixed by #502 — feel free to reopen if it resurfaces.
Activity
sendaoYan commentedon Nov 9, 2026
This should be fixed now.
The crash comes from
IOStream._consume()resizing_read_bufferwhile atemporary
memoryviewof it is still alive. PyPy 8.0 enforces this rule likeCPython but does not release the temporary view until garbage collection, so
del self._read_buffer[:loc]raisesBufferError: Existing exports of data: object cannot be re-sized.tornado fixed this in 6.6.0 via tornadoweb/tornado#3750 ("iostream: Release
memoryviews explicitly for PyPy 8.0 compatibility"; see also #3756 and #3757).
In pyperformance, #502 bumped
pyperformance/data-files/benchmarks/bm_tornado_http/requirements.txtfromtornado==6.5.2totornado==6.6, so the benchmark now runs on a fixedtornado. CI confirms it: the
pypy-3.11job onmaininstallstornado==6.6,runs
[84/91] tornado_http...successfully, and is green (e.g. run42538627568).
Closing as fixed by #502 — feel free to reopen if it resurfaces.