Repository navigation
Conversation
main.py called ctypes.windll.kernel32.CreateMutexW unconditionally, which crashes on Linux/macOS with 'AttributeError: module ctypes has no attribute windll' before the UI starts. - Guard all ctypes.windll usage behind sys.platform == 'win32' - Use an fcntl.flock advisory lock for the single-instance guard on POSIX - Add LINUX_FIX.md with the diagnosis and run instructions Verified launching on Kali Linux with Python 3.12 + PySide6 6.11.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Linux and macOS builds crash before the UI appears:
ctypes.windllis a Windows-only attribute.main.pycalls it unconditionallyfor the single-instance guard, so on any non-Windows platform the application
dies during bootstrap.
Reproduction
# Kali Linux / Debian, v1.7.14 AppImage from the releases page chmod +x DrawMotion-x86_64.AppImage ./DrawMotion-x86_64.AppImageFails 100% of the time, immediately, before Qt starts.
Fix
sys.platform == "win32", and use anfcntl.flockadvisory lock on POSIX.ctypes.windll.user32.MessageBoxWin_install_native_crash_handler.ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID.The two
windllcalls inmain.pywere already insidetry/exceptfor thetaskbar call, but the crash handler's
MessageBoxWand the mutex were not.Verification
Tested on Kali Linux (rolling), Python 3.12.16, with the pinned
requirements.txt(PySide6 6.11.1, opencv-contrib-python 5.0.0.93,numpy 2.5.1):
python main.pyreaches the Project Hub with[BOOT_HEALTHY] Startup completed cleanly with zero errors.[MUTEX_BLOCKED] Another instance of DrawMotion_Dev_Mutex is already active.and exits, matching the Windows behaviour.
build-linux.ymlworkflow completes and produces a workingAppImage / .deb / tarball.
Windows behaviour is unchanged — the original code path is preserved under the
platform check.
Notes
LINUX_FIX.mddocuments the diagnosis and how to run from source. Happy toadjust the approach (e.g. use
QLockFileinstead offcntl) if you prefer.