D7600: fuzz: add a seed corpus for the dirs fuzzer

2019-12-10 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I was hoping to trigger an asan violation under Python 3 that some internal
  tests at Google found, but for some reason that's beyond me I can't seem to
  manage.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7600

AFFECTED FILES
  contrib/fuzz/Makefile
  contrib/fuzz/dirs_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/dirs_corpus.py b/contrib/fuzz/dirs_corpus.py
new file mode 100644
--- /dev/null
+++ b/contrib/fuzz/dirs_corpus.py
@@ -0,0 +1,29 @@
+from __future__ import absolute_import, print_function
+
+import argparse
+import zipfile
+
+ap = argparse.ArgumentParser()
+ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
+args = ap.parse_args()
+
+with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
+zf.writestr(
+"greek-tree",
+"\n".join(
+[
+"iota",
+"A/mu",
+"A/B/lambda",
+"A/B/E/alpha",
+"A/B/E/beta",
+"A/D/gamma",
+"A/D/G/pi",
+"A/D/G/rho",
+"A/D/G/tau",
+"A/D/H/chi",
+"A/D/H/omega",
+"A/D/H/psi",
+]
+),
+)
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -62,7 +62,7 @@
 
 PARSERS_OBJS=parsers-manifest.o parsers-charencode.o parsers-parsers.o 
parsers-dirs.o parsers-pathencode.o parsers-revlog.o
 
-dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS)
+dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirs_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial dirs.cc \



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7600: fuzz: add a seed corpus for the dirs fuzzer

2019-12-11 Thread durin42 (Augie Fackler)
Closed by commit rHGb7af8a02a304: fuzz: add a seed corpus for the dirs fuzzer 
(authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7600?vs=18594&id=18608

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7600/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7600

AFFECTED FILES
  contrib/fuzz/Makefile
  contrib/fuzz/dirs_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/dirs_corpus.py b/contrib/fuzz/dirs_corpus.py
new file mode 100644
--- /dev/null
+++ b/contrib/fuzz/dirs_corpus.py
@@ -0,0 +1,29 @@
+from __future__ import absolute_import, print_function
+
+import argparse
+import zipfile
+
+ap = argparse.ArgumentParser()
+ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
+args = ap.parse_args()
+
+with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
+zf.writestr(
+"greek-tree",
+"\n".join(
+[
+"iota",
+"A/mu",
+"A/B/lambda",
+"A/B/E/alpha",
+"A/B/E/beta",
+"A/D/gamma",
+"A/D/G/pi",
+"A/D/G/rho",
+"A/D/G/tau",
+"A/D/H/chi",
+"A/D/H/omega",
+"A/D/H/psi",
+]
+),
+)
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -62,7 +62,7 @@
 
 PARSERS_OBJS=parsers-manifest.o parsers-charencode.o parsers-parsers.o 
parsers-dirs.o parsers-pathencode.o parsers-revlog.o
 
-dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS)
+dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirs_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial dirs.cc \



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel