Skip to content

After crash, new instance fails PAM conversation immediately → screen never sleeps #498

Description

@PeerGit72

Bug: After crash, new instance fails PAM conversation immediately on each activation → screen never sleeps

Summary

When cinnamon-screensaver crashes (Python exception), the automatically restarted instance enters a broken state: it activates every 5 minutes (per idle-delay), but immediately fails PAM authentication without waiting for user input. This causes the screen to never go to sleep and the blurred lock screen wallpaper to persist on the desktop background.

Environment

  • OS: Linux Mint 22.3 Zena
  • Kernel: 6.8.0-106-generic
  • cinnamon-screensaver: 6.6.1+zena (installed), 6.0.3-1build2 (available)
  • Theme: Mint-Y-Dark-Aqua (no .csstage in theme CSS — note: no installed theme provides .csstage)
  • Display: 2560×1440 @ 120 Hz via USB-C / DisplayPort Alt Mode (DP-1)

Steps to reproduce

  1. Run cinnamon-screensaver normally during a desktop session
  2. Wait for the screensaver to crash (Python exception, see below)
  3. The screensaver auto-restarts
  4. Wait for idle-delay (5 minutes)
  5. Observe: screensaver activates but immediately fails PAM auth without showing the unlock dialog

Observed behavior

After the crash-restart, every ~5 minutes in the journal:

cinnamon-screensaver-pam-helper[XXXX]: pam_unix(cinnamon-screensaver:auth): conversation failed
cinnamon-screensaver-pam-helper[XXXX]: pam_unix(cinnamon-screensaver:auth): auth could not identify password for [peer]

The resolution briefly switches (2560×1440 → 1920×1080 → 2560×1440) indicating the screensaver activates and immediately deactivates. The display never enters DPMS standby. Hundreds of orphaned cinnamon-screensaver-pam-helper zombie processes accumulate.

The blurred lock screen wallpaper remains visible on the desktop background after each failed lock cycle.

The crash itself – full traceback

Captured via a logging wrapper. The real exception was hidden because sys.excepthook itself failed to write the traceback (likely a closed/broken stderr in the D-Bus-activated process). With file-based logging, the actual exception is:

Traceback (most recent call last):
  File "/usr/share/cinnamon-screensaver/cinnamon-screensaver-main.py", line 20, in <module>
    from service import ScreensaverService
  File "/usr/share/cinnamon-screensaver/service.py", line 9, in <module>
    from manager import ScreensaverManager
  File "/usr/share/cinnamon-screensaver/manager.py", line 14, in <module>
    from stage import Stage
  File "/usr/share/cinnamon-screensaver/stage.py", line 11, in <module>
    import singletons
  File "/usr/share/cinnamon-screensaver/singletons.py", line 29, in <module>
    CinnamonClient = _CinnamonClient()
  File "/usr/share/cinnamon-screensaver/dbusdepot/cinnamonClient.py", line 34, in __init__
    CScreensaver.CinnamonProxy,
  File "/usr/lib/python3/dist-packages/gi/module.py", line 177, in __getattr__
    interfaces = tuple(interface for interface in get_interfaces_for_object(info)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 99, in get_interfaces_for_object
    interfaces.append(getattr(module, name))
  File "/usr/lib/python3/dist-packages/gi/module.py", line 217, in __getattr__
    wrapper = metaclass(name, bases, dict_)
  File "/usr/lib/python3/dist-packages/gi/types.py", line 247, in __init__
    register_interface_info(cls.__info__.get_g_type())
TypeError: must be an interface

Root cause: When Python-GI creates the wrapper class for CScreensaver.CinnamonProxy, it iterates over the interfaces implemented by that type. One of those interfaces (CinnamonIface) has a GType that is not registered as a G_TYPE_INTERFACE in the runtime library (libcscreensaver.so), causing register_interface_info() to fail.

Behavior: The crash is intermittent. On a D-Bus retry 30 seconds later, the screensaver often starts successfully. This suggests a timing/initialization race in the GLib type system.

Secondary issue: After the crash, the new screensaver instance enters a broken PAM state (see "Observed behavior" above). The two bugs are linked.

Every session at screensaver start:

org.cinnamon.ScreenSaver[XXXX]: Cinnamon Screensaver support not found in current theme - adding some...

Note: no installed theme (Mint-L, Mint-Y, Adwaita, etc.) provides .csstage in its CSS, so this fallback path is always taken.

Frequency

Observed across multiple boots on the same machine. Happens within the first few hours of a session, not reproducible on demand.

Impact

  • Monitor runs all night instead of sleeping
  • Blurred wallpaper persists on desktop
  • ~150+ orphaned pam-helper zombie processes after a full night

Suggested fixes

  1. PAM conversation state: After a crash-restart, the PAM client state is broken. The new instance should not attempt authentication without user input. Investigate whether the AuthClient or its D-Bus connection is in a stale state after restart.

  2. Zombie pam-helper cleanup: On screensaver startup, orphaned cinnamon-screensaver-pam-helper processes from a previous instance should be killed.

  3. Exception visibility: sys.excepthook silently fails for some exception types. A try/except wrapper around the excepthook (or writing exceptions to a dedicated log file) would make crashes debuggable.

Workaround

Kill all screensaver and pam-helper processes — the screensaver auto-restarts clean via D-Bus on next activation:

pkill -f "cinnamon-screensaver-pam-helper"
pkill -f "cinnamon-screensaver"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions