You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple and valid multiprocessing example for python fork bombs when run under pyo3.
You'll forgive me if I didn't try to run this example again to check that it properly executes. I don't want to get self-bombed again. But the basic idea seems to hold. It happened to me twice already. If this example doesn't work, you can still place it in a file and run that file from pyo3 (that's how I did it)
(This also happens even with freeze_support())
(auto-initialize feature is checked)
use pyo3::prelude::*;fnmain() -> PyResult<()>{let code = r#"import multiprocessingimport timedef worker(): print("Starting worker") time.sleep(5) print("Worker finished")if __name__ == "__main__": processes = [] for _ in range(5): p = multiprocessing.Process(target=worker) p.start() processes.append(p) for p in processes: p.join()"#;Python::with_gil(|py| Python::run_bound(py, code,None,None))}
Steps to Reproduce
Run code using python command in terminal
No problem. Works great like it should.
Run code in pyo3
Anguish in horror as your system gets fork bombed
Backtrace
No response
Your operating system and version
Windows 11 10.0.22631 Build 22631
Your Python version (python --version)
Python 3.12.2
Your Rust version (rustc --version)
rustc 1.78.0 (9b00956e5 2024-04-29)
Your PyO3 version
0.21.2
How did you install python? Did you use a virtualenv?
From website using installer
Additional Info
No response
The text was updated successfully, but these errors were encountered:
Bug Description
A simple and valid multiprocessing example for python fork bombs when run under pyo3.
You'll forgive me if I didn't try to run this example again to check that it properly executes. I don't want to get self-bombed again. But the basic idea seems to hold. It happened to me twice already. If this example doesn't work, you can still place it in a file and run that file from pyo3 (that's how I did it)
(This also happens even with
freeze_support()
)(
auto-initialize
feature is checked)Steps to Reproduce
python
command in terminalBacktrace
No response
Your operating system and version
Windows 11 10.0.22631 Build 22631
Your Python version (
python --version
)Python 3.12.2
Your Rust version (
rustc --version
)rustc 1.78.0 (9b00956e5 2024-04-29)
Your PyO3 version
0.21.2
How did you install python? Did you use a virtualenv?
From website using installer
Additional Info
No response
The text was updated successfully, but these errors were encountered: