I'm using rapidjson inside one of my project and when using pythonfuzz on it I did realize that a memory leak was seen in rapidjson. Fuzzing the loads function is triggering a fuzzer OOM kill after some minutes when a decent corpus is used.
The following script exhibits the problem:
from pythonfuzz.main import PythonFuzz
import rapidjson
@PythonFuzz
def fuzz(buf):
try:
dbuf = buf.decode('utf-8')
rapidjson.loads(dbuf)
except rapidjson.JSONDecodeError:
pass
except UnicodeDecodeError:
pass
except UnicodeError:
pass
if __name__ == '__main__':
fuzz()
To run it install pythonfuzz module and simply run the script.
I can share my corpus privately if you want.
I'm using rapidjson inside one of my project and when using pythonfuzz on it I did realize that a memory leak was seen in rapidjson. Fuzzing the loads function is triggering a fuzzer OOM kill after some minutes when a decent corpus is used.
The following script exhibits the problem:
To run it install pythonfuzz module and simply run the script.
I can share my corpus privately if you want.