Skip to content

io/socket: don't touch a socket deleted by an error handler - #1345

Open
Lifferado wants to merge 1 commit into
quickshell-mirror:masterfrom
Lifferado:io-socket-error-null-check
Open

Lifferado wants to merge 1 commit into
quickshell-mirror:masterfrom
Lifferado:io-socket-error-null-check

Conversation

@Lifferado

Copy link
Copy Markdown

onSocketError emits error() before cleaning up. If a handler responds by setting connected = false, disconnectFromServer() emits disconnected() synchronously and onSocketDisconnected() deletes the socket and nulls the pointer. onSocketError then sees !connected and calls deleteLater() on nullptr, which segfaults.

This happens whenever the peer of a QML Socket with onError: connected = false goes away, e.g. restarting the daemon on the other end.

Describe your changes

Details and descisions

Open concerns

Participation

onSocketError emits error() before cleaning up. If a handler responds by
setting connected = false, disconnectFromServer() emits disconnected()
synchronously and onSocketDisconnected() deletes the socket and nulls the
pointer. onSocketError then sees !connected and calls deleteLater() on
nullptr, which segfaults.

This happens whenever the peer of a QML Socket with
`onError: connected = false` goes away, e.g. restarting the daemon on the
other end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant