-
Notifications
You must be signed in to change notification settings - Fork 423
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
Sample code for bbot as a module doesn't work in pool or without start_method
of fork
#1785
Comments
start_method
of fork
Update, here's some minimal reproductions:
Infinite recursion issue:
|
@GhostDog98 thanks for the detailed report. This is a known quirk, and exists because BBOT inherently does a heavy amount of parallelization, including spawning its own process pool. Running BBOT in a pool is highly discouraged, as there are better ways to parallelize it, such as turning up the number of threads for the dns engine, modules, etc. Also, since BBOT has global state, running multiple BBOT scans within the same python environment is not recommended. However, if you really want to do it, you might be able to get it to work by checking the name of the process. This is how BBOT handles it internally: import multiprocessing
current_process = multiprocessing.current_process()
if current_process.name == "MainProcess":
# do stuff |
Awesome, thank you very much. Unfortunately the use-case for our program requires additional parallelization of bbot together with other tools. I will report back if this works. Another possibility could be running it through docker, and I'll experiment with this too 👍 |
We now have a dedicated issue for fixing this bug: |
Describe the bug
If we run the sample code provided in the advanced usage page:
In python, we get the correct output.
However, if we are running inside of python, in a Pool (even a pool of 1 item, and you have to use the
fork
start method or it does not work!), this causes an infinite loop and error whenever you callscan.start()
The fork issue means you need to do:
mp.set_start_method("fork", force=True)
at the start of files, if:__main__
test case.Producing this error:
Expected behavior
BBot should run without issue under a multiprocessing pool with default settings.
BBOT Command
See above
OS, BBOT Installation Method + Version
OS: Kali linux on WSL
BBOT Version: 2.0.1
Python version: 3.11.8
Install method:
pip install bbot==2.0.1
The text was updated successfully, but these errors were encountered: