python-snappy icon indicating copy to clipboard operation
python-snappy copied to clipboard

pypy seg fault on larger byte arrays

Open johnistan opened this issue 8 years ago • 4 comments

This came up in a pykafka compression issue.

https://github.com/Parsely/pykafka/issues/508

So byte arrays above a certain size causes a seg fault.

(pypy) ➜ cat s.py
from uuid import uuid4
import snappy

payload = b''.join([uuid4().bytes for i in range(10)])

c = snappy.compress(payload)
assert snappy.decompress(c) == payload
(pypy) ➜  python s.py
[1]    4587 segmentation fault (core dumped)  python s.py
(pypy) ➜  python
Python 2.7.10 (bbd45126bc69, Mar 18 2016, 21:35:08)
[PyPy 5.0.1 with GCC 4.8.4] on linux2

while

from uuid import uuid4
import snappy

payload = b''.join([uuid4().bytes for i in range(5)])

c = snappy.compress(payload)
assert snappy.decompress(c) == payload

passes

johnistan avatar Mar 21 '16 22:03 johnistan

Also encounter a seg fault, any solution yet?

qinxuye avatar Jun 16 '16 01:06 qinxuye

This lib looks more targeted for pypy

https://pypi.python.org/pypi/ctypes-snappy

On Wed, Jun 15, 2016, 6:52 PM Qin Xuye [email protected] wrote:

Also encounter a seg fault, any solution yet?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/andrix/python-snappy/issues/36#issuecomment-226368476, or mute the thread https://github.com/notifications/unsubscribe/AAw3nV8ITJMAZmmCLkdHQlnqC3iC_6hHks5qMKx7gaJpZM4H1ne5 .

johnistan avatar Jun 16 '16 02:06 johnistan

Just checked with PyPy-6.0.0, python-snappy-0.5.2, libsnappy-1.0.4 and libsnappy-1.1.7 and segfault was not reproduced.

daa avatar May 18 '18 15:05 daa

@johnistan , @chineking still an issue for you?

martindurant avatar May 18 '18 15:05 martindurant