diff --git a/seirl/dev-services/install-services.sh b/seirl/dev-services/install-services.sh index 9525029..1a1c8e3 100755 --- a/seirl/dev-services/install-services.sh +++ b/seirl/dev-services/install-services.sh @@ -1,9 +1,9 @@ #!/bin/bash cd "$( dirname $0 )" -services_dir="$XDG_CONFIG_HOME/systemd/user" +services_dir="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user" mkdir -p "$services_dir" cp *.service *.target "$services_dir" systemctl --user daemon-reload diff --git a/vlorentz/run_afl.txt b/vlorentz/run_afl.txt index 4c98166..0f74df4 100644 --- a/vlorentz/run_afl.txt +++ b/vlorentz/run_afl.txt @@ -1,3 +1,3 @@ -py-afl-fuzz -t 2000 -m 200 -i ~/datasets/gemspec -o fuzzing-results -- python3 ~/swh-environment/snippets/vlorentz/run_mapping.py GemspecMapper @@ +py-afl-fuzz -t 2000 -m 200 -i ~/datasets/gemspec -o fuzzing-results -- python3 ~/swh-environment/snippets/vlorentz/run_mapping.py GemspecMapping @@ -py-afl-fuzz -t 2000 -m 200 -i ~/datasets/pkginfo -o fuzzing-results -- python3 ~/swh-environment/snippets/vlorentz/run_mapping.py GemspecMapper @@ +py-afl-fuzz -t 2000 -m 200 -i ~/datasets/pkginfo -o fuzzing-results -- python3 ~/swh-environment/snippets/vlorentz/run_mapping.py PythonPkginfoMapping @@ diff --git a/vlorentz/run_mapping.py b/vlorentz/run_mapping.py index cfff06c..e3c823b 100644 --- a/vlorentz/run_mapping.py +++ b/vlorentz/run_mapping.py @@ -1,42 +1,45 @@ +import gc import os import os.path import pprint import sys import traceback import afl #afl.init() from swh.indexer.metadata_dictionary import MAPPINGS try: mapping_name = sys.argv[1] file_name = sys.argv[2] except KeyError: print('Syntax: ./run_mapping.py {GemspecMapping,NpmMapping,...}') exit(1) +gc.disable() + #afl.init() -while afl.loop(1000): +while afl.loop(100): #if True: #sys.stdin.buffer.seek(0) #file_content = sys.stdin.buffer.read() with open(file_name, 'rb') as fd: file_content = fd.read() """ with open('/tmp/data', 'ab') as fd: fd.write(repr(file_content).encode() + b'\n') fd.write(repr(sys.argv).encode() + b'\n')""" assert b'abcd' not in file_content try: MAPPINGS[mapping_name].translate(file_content) except: with open('/tmp/tb.txt', 'a') as fd: fd.write('tb:\n') fd.write(repr(list(MAPPINGS)) + '\n') fd.write(traceback.format_exc()) fd.flush() raise os._exit(0)