jwilk / python-afl

American Fuzzy Lop fork server and instrumentation for pure-Python code
https://jwilk.net/software/python-afl
MIT License
350 stars 33 forks source link

test_cmin fails with AFL++: Exit code 2 != 0 received from afl-showmap #23

Open jwilk opened 2 years ago

jwilk commented 2 years ago

Cc: @maage

The afl-cmin test fails with recent AFL++ versions:

======================================================================
ERROR: tests.test_cmin.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File ".../python-afl/tests/test_cmin.py", line 63, in test
    run_afl_cmin([
  File ".../python-afl/tests/test_cmin.py", line 52, in run_afl_cmin
    run(cmdline)
  File ".../python-afl/tests/tools.py", line 157, in run
    raise ipc.CalledProcessError(child.returncode, cmd[0])
subprocess.CalledProcessError: Command 'py-afl-cmin' returned non-zero exit status 2.
-------------------- >> begin captured stdout << ---------------------
command: 
  py-afl-cmin -i ///tmp/python-afl.1f2sn_s_/in -o ///tmp/python-afl.1f2sn_s_/out -- /usr/bin/python3 .../python-afl/tests/target.py

stdout:
  corpus minimization tool for afl++ (awk version)

  [*] Obtaining traces for 5 input files in '///tmp/python-afl.1f2sn_s_/in'.
      Processing 5 files (forkserver mode)...
  [!] Exit code 2 != 0 received from afl-showmap, terminating...

--------------------- >> end captured stdout << ----------------------

The last good version was 3.12c.

Smaller reproducer:

$ mkdir 'in'
$ printf '0' > 'in/0'
$ printf '\317\207' > 'in/1'
$ py-afl-cmin -i 'in' -o 'out' -- /usr/bin/python3 tests/target.py
corpus minimization tool for afl++ (awk version)

[*] Obtaining traces for 2 input files in 'in'.
    Processing 2 files (forkserver mode)...
[!] Exit code 2 != 0 received from afl-showmap, terminating...
futhewo commented 1 year ago

I had the same kind of bug using afl-cmin, I solved it using afl-cmin.bash instead. You may try to change py-afl-cmin to use the latter. Hope it helps.