hashlib functions segfault when passed a BytesIO buffer
Created originally on Bitbucket by brownan (Andrew Brown)
If you pass a BytesIO buffer to the hashlib.* functions, this causes PyPy to segfault. I'm running this on Linux using Python 3 on PyPy 5.10.1
Python 3.5.3 (3f6eaa010fce, Jan 11 2018, 04:44:35)
[PyPy 5.10.1 with GCC 6.2.0 20160901] on linux
Code to reproduce:
import io
import hashlib
a = io.BytesIO(b"Hello, world!")
buf = a.getbuffer()
h = hashlib.sha256(buf)
I've also reproduced this with --jit off
but I haven't yet tried with a debug build or anything else; I'm not very experienced with debugging PyPy.