-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
cxfreeze executable stuck on infinite loop on Ubuntu18.04 #501
Comments
This program runs in python? |
No answer. If necessary, reopen. |
Hello, I am currently having the same problem, if someone has found the solution in the meantime, it would help me a lot! |
This is a bug of multiprocessing (see multiprocessing freeze_support needed outside win32 #76327). On systems other than Windows, multiprocessing's freeze_support function does not really work. In these frozen executables, those spawn subprocesses, forkserver processes, and resource tracker processes will judge themselves as the main process, causing an infinite loop. This problem has been postponed for many years and has not been fixed yet. PyInstaller has made a hook for this bug (see pyi_rth_multiprocessing.py), so you can use PyInstaller to build multiprocessing programs, and run them correctly. However, cx_Freeze won't do anything about this, so you won't be able to run your multiprocessing programs correctly on linux and macos through cx_Freeze. I planned to fix this problem for multiprocessing these days, but it may not be done so quickly. At present, you can simply use PyInstaller to pack your multiprocessing program, it should work. |
Maybe cx_Freeze should add a hook for this too, as the bug will still be there for a long time... Because cx_Freeze does not support single file mode, our hook only needs to patch |
I use multiprocessing in Linux. I doesnot use with numpy, sklearn, but with Flask. I used: As cx_Freeze can generate multiple executables, I use Process to start the child process. For the other side, the open issue #588, using a "spawn" can be replicated, but it may be converted to use this method. |
You can test the patch in the latest development build: I tested the PR in Ubuntu 20.04 Python 3.10.6 but I expect that it should work from Python 3.8 to 3.12. |
@zetaloop I based myself on issue #264 to make the patch, but today I came across your patch python/cpython#104607 directly in CPython. I had thought that you would make a patch for cx_Freeze, but as you didn't, I did. Anyway, I think CPython is the correct, definitive way. |
Release 6.15.4 is out! |
As per title, im running on ubuntu 18.04(virtualbox) and Python 3.6 and im working in a venv. When I run the executable, it goes into an infinite loop asking for my input and when i try to break the loop, it shows me the same error forever resulting in me having to force close the terminal.
My code is rather simple as you can see below. I encounter the same issue while using pyinstaller but I found when using freeze_support it stops the infinite looping but it doesnt work for cx_freeze. im stumped at this point...
and heres my setup.py if it helps.
I appreciate any help I can get.
The text was updated successfully, but these errors were encountered: