simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Jan 15 16:14:10 GMT 2023


TL;DR:
  332873d Add more functions to nullfe.c
  9478efe Remove some midend functions from nullfe.c
  53a1faa Add a fuzzing harness for Puzzles
  69924f3 AFL-specific shared-memory fuzzing mode
  311d227 Merge the two versions of fuzzpuzz back together
  5fa1931 Don't leak midends in fuzzpuzz
  1a48d76 Remember to free the game name in fuzzpuzz
  32c487b Add a dictionary for AFL++

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2023-01-15 16:14:10

commit 332873db834d641f4a28a5452cd7d32c373902a7
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=332873db834d641f4a28a5452cd7d32c373902a7;hp=e66d027a81211d327319cf45bb4155e689513f72
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Jan 7 18:54:26 2023 +0000

    Add more functions to nullfe.c
    
    The null get_random_seed required a little care.  It's not OK for it to
    return NULL and zero because NULL isn't a valid argument to memcpy()
    even with a length of zero (thank you UBSan).  So we return a single
    zero byte instead.

 nullfe.c | 9 +++++++++
 1 file changed, 9 insertions(+)

commit 9478efe32ea5aa6577d11fe45df81b49199780cd
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=9478efe32ea5aa6577d11fe45df81b49199780cd;hp=332873db834d641f4a28a5452cd7d32c373902a7
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Jan 7 18:55:37 2023 +0000

    Remove some midend functions from nullfe.c
    
    As far as I can tell, nothing that uses nullfe.c depends on these
    functions.  On the other hand, they do make it impossible to include
    nullfe.c and midend.c in the same program.  If anything does turn out to
    need them, they can be spun off into nullme.c or something.

 nullfe.c | 7 -------
 1 file changed, 7 deletions(-)

commit 53a1faa0d758c86c5bc77808c4265129d627be1b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=53a1faa0d758c86c5bc77808c4265129d627be1b;hp=9478efe32ea5aa6577d11fe45df81b49199780cd
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Jan 7 18:57:48 2023 +0000

    Add a fuzzing harness for Puzzles
    
    This just feeds save files into the loading code, but because of how
    Puzzles is structured that actually exercises most of its parsers.

 CMakeLists.txt |  5 +++++
 fuzzpuzz.c     | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)

commit 69924f376bd58932c7c3aa3234b9f12eb1866edc
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=69924f376bd58932c7c3aa3234b9f12eb1866edc;hp=53a1faa0d758c86c5bc77808c4265129d627be1b
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sun Jan 8 01:03:17 2023 +0000

    AFL-specific shared-memory fuzzing mode
    
    Rather than a save file from standard input and then exiting, this reads
    it from a shared memory buffer and then loops.  This makes fuzzing
    _much_ faster: one core on my laptop can now load about 30,000 save
    files per second.

 fuzzpuzz.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

commit 311d227ba6d101cc2c3096eefd4bc795f98303da
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=311d227ba6d101cc2c3096eefd4bc795f98303da;hp=69924f376bd58932c7c3aa3234b9f12eb1866edc
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Thu Jan 12 10:12:26 2023 +0000

    Merge the two versions of fuzzpuzz back together
    
    Now there's a single version of the main loop that runs once in normal
    mode and repeatedly in AFL++ persistent mode.  In persistent mode,
    fmemopen() allows the loop to read the shared-memory buffer as though
    it were a stdio stream.  fmemopen() is POSIX-only, but so is AFL++.

 fuzzpuzz.c | 145 +++++++++++++++++++++++--------------------------------------
 1 file changed, 55 insertions(+), 90 deletions(-)

commit 5fa193156070873b237e62a7177c2fa55d39508d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5fa193156070873b237e62a7177c2fa55d39508d;hp=311d227ba6d101cc2c3096eefd4bc795f98303da
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Thu Jan 12 10:58:21 2023 +0000

    Don't leak midends in fuzzpuzz
    
    If deserialising a save file fails, the midend still needs to be freed.

 fuzzpuzz.c | 1 +
 1 file changed, 1 insertion(+)

commit 1a48d76fcc9d45035641b7a861e5659da53ed63d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1a48d76fcc9d45035641b7a861e5659da53ed63d;hp=5fa193156070873b237e62a7177c2fa55d39508d
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Thu Jan 12 14:28:53 2023 +0000

    Remember to free the game name in fuzzpuzz

 fuzzpuzz.c | 1 +
 1 file changed, 1 insertion(+)

commit 32c487ba577e7da84d32f7e67d98e7e72fd5da70
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=32c487ba577e7da84d32f7e67d98e7e72fd5da70;hp=1a48d76fcc9d45035641b7a861e5659da53ed63d
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Jan 11 10:14:52 2023 +0000

    Add a dictionary for AFL++
    
    It consists of two parts.  One is the list of all record types used by
    the serialiser, to make it easy for AFL++ to find them.  The other is
    the "interesting" integers used by AFL++ converted to ASCII decimal
    form because Puzzles save files are coded in decimal and this will
    help AFL++ to guess good values.  I hope.

 fuzzpuzz.dict | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)



More information about the tartarus-commits mailing list