Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit ecebfff

Browse files
committed
Replace the timeout process kill with a terminate.
The kill operation is never a good choice for stopping a subprocess - it does not give the subprocess any chance to clean up. It's more usual to try a terminate and later kill if the process did not stop. More importantly to me, the kill method isn't present in the python 2 multiprocessing module.
1 parent beb0ce3 commit ecebfff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎pythonfuzz/fuzzer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def start(self):
158158
buf = self._corpus.generate_input()
159159
parent_conn.send_bytes(bytes(buf))
160160
if not parent_conn.poll(self._timeout):
161-
self._p.kill()
161+
self._p.terminate()
162162
logging.info("=================================================================")
163163
logging.info("timeout reached. testcase took: {}".format(self._timeout))
164164
self.write_sample(buf, prefix='timeout-')

0 commit comments

Comments
 (0)