Fix crash on invalid geometry from NVIDIA multi-monitor setups#494
Open
appositeit wants to merge 2 commits intolinuxmint:masterfrom
Open
Fix crash on invalid geometry from NVIDIA multi-monitor setups#494appositeit wants to merge 2 commits intolinuxmint:masterfrom
appositeit wants to merge 2 commits intolinuxmint:masterfrom
Conversation
NVIDIA multi-monitor setups can report invalid intermediate geometries (e.g. 8x8) during mode switches. The C library stores this invalid state even when the change signal is suppressed, and the Python stage has no validation before using geometry values. Add geometry validation with rollback and deferred re-check in the C library (cs-screen-x11.c), and minimum dimension checks in the Python stage before refreshing monitor views.
Unhandled exceptions produce empty error messages and leave orphaned cinnamon-screensaver-pam-helper processes (~12MB each). Add sys.excepthook for proper traceback logging, atexit handler to kill child PAM helpers, and SIGTERM handler for graceful cleanup.
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.
Problem
NVIDIA multi-monitor setups can report invalid intermediate geometries (e.g. 8x8 pixels) during mode switches and DPMS wake. This causes:
cinnamon-screensaver-pam-helperprocesses (~12MB each) are reparented to PID 1 and accumulate over timeSolution
Commit 1: Validate geometry during monitor change events
cs-screen-x11.c): Addhas_valid_monitor_dimensions()check with rollback to previous valid state and a 500ms deferred re-check when invalid geometry is detectedstage.py): AddMIN_MONITOR_DIMENSION(64px) checks before refreshing monitor views, with deferred re-check on invalid geometryon_monitors_changedandon_screen_size_changedhandlers are guarded in both C and Python layersCommit 2: Add exception handler and PAM helper cleanup on exit
sys.excepthookfor proper traceback logging on unhandled exceptionsatexithandler to kill child PAM helper processesSIGTERMhandler for graceful cleanupTesting
Tested on a single machine:
Previously this configuration would crash the screensaver during DPMS wake events. With these guards, invalid geometry is detected and deferred until the driver settles.
This has only been tested on one machine and has not been widely tested.
Disclosure
These patches were developed with AI assistance (Claude Code). The changes have been manually reviewed.
Related issues