-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Type
bug
Severity
medium
Area
nmapui/jobs.py — job cancellation logic
Description
When a scan job is cancelled, the code sends process.terminate() (SIGTERM) but never escalates to process.kill() (SIGKILL) if the process does not exit. Nmap can sometimes ignore SIGTERM (particularly during certain NSE script phases), leaving zombie processes consuming resources.
if process and process.poll() is None:
try:
process.terminate()
except Exception:
logger.exception("...")Proposed Fix
Add a timeout-and-kill escalation:
if process and process.poll() is None:
try:
process.terminate()
try:
process.wait(timeout=5)
except subprocess.TimeoutExpired:
logger.warning("Process %s did not exit after SIGTERM, sending SIGKILL", process.pid)
process.kill()
process.wait(timeout=3)
except Exception:
logger.exception("Failed to terminate process")Related Issues
#195 (Menu bar close must kill all app instances)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working