[angr] Pickle a Path?
fish at cs.ucsb.edu
Tue May 30 17:52:36 PDT 2017
Path should be pickleable. However, make sure you use the latest pickle protocol (e.g., `pickle.dumps(path, -1)`).
If it is not pickleable, it must be a bug on our side. Give us an issue on GitHub then.
From: angr [mailto:angr-bounces at lists.cs.ucsb.edu] On Behalf Of David Manouchehri
Sent: Monday, May 22, 2017 4:52 PM
To: Eric Miller <emiller at endgame.com>
Cc: angr <angr at lists.cs.ucsb.edu>
Subject: Re: [angr] Pickle a Path?
You can store stashes to disk, not sure if that works for you or not though.
https://github.com/Manouchehri/angr-doc/blob/pickles/examples/pickle-jar/solve.py (not functional, but should get you started in the right direction.)
Yan might have a better solution.
On Mon, May 22, 2017 at 11:32 AM, Eric Miller <emiller at endgame.com <mailto:emiller at endgame.com> > wrote:
Angr is such a great tool, I'm a big fan, you guys have done something really cool with it...
So...I was wondering if it is possible to make the Path object be able to be serialized and written to disk by some python mechanism like Pickle/Dill?
I have been using Angr on some larger code that is taking up a lot of memory (on a machine with 64 GB RAM). And even though I'm using Veritesting to reduce path explosion, it soon runs out of memory and grinds to a halt.
So the question is, do you think the Path object could be made Pickle-able so I could just write new found (successor) paths to disk and thereby just operate on one path at a time and conserve memory?
I tried to call Pickle/Dill on a Path object, but it fails. I can see the key object to be able to store to disk (within Path object) would be path.state.
So the python 2 docs say this about Pickle:
The following types can be pickled:
* None, True, and False
* integers, long integers, floating point numbers, complex numbers
* normal and Unicode strings
* tuples, lists, sets, and dictionaries containing only picklable objects
* functions defined at the top level of a module
* built-in functions defined at the top level of a module
* classes that are defined at the top level of a module
* instances of such classes whose <https://docs.python.org/2/library/stdtypes.html#object.__dict__> __dict__ or the result of calling <https://docs.python.org/2/library/pickle.html#object.__getstate__> __getstate__() is picklable (see section <https://docs.python.org/2/library/pickle.html#pickle-protocol> The pickle protocol for details).
Do you think Path could be Pickled? and written to disk somehow?
Thanks so much,
angr mailing list
angr at lists.cs.ucsb.edu <mailto:angr at lists.cs.ucsb.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the angr