Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition bug in sfscan.py and sf.py #1719

Closed
guylando opened this issue Aug 28, 2022 · 1 comment · Fixed by #1818
Closed

Race condition bug in sfscan.py and sf.py #1719

guylando opened this issue Aug 28, 2022 · 1 comment · Fixed by #1818
Labels
investigate Needs further analysis

Comments

@guylando
Copy link

Spiderfoot has a race condition bug that sfscan.py in the end of __startScan first changes status to FINISHED and then does few more things and on the other hand sf.py in the end of start_scan checks every 1 second if status is FINISHED and if it is then exits without waiting for the sfscan.py to complete.

This causes some of sfscan.py logic to be quit before being done such as not printing some of the expected output to stdout.

Therefore to fix this in sf.py before the sys.exit(0) need to wait for the scan process to quit. To fix the problem and also prevent infinite wait you can add "p.join(5)" before "sys.exit(0)" (around line 449 in sf.py).

@bcoles
Copy link
Contributor

bcoles commented Nov 3, 2023

Thanks @guylando. Well spotted.

PR in #1818 is a simple fix by using a timeout of 60 seconds. Unfortunately, the logic for passing scan state needs further review, as correlations on large scans may take longer than 60 seconds to complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Needs further analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants