OpenRCE/sulley

Don't use zlib for pickle storage/persistance

Fitblip opened this issue · 4 comments

Apparently on 32-bit python it has a 2GB limit for un-compressed data going in. That sucks.

joblib/joblib#122

I have an out of memory issue when sulley generates more than 20 000 test cases, this was fixed by using this line of code in sessions.py line 356 :

++ fh.write(zlib.compress(cPickle.dumps(data, protocol=cPickle.HIGHEST_PROTOCOL)))
-- fh.write(zlib.compress(cPickle.dumps(data, protocol=2)))

works like a charm!

@AsmaeBni What system are you running on?

Do you know why this works? The docs say that protocol 2 is the highest protocol, so I'm a little confused on why that would fix it. https://docs.python.org/2/library/pickle.html

I am running on Windows 7 x64, I have actually tried with 2 but still got out of memory issues but with the suggested fix things run smoothly!

@AsmaeBni I've got a couple requests

  • What's your Python version?

  • Can you provide your fuzzing script so we can see the issue?

  • Also, use interactive Python on your system to see what cPickle.HIGHEST_PROTOCOL is defined as. On my system, it is 2:

    $ python
    Python 2.7.10 (default, Jun  1 2015, 18:05:38)
    [GCC 4.9.2] on cygwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cPickle
    >>> cPickle.HIGHEST_PROTOCOL
    2
    >>>