Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkgbuilds/quickshell/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname=quickshell
pkgver=0.3.2.r7.g2b4501a
pkgrel=11
pkgrel=12
pkgdesc='Flexible toolkit for making desktop shells with QtQuick'
arch=(x86_64 aarch64)
url='https://github.com/quickshell-mirror/quickshell'
Expand Down Expand Up @@ -43,14 +43,19 @@ _commit=2b4501a282689792b62e94f3fb30d8f512324fe6
_archive="$pkgname"
source=("$_archive::git+$url.git#commit=$_commit"
load_qtquick_611.patch
socket-error-null.patch
quickshell-check.hook)
sha256sums=('SKIP'
'23b65d205d825f11a1cd8501acbc6e50250d09a6ce607e2ff8b3cf5d438bd0ce'
'6000e92f7a0d8145f3bfcc03b1d00f0d42f637ca9b927263e071bb301683e50b'
'8543e21aeaaa5441b73a679160e7601a957f16c433e8d6bd9257e80bd0e94083')

prepare() {
cd "$_archive"
patch -Np1 --fuzz=0 -i "$srcdir/load_qtquick_611.patch"
# Backport quickshell-mirror/quickshell#1345 at 0c3d4d50dd8849f8ccef2170bf81758ab0807b0e.
# Remove once the pinned upstream source includes the error-handler null guard.
patch -Np1 --fuzz=0 -i "$srcdir/socket-error-null.patch"
}

build() {
Expand Down
33 changes: 33 additions & 0 deletions pkgbuilds/quickshell/socket-error-null.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0c3d4d50dd8849f8ccef2170bf81758ab0807b0e Mon Sep 17 00:00:00 2001
From: Marius Lifvergren <192463151+Lifferado@users.noreply.github.com>
Date: Mon, 19 Oct 2026 21:41:03 +0200
Subject: [PATCH] io/socket: don't touch a socket deleted by an error handler

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>
---
src/io/socket.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/io/socket.cpp b/src/io/socket.cpp
index d790e7b51..c2dfba402 100644
--- a/src/io/socket.cpp
+++ b/src/io/socket.cpp
@@ -74,7 +74,7 @@ void Socket::onSocketError(QLocalSocket::LocalSocketError error) {
qCWarning(logSocket) << "Socket error for" << this << error;
emit this->error(error);

- if (!this->connected) {
+ if (!this->connected && this->socket != nullptr) {
QObject::disconnect(this->socket, nullptr, this, nullptr);
this->socket->deleteLater();
this->socket = nullptr;
Loading