sharpfuzz icon indicating copy to clipboard operation
sharpfuzz copied to clipboard

Fork server handshake failed issue on Jil.dll

Open jackbourkemckenna opened this issue 3 years ago • 4 comments

Hi,

I have been having the same problems as this closed issue: https://github.com/Metalnem/sharpfuzz/issues/16

I've been trying to run the following example from ReadMe I get the following error:

jack@DESKTOP-HPQQTM1:~/test$ afl-fuzz  -i testcases -o Findings3 -m none -t 5000 dotnet bin/Debug/netcoreapp2.1/SharpFuzz.dll
afl-fuzz 2.52b by <[email protected]>
[+] You have 16 CPU cores and 1 runnable tasks (utilization: 6%).
[+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'testcases'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[*] Attempting dry run with 'id:000000,orig:Test.json'...
[*] Spinning up the fork server...

[-] Hmm, looks like the target binary terminated before we could complete a
    handshake with the injected code. Perhaps there is a horrible bug in the
    fuzzer. Poke <[email protected]> for troubleshooting tips.

[-] PROGRAM ABORT : Fork server handshake failed
         Location : init_forkserver(), afl-fuzz.c:2253

From reading the documentation I also tried running afl-fuzzer with the following parameter -Q. Doing it this way does not trow a fork server handshake error but just hangs with Fork Server is Running:

afl-fuzz  -i testcases -o Findings3 -m none -t 5000 -Q dotnet bin/Debug/netcoreapp2.1/SharpFuzz.dll
afl-fuzz 2.52b by <[email protected]>
[+] You have 16 CPU cores and 1 runnable tasks (utilization: 6%).
[+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'testcases'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[*] Attempting dry run with 'id:000000,orig:Test.json'...
[*] Spinning up the fork server...
[+] All right - fork server is up. 

Running this on WSL ubuntu, Any help resolving this problem would be great.

jackbourkemckenna avatar Sep 17 '21 17:09 jackbourkemckenna

I had this issue until I used -m 10000

My run command was afl-fuzz -i input -o output -m 10000 -t 5000 dotnet bin/Debug/net6.0/fuzztest.dll

TroyCornwall avatar Dec 19 '21 21:12 TroyCornwall

I run this command with (-m 10000) and it doesn't help: afl-fuzz -i in -o out -m 10000 -t 5000 dotnet bin/Debug/netcoreapp2.2/FuzzTest.dll afl-fuzz 2.52b by [email protected] [+] You have 8 CPU cores and 2 runnable tasks (utilization: 25%). [+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt. [] Checking CPU core loadout... [+] Found a free CPU core, binding to #0. [] Checking core_pattern... [] Checking CPU scaling governor... [] Setting up output directories... [] Scanning 'in'... [+] No auto-generated dictionary tokens to reuse. [] Creating hard links for all input files... [] Validating target binary... [] Attempting dry run with 'id:000000,orig:1.json'... [*] Spinning up the fork server...

[-] Hmm, looks like the target binary terminated before we could complete a handshake with the injected code. There are two probable explanations:

- The current memory limit (9.77 GB) is too restrictive, causing an OOM
  fault in the dynamic linker. This can be fixed with the -m option. A
  simple way to confirm the diagnosis may be:

  ( ulimit -Sv $[9999 << 10]; /path/to/fuzzed_app )

  Tip: you can use http://jwilk.net/software/recidivm to quickly
  estimate the required amount of virtual memory for the binary.

- Less likely, there is a horrible bug in the fuzzer. If other options
  fail, poke <[email protected]> for troubleshooting tips.

[-] PROGRAM ABORT : Fork server handshake failed Location : init_forkserver(), afl-fuzz.c:2253

What is wrong?

gfarida avatar Jun 03 '22 13:06 gfarida

I'm also experiencing this issue, not sure what the problem is... Win10x64 (Debian WSL)

gr4ysku11 avatar Jul 05 '22 19:07 gr4ysku11

Nevermind, figured it out. Apparently I didn't have .Net Core installed in my WSL environment... apt install dotnet-sdk-3.1

I was getting tripped up because I'm coding/compiling in Visual Studio but running everything in WSL.

gr4ysku11 avatar Jul 08 '22 19:07 gr4ysku11