https://bugs.kde.org/show_bug.cgi?id=526302

--- Comment #3 from Ryan Li <[email protected]> ---
### Key Loaded Modules (Partial)

| Module | Version |
|------|------|
| libQt6Core.so.6 | 6.10.2 |
| libQt6Gui.so.6 | 6.10.2 |
| libQt6WaylandClient.so.6 | 6.10.2 |
| libQt6XcbQpa.so.6 | 6.10.2 |
| libkCrash.so.6 | 6.6.6 |
| libKF6Crash.so.6 | 6.22.0 |
| libxcb.so.1 | 1.17.0 |
| libwayland-client.so.0 | 1.23.1 |

(The full module list contains over 90 entries; see the attached raw crash log
for details.)

## Root Cause Analysis

### 1. Session Lifecycle Conflict

During logout, `ksmserver` begins terminating all client processes and
releasing display server resources. drkonqi, KDE’s crash reporting tool,
attempts to launch and create a GUI window after detecting the Firefox crash.
However, by that point the X11/Wayland connection has already been closed by
the session manager, preventing Qt from creating an event dispatcher.

### 2. Qt6 Fatal Error Handling

When `QGuiApplicationPrivate::createEventDispatcher()` cannot initialize the
platform plugin, it calls `QMessageLogger::fatal()`, which in turn triggers
`abort()`. This is Qt’s expected behavior, but it is an inappropriate
crash-handling strategy in the context of session logout—drkonqi should degrade
gracefully rather than self-terminate.

### 3. Cascading Failure of the Logout Button

After the initial logout flow is interrupted by the drkonqi crash, `ksmserver`
may remain stuck in an intermediate “logging out” state, leaving the IPC
channel deadlocked and preventing subsequent logout requests from being
processed. Since `plasmashell` communicates with ksmserver via D-Bus to trigger
logout, the logout button becomes unresponsive (“click has no effect”) when
ksmserver fails to reply.

## Suggested Fix Directions

### Upstream (KDE / drkonqi)

1. **Session state detection:** On startup, drkonqi should check whether a
session logout or shutdown is in progress (e.g., by listening to D-Bus signals
from `org.kde.ksmserver`). If so, it should skip the GUI dialog and only write
crash information to the log.
2. **Graceful degradation:** When it cannot create a GUI event dispatcher,
drkonqi should fall back to a non-interactive mode (such as writing to syslog
or the coredump directory) instead of calling `abort()`.
3. **Timeout protection:** Implement timeouts for drkonqi’s startup and window
creation so that it exits automatically without blocking the session manager if
these operations take too long.

### Downstream (Kubuntu / KDE Plasma)

1. **ksmserver fault tolerance:** Capture child-process crashes during the
logout sequence to ensure that logout can complete even if drkonqi exits
abnormally.
2. **Logout button state reset:** When a logout flow is abnormally interrupted,
plasmashell should detect that ksmserver is in an inconsistent state and reset
the logout button’s availability.
3. **Disable crash dialogs during logout by default:** In Ubuntu/Kubuntu
packaging, consider configuring drkonqi to automatically suppress pop-up
dialogs when it detects that the session is terminating.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to