From 8dcf2fab04ae0cb761b361d0cbc56faec83f285a Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 2 Oct 2026 20:04:59 +0000 Subject: Start adding some support for finding crashes using fuzzing. As of this commits, a lot of tests will fail. FossilOrigin-Name: b69b0e75daaa2ac3959f7a474207ba786823d1a5f8147cfe280df729cb829713 --- Makefile.am | 3 ++- tests/Makefile.am | 6 ++++++ tests/fuzz-crashes/1.fuzz | 2 ++ tests/fuzz-crashes/10.fuzz | 3 +++ tests/fuzz-crashes/11.fuzz | 7 +++++++ tests/fuzz-crashes/12.fuzz | 8 ++++++++ tests/fuzz-crashes/13.fuzz | 5 +++++ tests/fuzz-crashes/14.fuzz | 5 +++++ tests/fuzz-crashes/15.fuzz | 5 +++++ tests/fuzz-crashes/16.fuzz | Bin 0 -> 64 bytes tests/fuzz-crashes/17.fuzz | 6 ++++++ tests/fuzz-crashes/18.fuzz | 5 +++++ tests/fuzz-crashes/19.fuzz | 1 + tests/fuzz-crashes/2.fuzz | 3 +++ tests/fuzz-crashes/20.fuzz | 19 +++++++++++++++++++ tests/fuzz-crashes/21.fuzz | 18 ++++++++++++++++++ tests/fuzz-crashes/22.fuzz | 40 +++++++++++++++++++++++++++++++++++++++ tests/fuzz-crashes/23.fuzz | 26 +++++++++++++++++++++++++ tests/fuzz-crashes/24.fuzz | Bin 0 -> 101 bytes tests/fuzz-crashes/25.fuzz | Bin 0 -> 84 bytes tests/fuzz-crashes/26.fuzz | 11 +++++++++++ tests/fuzz-crashes/27.fuzz | 7 +++++++ tests/fuzz-crashes/28.fuzz | Bin 0 -> 105 bytes tests/fuzz-crashes/29.fuzz | 1 + tests/fuzz-crashes/3.fuzz | 3 +++ tests/fuzz-crashes/30.fuzz | 42 +++++++++++++++++++++++++++++++++++++++++ tests/fuzz-crashes/31.fuzz | Bin 0 -> 108 bytes tests/fuzz-crashes/32.fuzz | Bin 0 -> 97 bytes tests/fuzz-crashes/33.fuzz | Bin 0 -> 34 bytes tests/fuzz-crashes/34.fuzz | Bin 0 -> 95 bytes tests/fuzz-crashes/35.fuzz | Bin 0 -> 128 bytes tests/fuzz-crashes/36.fuzz | Bin 0 -> 90 bytes tests/fuzz-crashes/37.fuzz | Bin 0 -> 140 bytes tests/fuzz-crashes/38.fuzz | 2 ++ tests/fuzz-crashes/39.fuzz | 3 +++ tests/fuzz-crashes/4.fuzz | 3 +++ tests/fuzz-crashes/40.fuzz | 3 +++ tests/fuzz-crashes/41.fuzz | 4 ++++ tests/fuzz-crashes/42.fuzz | Bin 0 -> 39 bytes tests/fuzz-crashes/43.fuzz | 5 +++++ tests/fuzz-crashes/44.fuzz | 3 +++ tests/fuzz-crashes/45.fuzz | 1 + tests/fuzz-crashes/46.fuzz | 1 + tests/fuzz-crashes/47.fuzz | 3 +++ tests/fuzz-crashes/48.fuzz | Bin 0 -> 20 bytes tests/fuzz-crashes/49.fuzz | 5 +++++ tests/fuzz-crashes/5.fuzz | 5 +++++ tests/fuzz-crashes/50.fuzz | 3 +++ tests/fuzz-crashes/51.fuzz | 9 +++++++++ tests/fuzz-crashes/52.fuzz | 2 ++ tests/fuzz-crashes/53.fuzz | 3 +++ tests/fuzz-crashes/54.fuzz | Bin 0 -> 67 bytes tests/fuzz-crashes/55.fuzz | 1 + tests/fuzz-crashes/56.fuzz | 3 +++ tests/fuzz-crashes/57.fuzz | 2 ++ tests/fuzz-crashes/58.fuzz | Bin 0 -> 85 bytes tests/fuzz-crashes/59.fuzz | Bin 0 -> 69 bytes tests/fuzz-crashes/6.fuzz | 5 +++++ tests/fuzz-crashes/60.fuzz | 30 +++++++++++++++++++++++++++++ tests/fuzz-crashes/61.fuzz | Bin 0 -> 34 bytes tests/fuzz-crashes/62.fuzz | 39 ++++++++++++++++++++++++++++++++++++++ tests/fuzz-crashes/63.fuzz | 5 +++++ tests/fuzz-crashes/64.fuzz | Bin 0 -> 139 bytes tests/fuzz-crashes/65.fuzz | 32 +++++++++++++++++++++++++++++++ tests/fuzz-crashes/66.fuzz | Bin 0 -> 15 bytes tests/fuzz-crashes/67.fuzz | Bin 0 -> 188 bytes tests/fuzz-crashes/68.fuzz | 40 +++++++++++++++++++++++++++++++++++++++ tests/fuzz-crashes/69.fuzz | 7 +++++++ tests/fuzz-crashes/7.fuzz | 7 +++++++ tests/fuzz-crashes/70.fuzz | 4 ++++ tests/fuzz-crashes/71.fuzz | 1 + tests/fuzz-crashes/72.fuzz | Bin 0 -> 133 bytes tests/fuzz-crashes/73.fuzz | 7 +++++++ tests/fuzz-crashes/74.fuzz | Bin 0 -> 162 bytes tests/fuzz-crashes/75.fuzz | 23 ++++++++++++++++++++++ tests/fuzz-crashes/76.fuzz | 15 +++++++++++++++ tests/fuzz-crashes/77.fuzz | 34 +++++++++++++++++++++++++++++++++ tests/fuzz-crashes/8.fuzz | Bin 0 -> 20 bytes tests/fuzz-crashes/9.fuzz | 5 +++++ tests/fuzz-crashes/Makefile.am | 1 + tests/run_fuzz_test.sh | 11 +++++++++++ tools/fuzz | 28 +++++++++++++++++++++++++++ tools/save-fuzz-crashes | 33 ++++++++++++++++++++++++++++++++ 83 files changed, 613 insertions(+), 1 deletion(-) create mode 100644 tests/fuzz-crashes/1.fuzz create mode 100644 tests/fuzz-crashes/10.fuzz create mode 100644 tests/fuzz-crashes/11.fuzz create mode 100644 tests/fuzz-crashes/12.fuzz create mode 100644 tests/fuzz-crashes/13.fuzz create mode 100644 tests/fuzz-crashes/14.fuzz create mode 100644 tests/fuzz-crashes/15.fuzz create mode 100644 tests/fuzz-crashes/16.fuzz create mode 100644 tests/fuzz-crashes/17.fuzz create mode 100644 tests/fuzz-crashes/18.fuzz create mode 100644 tests/fuzz-crashes/19.fuzz create mode 100644 tests/fuzz-crashes/2.fuzz create mode 100644 tests/fuzz-crashes/20.fuzz create mode 100644 tests/fuzz-crashes/21.fuzz create mode 100644 tests/fuzz-crashes/22.fuzz create mode 100644 tests/fuzz-crashes/23.fuzz create mode 100644 tests/fuzz-crashes/24.fuzz create mode 100644 tests/fuzz-crashes/25.fuzz create mode 100644 tests/fuzz-crashes/26.fuzz create mode 100644 tests/fuzz-crashes/27.fuzz create mode 100644 tests/fuzz-crashes/28.fuzz create mode 100644 tests/fuzz-crashes/29.fuzz create mode 100644 tests/fuzz-crashes/3.fuzz create mode 100644 tests/fuzz-crashes/30.fuzz create mode 100644 tests/fuzz-crashes/31.fuzz create mode 100644 tests/fuzz-crashes/32.fuzz create mode 100644 tests/fuzz-crashes/33.fuzz create mode 100644 tests/fuzz-crashes/34.fuzz create mode 100644 tests/fuzz-crashes/35.fuzz create mode 100644 tests/fuzz-crashes/36.fuzz create mode 100644 tests/fuzz-crashes/37.fuzz create mode 100644 tests/fuzz-crashes/38.fuzz create mode 100644 tests/fuzz-crashes/39.fuzz create mode 100644 tests/fuzz-crashes/4.fuzz create mode 100644 tests/fuzz-crashes/40.fuzz create mode 100644 tests/fuzz-crashes/41.fuzz create mode 100644 tests/fuzz-crashes/42.fuzz create mode 100644 tests/fuzz-crashes/43.fuzz create mode 100644 tests/fuzz-crashes/44.fuzz create mode 100644 tests/fuzz-crashes/45.fuzz create mode 100644 tests/fuzz-crashes/46.fuzz create mode 100644 tests/fuzz-crashes/47.fuzz create mode 100644 tests/fuzz-crashes/48.fuzz create mode 100644 tests/fuzz-crashes/49.fuzz create mode 100644 tests/fuzz-crashes/5.fuzz create mode 100644 tests/fuzz-crashes/50.fuzz create mode 100644 tests/fuzz-crashes/51.fuzz create mode 100644 tests/fuzz-crashes/52.fuzz create mode 100644 tests/fuzz-crashes/53.fuzz create mode 100644 tests/fuzz-crashes/54.fuzz create mode 100644 tests/fuzz-crashes/55.fuzz create mode 100644 tests/fuzz-crashes/56.fuzz create mode 100644 tests/fuzz-crashes/57.fuzz create mode 100644 tests/fuzz-crashes/58.fuzz create mode 100644 tests/fuzz-crashes/59.fuzz create mode 100644 tests/fuzz-crashes/6.fuzz create mode 100644 tests/fuzz-crashes/60.fuzz create mode 100644 tests/fuzz-crashes/61.fuzz create mode 100644 tests/fuzz-crashes/62.fuzz create mode 100644 tests/fuzz-crashes/63.fuzz create mode 100644 tests/fuzz-crashes/64.fuzz create mode 100644 tests/fuzz-crashes/65.fuzz create mode 100644 tests/fuzz-crashes/66.fuzz create mode 100644 tests/fuzz-crashes/67.fuzz create mode 100644 tests/fuzz-crashes/68.fuzz create mode 100644 tests/fuzz-crashes/69.fuzz create mode 100644 tests/fuzz-crashes/7.fuzz create mode 100644 tests/fuzz-crashes/70.fuzz create mode 100644 tests/fuzz-crashes/71.fuzz create mode 100644 tests/fuzz-crashes/72.fuzz create mode 100644 tests/fuzz-crashes/73.fuzz create mode 100644 tests/fuzz-crashes/74.fuzz create mode 100644 tests/fuzz-crashes/75.fuzz create mode 100644 tests/fuzz-crashes/76.fuzz create mode 100644 tests/fuzz-crashes/77.fuzz create mode 100644 tests/fuzz-crashes/8.fuzz create mode 100644 tests/fuzz-crashes/9.fuzz create mode 100644 tests/fuzz-crashes/Makefile.am create mode 100755 tests/run_fuzz_test.sh create mode 100755 tools/fuzz create mode 100755 tools/save-fuzz-crashes diff --git a/Makefile.am b/Makefile.am index 3576fdb..6f4ed8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ TEST_EXTENSIONS = TEST_INPUTS = TEST_SCRIPTS_APLWC = TEST_SCRIPTS_SH = +TEST_FUZZ_CRASHES = XFAIL_TESTS = AM_TESTS_ENVIRONMENT = PATH="$(top_bindir):$$PATH"; export PATH; AM_CPPFLAGS = -I$(top_srcdir)/src/include/ -I$(top_builddir)/generated @@ -20,6 +21,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include/ -I$(top_builddir)/generated include src/Makefile.am include tests/Makefile.am -TESTS += $(TEST_INPUTS) $(TEST_SCRIPTS_SH) $(TEST_SCRIPTS_APLWC) +TESTS += $(TEST_INPUTS) $(TEST_SCRIPTS_SH) $(TEST_SCRIPTS_APLWC) $(TEST_FUZZ_CRASHES) EXTRA_DIST += $(TEST_INPUTS) $(TEST_SCRIPTS_SH) $(TEST_SCRIPTS_APLWC) CLEANFILES += $(BUILT_SOURCES) diff --git a/tests/Makefile.am b/tests/Makefile.am index bea1bac..27fd83f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -80,3 +80,9 @@ TEST_SCRIPTS_APLWC += \ tests/scripts/bad/11.aplwc \ tests/scripts/bad/12.aplwc \ tests/scripts/bad/13.aplwc + +TEST_EXTENSIONS += .fuzz +FUZZ_LOG_COMPILER = $(top_srcdir)/tests/run_fuzz_test.sh +EXTRA_DIST += $(FUZZ_LOG_COMPILER) + +include tests/fuzz-crashes/Makefile.am diff --git a/tests/fuzz-crashes/1.fuzz b/tests/fuzz-crashes/1.fuzz new file mode 100644 index 0000000..b3f468a --- /dev/null +++ b/tests/fuzz-crashes/1.fuzz @@ -0,0 +1,2 @@ +#!00000000000000 +:' diff --git a/tests/fuzz-crashes/10.fuzz b/tests/fuzz-crashes/10.fuzz new file mode 100644 index 0000000..0b5460a --- /dev/null +++ b/tests/fuzz-crashes/10.fuzz @@ -0,0 +1,3 @@ + f00 0+00∇ + +∇:f diff --git a/tests/fuzz-crashes/11.fuzz b/tests/fuzz-crashes/11.fuzz new file mode 100644 index 0000000..6133ee7 --- /dev/null +++ b/tests/fuzz-crashes/11.fuzz @@ -0,0 +1,7 @@ +#:00000000000000 + f00 x + ⎕←x+x +∇00 + +' +' diff --git a/tests/fuzz-crashes/12.fuzz b/tests/fuzz-crashes/12.fuzz new file mode 100644 index 0000000..bef576e --- /dev/null +++ b/tests/fuzz-crashes/12.fuzz @@ -0,0 +1,8 @@ +#!000000000000000 + +:exp000000000000 + +:module +ort plu æs 00 + +' diff --git a/tests/fuzz-crashes/13.fuzz b/tests/fuzz-crashes/13.fuzz new file mode 100644 index 0000000..0006719 --- /dev/null +++ b/tests/fuzz-crashes/13.fuzz @@ -0,0 +1,5 @@ +#0000 + +::::::::::us dxport plus 00 + +' diff --git a/tests/fuzz-crashes/14.fuzz b/tests/fuzz-crashes/14.fuzz new file mode 100644 index 0000000..2233b0d --- /dev/null +++ b/tests/fuzz-crashes/14.fuzz @@ -0,0 +1,5 @@ +#!00000000-000000 +:exp.0000 +ort plus 00 + +' diff --git a/tests/fuzz-crashes/15.fuzz b/tests/fuzz-crashes/15.fuzz new file mode 100644 index 0000000..1978d4f --- /dev/null +++ b/tests/fuzz-crashes/15.fuzz @@ -0,0 +1,5 @@ +#!000000000000000 + +::::::!00000000000000 + +'''''''. diff --git a/tests/fuzz-crashes/16.fuzz b/tests/fuzz-crashes/16.fuzz new file mode 100644 index 0000000..330570d Binary files /dev/null and b/tests/fuzz-crashes/16.fuzz differ diff --git a/tests/fuzz-crashes/17.fuzz b/tests/fuzz-crashes/17.fuzz new file mode 100644 index 0000000..8e7d484 --- /dev/null +++ b/tests/fuzz-crashes/17.fuzz @@ -0,0 +1,6 @@ +#!000000000000000 + +:expo######" +####!0###########!0####################rt plus 00 + +' diff --git a/tests/fuzz-crashes/18.fuzz b/tests/fuzz-crashes/18.fuzz new file mode 100644 index 0000000..0c3ff83 --- /dev/null +++ b/tests/fuzz-crashes/18.fuzz @@ -0,0 +1,5 @@ +#9000 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@000000000000 + +:expoqt p@@@@@@@@@@@@@@@@@@@@lus 00 + +' diff --git a/tests/fuzz-crashes/19.fuzz b/tests/fuzz-crashes/19.fuzz new file mode 100644 index 0000000..e47c9e4 --- /dev/null +++ b/tests/fuzz-crashes/19.fuzz @@ -0,0 +1 @@ + 0000000000000%000000000000000:1'0 \ No newline at end of file diff --git a/tests/fuzz-crashes/2.fuzz b/tests/fuzz-crashes/2.fuzz new file mode 100644 index 0000000..334fe5f --- /dev/null +++ b/tests/fuzz-crashes/2.fuzz @@ -0,0 +1,3 @@ +:!00000000000000 + +' diff --git a/tests/fuzz-crashes/20.fuzz b/tests/fuzz-crashes/20.fuzz new file mode 100644 index 0000000..2010544 --- /dev/null +++ b/tests/fuzz-crashes/20.fuzz @@ -0,0 +1,19 @@ +#!000000000000000 + +:export pXus 0000 + +pp\ppppppppp' +00 + +0000 + +!000000000 + +:symbol plus +00 + +0000 + +!r)))0000000000 + +:symbo' diff --git a/tests/fuzz-crashes/21.fuzz b/tests/fuzz-crashes/21.fuzz new file mode 100644 index 0000000..feedbd6 --- /dev/null +++ b/tests/fuzz-crashes/21.fuzz @@ -0,0 +1,18 @@ +#!000 + +:export pt #!00000000000000 + +' +#!s 000" + +pp\pppppppp0 + +:e00p' +00 + +000 + + +!r)F)000000000000 + +' diff --git a/tests/fuzz-crashes/22.fuzz b/tests/fuzz-crashes/22.fuzz new file mode 100644 index 0000000..8f73ef9 --- /dev/null +++ b/tests/fuzz-crashes/22.fuzz @@ -0,0 +1,40 @@ +#!000000000000000 + +: + + + + + + + + + + + + + + + + + + + +0 + + + + + + + + + +export pXus 0000 + +pp\pppppp]pp' +00 + +000000 + +' diff --git a/tests/fuzz-crashes/23.fuzz b/tests/fuzz-crashes/23.fuzz new file mode 100644 index 0000000..08fb8ef --- /dev/null +++ b/tests/fuzz-crashes/23.fuzz @@ -0,0 +1,26 @@ +#!0000000000 + + + + + +00000 + +:exp00000000)) +0000 + +!r0000 +ort prt p#########<<<<000 + +pp\ppppppppp600 + +!r)))000 +00 + +0/ + +▇ 000000▇ 0 +' +0 + +' diff --git a/tests/fuzz-crashes/24.fuzz b/tests/fuzz-crashes/24.fuzz new file mode 100644 index 0000000..9cd485a Binary files /dev/null and b/tests/fuzz-crashes/24.fuzz differ diff --git a/tests/fuzz-crashes/25.fuzz b/tests/fuzz-crashes/25.fuzz new file mode 100644 index 0000000..91146cb Binary files /dev/null and b/tests/fuzz-crashes/25.fuzz differ diff --git a/tests/fuzz-crashes/26.fuzz b/tests/fuzz-crashes/26.fuzz new file mode 100644 index 0000000..daba95c --- /dev/null +++ b/tests/fuzz-crashes/26.fuzz @@ -0,0 +1,11 @@ +#!000000000000000 + +:export pre p#<<000000 + +:ex00 + +:expvrt prt p#########<<@0 + +!r)))000000000@00 + +' diff --git a/tests/fuzz-crashes/27.fuzz b/tests/fuzz-crashes/27.fuzz new file mode 100644 index 0000000..fb7a5fc --- /dev/null +++ b/tests/fuzz-crashes/27.fuzz @@ -0,0 +1,7 @@ +E!OOOO000000000 + +:e_porOOOOO%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%00000 + +:expo%%%%%us 00 + +' diff --git a/tests/fuzz-crashes/28.fuzz b/tests/fuzz-crashes/28.fuzz new file mode 100644 index 0000000..971b014 Binary files /dev/null and b/tests/fuzz-crashes/28.fuzz differ diff --git a/tests/fuzz-crashes/29.fuzz b/tests/fuzz-crashes/29.fuzz new file mode 100644 index 0000000..970ccc6 --- /dev/null +++ b/tests/fuzz-crashes/29.fuzz @@ -0,0 +1 @@ +:: \ No newline at end of file diff --git a/tests/fuzz-crashes/3.fuzz b/tests/fuzz-crashes/3.fuzz new file mode 100644 index 0000000..aafbf74 --- /dev/null +++ b/tests/fuzz-crashes/3.fuzz @@ -0,0 +1,3 @@ +#:00000000000000 + +' diff --git a/tests/fuzz-crashes/30.fuzz b/tests/fuzz-crashes/30.fuzz new file mode 100644 index 0000000..48c3b16 --- /dev/null +++ b/tests/fuzz-crashes/30.fuzz @@ -0,0 +1,42 @@ +#!000000000000001 + +:e0000000010000000000001 + +:e0000000 + +:exporN!000 + + + + + + + + + + + +exc!000 + + + + + + + + + + + + + + + + + + +0000 + +!r)))000000000000 + +' diff --git a/tests/fuzz-crashes/31.fuzz b/tests/fuzz-crashes/31.fuzz new file mode 100644 index 0000000..c49d136 Binary files /dev/null and b/tests/fuzz-crashes/31.fuzz differ diff --git a/tests/fuzz-crashes/32.fuzz b/tests/fuzz-crashes/32.fuzz new file mode 100644 index 0000000..e352b4f Binary files /dev/null and b/tests/fuzz-crashes/32.fuzz differ diff --git a/tests/fuzz-crashes/33.fuzz b/tests/fuzz-crashes/33.fuzz new file mode 100644 index 0000000..e16c989 Binary files /dev/null and b/tests/fuzz-crashes/33.fuzz differ diff --git a/tests/fuzz-crashes/34.fuzz b/tests/fuzz-crashes/34.fuzz new file mode 100644 index 0000000..fb4f1fd Binary files /dev/null and b/tests/fuzz-crashes/34.fuzz differ diff --git a/tests/fuzz-crashes/35.fuzz b/tests/fuzz-crashes/35.fuzz new file mode 100644 index 0000000..95546ec Binary files /dev/null and b/tests/fuzz-crashes/35.fuzz differ diff --git a/tests/fuzz-crashes/36.fuzz b/tests/fuzz-crashes/36.fuzz new file mode 100644 index 0000000..5c6db57 Binary files /dev/null and b/tests/fuzz-crashes/36.fuzz differ diff --git a/tests/fuzz-crashes/37.fuzz b/tests/fuzz-crashes/37.fuzz new file mode 100644 index 0000000..aa7efbe Binary files /dev/null and b/tests/fuzz-crashes/37.fuzz differ diff --git a/tests/fuzz-crashes/38.fuzz b/tests/fuzz-crashes/38.fuzz new file mode 100644 index 0000000..b3f468a --- /dev/null +++ b/tests/fuzz-crashes/38.fuzz @@ -0,0 +1,2 @@ +#!00000000000000 +:' diff --git a/tests/fuzz-crashes/39.fuzz b/tests/fuzz-crashes/39.fuzz new file mode 100644 index 0000000..334fe5f --- /dev/null +++ b/tests/fuzz-crashes/39.fuzz @@ -0,0 +1,3 @@ +:!00000000000000 + +' diff --git a/tests/fuzz-crashes/4.fuzz b/tests/fuzz-crashes/4.fuzz new file mode 100644 index 0000000..f3104fc --- /dev/null +++ b/tests/fuzz-crashes/4.fuzz @@ -0,0 +1,3 @@ +!00000000000000 + +:sy \ No newline at end of file diff --git a/tests/fuzz-crashes/40.fuzz b/tests/fuzz-crashes/40.fuzz new file mode 100644 index 0000000..aafbf74 --- /dev/null +++ b/tests/fuzz-crashes/40.fuzz @@ -0,0 +1,3 @@ +#:00000000000000 + +' diff --git a/tests/fuzz-crashes/41.fuzz b/tests/fuzz-crashes/41.fuzz new file mode 100644 index 0000000..3ad884c --- /dev/null +++ b/tests/fuzz-crashes/41.fuzz @@ -0,0 +1,4 @@ +#000000 +0 +:s@mbol +' \ No newline at end of file diff --git a/tests/fuzz-crashes/42.fuzz b/tests/fuzz-crashes/42.fuzz new file mode 100644 index 0000000..82f171d Binary files /dev/null and b/tests/fuzz-crashes/42.fuzz differ diff --git a/tests/fuzz-crashes/43.fuzz b/tests/fuzz-crashes/43.fuzz new file mode 100644 index 0000000..35e153b --- /dev/null +++ b/tests/fuzz-crashes/43.fuzz @@ -0,0 +1,5 @@ +#!00000000#!00000000000000 + +:module000000 + +' diff --git a/tests/fuzz-crashes/44.fuzz b/tests/fuzz-crashes/44.fuzz new file mode 100644 index 0000000..60c14dd --- /dev/null +++ b/tests/fuzz-crashes/44.fuzz @@ -0,0 +1,3 @@ +0:000000000/000 + +'' diff --git a/tests/fuzz-crashes/45.fuzz b/tests/fuzz-crashes/45.fuzz new file mode 100644 index 0000000..46a17b8 --- /dev/null +++ b/tests/fuzz-crashes/45.fuzz @@ -0,0 +1 @@ +#!00!0000000000000:0 \ No newline at end of file diff --git a/tests/fuzz-crashes/46.fuzz b/tests/fuzz-crashes/46.fuzz new file mode 100644 index 0000000..397db75 --- /dev/null +++ b/tests/fuzz-crashes/46.fuzz @@ -0,0 +1 @@ +: diff --git a/tests/fuzz-crashes/47.fuzz b/tests/fuzz-crashes/47.fuzz new file mode 100644 index 0000000..932bb92 --- /dev/null +++ b/tests/fuzz-crashes/47.fuzz @@ -0,0 +1,3 @@ +}}}}}}}}}}}}}}}}}}}}}}}}}00#!00000000:00000 + +' diff --git a/tests/fuzz-crashes/48.fuzz b/tests/fuzz-crashes/48.fuzz new file mode 100644 index 0000000..acdba91 Binary files /dev/null and b/tests/fuzz-crashes/48.fuzz differ diff --git a/tests/fuzz-crashes/49.fuzz b/tests/fuzz-crashes/49.fuzz new file mode 100644 index 0000000..01fdf9e --- /dev/null +++ b/tests/fuzz-crashes/49.fuzz @@ -0,0 +1,5 @@ +#!por00000.*0000000 + +:expor00000.*00000 + +' diff --git a/tests/fuzz-crashes/5.fuzz b/tests/fuzz-crashes/5.fuzz new file mode 100644 index 0000000..d8e8a18 --- /dev/null +++ b/tests/fuzz-crashes/5.fuzz @@ -0,0 +1,5 @@ +00000000 + +:expo0 + +'% \ No newline at end of file diff --git a/tests/fuzz-crashes/50.fuzz b/tests/fuzz-crashes/50.fuzz new file mode 100644 index 0000000..4df9cbd --- /dev/null +++ b/tests/fuzz-crashes/50.fuzz @@ -0,0 +1,3 @@ +#!0000%0#!00000000000000 + +:modøå \ No newline at end of file diff --git a/tests/fuzz-crashes/51.fuzz b/tests/fuzz-crashes/51.fuzz new file mode 100644 index 0000000..cd4f48a --- /dev/null +++ b/tests/fuzz-crashes/51.fuzz @@ -0,0 +1,9 @@ +#!00000000000#!00000000000000 + +:symb000 + +.0000/00 + + + +' diff --git a/tests/fuzz-crashes/52.fuzz b/tests/fuzz-crashes/52.fuzz new file mode 100644 index 0000000..ef6d0c4 --- /dev/null +++ b/tests/fuzz-crashes/52.fuzz @@ -0,0 +1,2 @@ +" +:: \ No newline at end of file diff --git a/tests/fuzz-crashes/53.fuzz b/tests/fuzz-crashes/53.fuzz new file mode 100644 index 0000000..97efc04 --- /dev/null +++ b/tests/fuzz-crashes/53.fuzz @@ -0,0 +1,3 @@ +##ⱕ←000010000 + +###'000000:00000 diff --git a/tests/fuzz-crashes/54.fuzz b/tests/fuzz-crashes/54.fuzz new file mode 100644 index 0000000..091f1d0 Binary files /dev/null and b/tests/fuzz-crashes/54.fuzz differ diff --git a/tests/fuzz-crashes/55.fuzz b/tests/fuzz-crashes/55.fuzz new file mode 100644 index 0000000..73e4266 --- /dev/null +++ b/tests/fuzz-crashes/55.fuzz @@ -0,0 +1 @@ +#+++*++:$$$$$$$$$$$$$$$++!++$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++!++++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/56.fuzz b/tests/fuzz-crashes/56.fuzz new file mode 100644 index 0000000..05a158f --- /dev/null +++ b/tests/fuzz-crashes/56.fuzz @@ -0,0 +1,3 @@ +#+++*++$$$$000:0000'0:::::00008000 + +$$$$$$$$$$$$$$$$$$$$$$$$++!++++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/57.fuzz b/tests/fuzz-crashes/57.fuzz new file mode 100644 index 0000000..72535f9 --- /dev/null +++ b/tests/fuzz-crashes/57.fuzz @@ -0,0 +1,2 @@ +#+++*++$$$$$$$$$$$$$$$$++!++$$$$$$$$$$$ +:#!0000000000:0000'0:::::++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/58.fuzz b/tests/fuzz-crashes/58.fuzz new file mode 100644 index 0000000..0cb1005 Binary files /dev/null and b/tests/fuzz-crashes/58.fuzz differ diff --git a/tests/fuzz-crashes/59.fuzz b/tests/fuzz-crashes/59.fuzz new file mode 100644 index 0000000..9da9975 Binary files /dev/null and b/tests/fuzz-crashes/59.fuzz differ diff --git a/tests/fuzz-crashes/6.fuzz b/tests/fuzz-crashes/6.fuzz new file mode 100644 index 0000000..e6d0382 --- /dev/null +++ b/tests/fuzz-crashes/6.fuzz @@ -0,0 +1,5 @@ +#!00000000000000000 + +:symbol00K00000 + +' diff --git a/tests/fuzz-crashes/60.fuzz b/tests/fuzz-crashes/60.fuzz new file mode 100644 index 0000000..3362a4a --- /dev/null +++ b/tests/fuzz-crashes/60.fuzz @@ -0,0 +1,30 @@ + + + + + + + +# + + + + + +:ex + + + + + + + + + + + +:exportport plportport plus minu plus mirtport plus minu plus mi + + + + diff --git a/tests/fuzz-crashes/61.fuzz b/tests/fuzz-crashes/61.fuzz new file mode 100644 index 0000000..a11470e Binary files /dev/null and b/tests/fuzz-crashes/61.fuzz differ diff --git a/tests/fuzz-crashes/62.fuzz b/tests/fuzz-crashes/62.fuzz new file mode 100644 index 0000000..a1bae13 --- /dev/null +++ b/tests/fuzz-crashes/62.fuzz @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + +:export plus minus f00 æs f0 + + + + + + + + + + + + + + + +:e minus f00 plus minsxport + + +:export pluus + + + + + diff --git a/tests/fuzz-crashes/63.fuzz b/tests/fuzz-crashes/63.fuzz new file mode 100644 index 0000000..17e8ae3 --- /dev/null +++ b/tests/fuzz-crashes/63.fuzz @@ -0,0 +1,5 @@ +#!00000000000000 + +∇ r0 +⎕←00:, 0 +∇ diff --git a/tests/fuzz-crashes/64.fuzz b/tests/fuzz-crashes/64.fuzz new file mode 100644 index 0000000..14d5120 Binary files /dev/null and b/tests/fuzz-crashes/64.fuzz differ diff --git a/tests/fuzz-crashes/65.fuzz b/tests/fuzz-crashes/65.fuzz new file mode 100644 index 0000000..d0219bd --- /dev/null +++ b/tests/fuzz-crashes/65.fuzz @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + +:e + + + +$$$$$sZZZZZZZZZZZZZZXZZZZZZjZZZZ minus f00"æs f0 + + + + + + +s + + + + + +$$8$$ diff --git a/tests/fuzz-crashes/66.fuzz b/tests/fuzz-crashes/66.fuzz new file mode 100644 index 0000000..ddbd662 Binary files /dev/null and b/tests/fuzz-crashes/66.fuzz differ diff --git a/tests/fuzz-crashes/67.fuzz b/tests/fuzz-crashes/67.fuzz new file mode 100644 index 0000000..ca54d42 Binary files /dev/null and b/tests/fuzz-crashes/67.fuzz differ diff --git a/tests/fuzz-crashes/68.fuzz b/tests/fuzz-crashes/68.fuzz new file mode 100644 index 0000000..9f9bcea --- /dev/null +++ b/tests/fuzz-crashes/68.fuzz @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + +:export plus minus f00 + + + + + +:export plus minus æs f + + + + +:export pl++++us minus:f00 + + + + + + + + + + + + + + diff --git a/tests/fuzz-crashes/69.fuzz b/tests/fuzz-crashes/69.fuzz new file mode 100644 index 0000000..e295d5e --- /dev/null +++ b/tests/fuzz-crashes/69.fuzz @@ -0,0 +1,7 @@ + + + +:export plus mi\us f00 æs f$+$$$$$$$$$$ +$$$$$$$$$$$$$$$$$$$$${{n{{p0000@l$$$$$$$$$$$$$$$$$#$$$$$$$$$$$$$$$$++!++$$$$$%$$$@#$$$$$$$$$$$$$$$$$$$$$$$$$${{{[{p0000@l$inus f00 æ$$$$$$$00000 + +':$$$$$$$$$$$$$$$$$$$$$$$#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#$$$$$$$$$++←00$$$$$++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/7.fuzz b/tests/fuzz-crashes/7.fuzz new file mode 100644 index 0000000..1cae677 --- /dev/null +++ b/tests/fuzz-crashes/7.fuzz @@ -0,0 +1,7 @@ +00000000 + +:s00 + +'00'#!00000000000000 + +' diff --git a/tests/fuzz-crashes/70.fuzz b/tests/fuzz-crashes/70.fuzz new file mode 100644 index 0000000..183ca85 --- /dev/null +++ b/tests/fuzz-crashes/70.fuzz @@ -0,0 +1,4 @@ + + + +:export plus minus f00 æs f$+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$${{n{{p0000@lus mi$$:#$$$$$#$$+$$$$$$$$$$$$$$$$++!++$$$$$%$$$@#$$$$$$$$$$$$$$$$$$$$$$$$$$${{{{p0000@l$inus f00 æ$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$${$$$$$$$$$$$$$$$$$$#$$$$$$$$$++←00$$$$$++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/71.fuzz b/tests/fuzz-crashes/71.fuzz new file mode 100644 index 0000000..14f2ae6 --- /dev/null +++ b/tests/fuzz-crashes/71.fuzz @@ -0,0 +1 @@ +:p,u𱱱s/m$$$$$$$$$$$$$$$$$$$$$4$$ \ No newline at end of file diff --git a/tests/fuzz-crashes/72.fuzz b/tests/fuzz-crashes/72.fuzz new file mode 100644 index 0000000..1a826eb Binary files /dev/null and b/tests/fuzz-crashes/72.fuzz differ diff --git a/tests/fuzz-crashes/73.fuzz b/tests/fuzz-crashes/73.fuzz new file mode 100644 index 0000000..a2deac1 --- /dev/null +++ b/tests/fuzz-crashes/73.fuzz @@ -0,0 +1,7 @@ + + + +:export plus mi\us f00 æs f$+$$$$$$$$$$ +$$$$$$$$$$$$$$$$$$$$vvvvvvvvvvvvvvv mi$$$#$$$$$#$$+$$$$$$$$$%$$$$$$++!++$$$$$%$$$@#$$$$$$$$$$$$$$$$$$$$$$$$$${{{{{Q0000@l$inus f00 æ$$$$$$$00000 + +':$$$$$$$$$$$$$$$$$$$$$$$#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$EEE$$$$$#$$$$$$$$$++←00$$$$$++8+ \ No newline at end of file diff --git a/tests/fuzz-crashes/74.fuzz b/tests/fuzz-crashes/74.fuzz new file mode 100644 index 0000000..9f4aa7f Binary files /dev/null and b/tests/fuzz-crashes/74.fuzz differ diff --git a/tests/fuzz-crashes/75.fuzz b/tests/fuzz-crashes/75.fuzz new file mode 100644 index 0000000..151a3e8 --- /dev/null +++ b/tests/fuzz-crashes/75.fuzz @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +:export p,us minus f00"æsssssssssssssssssss%f0 + + + + + + + +:eyport $$$ diff --git a/tests/fuzz-crashes/76.fuzz b/tests/fuzz-crashes/76.fuzz new file mode 100644 index 0000000..3c62449 --- /dev/null +++ b/tests/fuzz-crashes/76.fuzz @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +:export p,us $$$$$$$$$$$$$$$$$$$$$$:$$ \ No newline at end of file diff --git a/tests/fuzz-crashes/77.fuzz b/tests/fuzz-crashes/77.fuzz new file mode 100644 index 0000000..171f0c2 --- /dev/null +++ b/tests/fuzz-crashes/77.fuzz @@ -0,0 +1,34 @@ + + + + + + +æs f0 + + + + + + + + + + + + + +$$$$$ +ZZZZZZZZZZZZZZZZZZZZ mjnus f00" + + + + + + + +:e + + + +$$$$$sZZZZZZ \ No newline at end of file diff --git a/tests/fuzz-crashes/8.fuzz b/tests/fuzz-crashes/8.fuzz new file mode 100644 index 0000000..7dc1be2 Binary files /dev/null and b/tests/fuzz-crashes/8.fuzz differ diff --git a/tests/fuzz-crashes/9.fuzz b/tests/fuzz-crashes/9.fuzz new file mode 100644 index 0000000..466e317 --- /dev/null +++ b/tests/fuzz-crashes/9.fuzz @@ -0,0 +1,5 @@ +#!000000000000000 + +:symbol000080000000 + +' diff --git a/tests/fuzz-crashes/Makefile.am b/tests/fuzz-crashes/Makefile.am new file mode 100644 index 0000000..288d4e0 --- /dev/null +++ b/tests/fuzz-crashes/Makefile.am @@ -0,0 +1 @@ +TEST_INPUTS += tests/fuzz-crashes/1.fuzz tests/fuzz-crashes/10.fuzz tests/fuzz-crashes/11.fuzz tests/fuzz-crashes/12.fuzz tests/fuzz-crashes/13.fuzz tests/fuzz-crashes/14.fuzz tests/fuzz-crashes/15.fuzz tests/fuzz-crashes/16.fuzz tests/fuzz-crashes/17.fuzz tests/fuzz-crashes/18.fuzz tests/fuzz-crashes/19.fuzz tests/fuzz-crashes/2.fuzz tests/fuzz-crashes/20.fuzz tests/fuzz-crashes/21.fuzz tests/fuzz-crashes/22.fuzz tests/fuzz-crashes/23.fuzz tests/fuzz-crashes/24.fuzz tests/fuzz-crashes/25.fuzz tests/fuzz-crashes/26.fuzz tests/fuzz-crashes/27.fuzz tests/fuzz-crashes/28.fuzz tests/fuzz-crashes/29.fuzz tests/fuzz-crashes/3.fuzz tests/fuzz-crashes/30.fuzz tests/fuzz-crashes/31.fuzz tests/fuzz-crashes/32.fuzz tests/fuzz-crashes/33.fuzz tests/fuzz-crashes/34.fuzz tests/fuzz-crashes/35.fuzz tests/fuzz-crashes/36.fuzz tests/fuzz-crashes/37.fuzz tests/fuzz-crashes/38.fuzz tests/fuzz-crashes/39.fuzz tests/fuzz-crashes/4.fuzz tests/fuzz-crashes/40.fuzz tests/fuzz-crashes/41.fuzz tests/fuzz-crashes/42.fuzz tests/fuzz-crashes/43.fuzz tests/fuzz-crashes/44.fuzz tests/fuzz-crashes/45.fuzz tests/fuzz-crashes/46.fuzz tests/fuzz-crashes/47.fuzz tests/fuzz-crashes/48.fuzz tests/fuzz-crashes/49.fuzz tests/fuzz-crashes/5.fuzz tests/fuzz-crashes/50.fuzz tests/fuzz-crashes/51.fuzz tests/fuzz-crashes/52.fuzz tests/fuzz-crashes/53.fuzz tests/fuzz-crashes/54.fuzz tests/fuzz-crashes/55.fuzz tests/fuzz-crashes/56.fuzz tests/fuzz-crashes/57.fuzz tests/fuzz-crashes/58.fuzz tests/fuzz-crashes/59.fuzz tests/fuzz-crashes/6.fuzz tests/fuzz-crashes/60.fuzz tests/fuzz-crashes/61.fuzz tests/fuzz-crashes/62.fuzz tests/fuzz-crashes/63.fuzz tests/fuzz-crashes/64.fuzz tests/fuzz-crashes/65.fuzz tests/fuzz-crashes/66.fuzz tests/fuzz-crashes/67.fuzz tests/fuzz-crashes/68.fuzz tests/fuzz-crashes/69.fuzz tests/fuzz-crashes/7.fuzz tests/fuzz-crashes/70.fuzz tests/fuzz-crashes/71.fuzz tests/fuzz-crashes/72.fuzz tests/fuzz-crashes/73.fuzz tests/fuzz-crashes/74.fuzz tests/fuzz-crashes/75.fuzz tests/fuzz-crashes/76.fuzz tests/fuzz-crashes/77.fuzz tests/fuzz-crashes/8.fuzz tests/fuzz-crashes/9.fuzz diff --git a/tests/run_fuzz_test.sh b/tests/run_fuzz_test.sh new file mode 100755 index 0000000..482f045 --- /dev/null +++ b/tests/run_fuzz_test.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +aplwc "$1" +case $? in + 0|1) + exit 0 + ;; + *) + exit 1 + ;; +esac diff --git a/tools/fuzz b/tools/fuzz new file mode 100755 index 0000000..892e950 --- /dev/null +++ b/tools/fuzz @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ $# -ne 1 ] +then + echo Usage: tools/fuzz BUILD_TYPE + exit 1 +fi + +rm -rf builds/fuzz-$1 +mkdir -p builds/fuzz-$1 +cd builds/fuzz-$1 +../../configure --enable-enable-build-mode=$1 --disable-shared CC=afl-cc +make clean && make +mkdir -p fuzz-in +mkdir -p fuzz-out +mkdir -p fuzz-in-min +cp ../../tests/scripts/good/*.aplwc fuzz-in +cp ../../tests/scripts/bad/*.aplwc fuzz-in +afl-cmin -i fuzz-in -o fuzz-in-min -- ./aplwc @@ +rm fuzz-in/* +cd fuzz-in-min +for f in * +do + afl-tmin -i "$f" -o "../fuzz-in/$f" -- ../aplwc @@ +done +cd .. +rm -rf fuzz-in-min +afl-fuzz -i fuzz-in -o fuzz-out -m 20 -t 50 -- ./aplwc @@ diff --git a/tools/save-fuzz-crashes b/tools/save-fuzz-crashes new file mode 100755 index 0000000..ea21356 --- /dev/null +++ b/tools/save-fuzz-crashes @@ -0,0 +1,33 @@ +#!/bin/sh + +out=tests/fuzz-crashes + +n=0 +for f in "$out"/*.fuzz +do + name=${f##*/} + num=${name%.fuzz} + if [ "$num" -gt "$n" ] + then + n=$num + fi +done + +n=$((n+1)) + +for dir in builds/fuzz-*/fuzz-out/default/crashes +do + for f in "$dir"/id* + do + cp "$f" "$out/$n.fuzz" + n=$((n+1)) + done +done + +rm -f "$out/Makefile.am" +echo -n "TEST_INPUTS += " > "$out/Makefile.am" +for f in "$out"/*.fuzz +do + printf "%s " "$f" >> "$out/Makefile.am" +done +echo "" >> "$out/Makefile.am" -- cgit v1.2.3