Zapotek/arachni — Issue #94: Cygwin - zombie cleanup before reports saved 
Author: Southbank
Created: 2011-11-01 05:51:33+00:00
State: open

This is for the latest experimental branch (Arachni 0.4) on Cygwin.

There appears to be race condition that happens more often if the scanned site is relatively big with many issues (example: this always happen when I try a scan on "http://google-gruyere.appspot.com/start"):

1) scan started
2) after a while the scan is 100% done
3) in the GUI you see (under scanner output): "connection lost"
4) no reports are written and in the log file you only see:

webui started
scheduler instance dispatched localhost:47035
scheduler instance_owner_assigned
scheduler scan started
webui zombie_cleanup

Missing is the normal:

report saved.

A quick fix is to increase the timing of the zombie scanning process (line 540 in server.rb), but this is no real solution and only minimizes the possibility that the race condition occurs.

I have tried to investigate where the issue comes from, but cannot trace the origin. Might have something to do with the way Cygwin handles forks and threads but I have to delve deeper. Other possibility is that the check in line 624 of server.rb might be wrong: if the framework in reality is 'busy', but there was a RPC exception, will 'busy' be set automatically to false? Haven't had the time to really investigate this.