fix: kded6 wrapper script — definitive Qt6 Wayland crash prevention

kded6 wrapper (/usr/bin/kded6 → kded6-wrapper.sh → kded6.real):
- Sets QT_QPA_PLATFORM=offscreen before executing real kded6
- Works regardless of launch mechanism (init, D-Bus, direct)
- No dependency on #ifdef Q_OS_REDOX, D-Bus Environment=, or build cache
- kded6 is a headless D-Bus daemon — Wayland adds no functionality

redox.patch: added null guards to wayland-client.c (wl_proxy_add_listener,
wl_proxy_get_version, wl_proxy_get_display) — durable patch for when
libwayland build is fixed.
This commit is contained in:
2026-05-06 16:10:18 +01:00
parent 0a034fa79b
commit 5a8014fe7c
3 changed files with 42 additions and 0 deletions
+28
View File
@@ -37,3 +37,31 @@
#include <sys/file.h>
#include <sys/stat.h>
@@ -649,6 +649,11 @@
wl_proxy_add_listener(struct wl_proxy *proxy,
void (**implementation)(void), void *data)
{
+ if (!proxy) {
+ fprintf(stderr, "FATAL: wl_proxy_add_listener(NULL) caller=%p -- returning error\n",
+ __builtin_return_address(0));
+ return -1;
+ }
if (proxy->flags & WL_PROXY_FLAG_WRAPPER)
wl_abort("Proxy %p is a wrapper\n", proxy);
@@ -2442,6 +2447,7 @@
WL_EXPORT uint32_t
wl_proxy_get_version(struct wl_proxy *proxy)
{
+ if (!proxy) return 0;
return proxy->version;
}
@@ -2560,6 +2566,7 @@
WL_EXPORT struct wl_display *
wl_proxy_get_display(struct wl_proxy *proxy)
{
+ if (!proxy) return NULL;
return proxy->display;
}
+8
View File
@@ -39,6 +39,14 @@ cmake "${COOKBOOK_SOURCE}" \
cmake --build . -j${COOKBOOK_MAKE_JOBS}
DESTDIR="${COOKBOOK_STAGE}" cmake --install . --prefix /usr
# Prevent Qt6 Wayland crash on Redox: wrap kded6 with QT_QPA_PLATFORM=offscreen.
# kded6 is a headless D-Bus daemon — Wayland is unnecessary.
if [ -f "${COOKBOOK_STAGE}/usr/bin/kded6" ]; then
mv "${COOKBOOK_STAGE}/usr/bin/kded6" "${COOKBOOK_STAGE}/usr/bin/kded6.real"
cp "${COOKBOOK_SOURCE}/kded6-wrapper.sh" "${COOKBOOK_STAGE}/usr/bin/kded6"
chmod +x "${COOKBOOK_STAGE}/usr/bin/kded6"
fi
for lib in "${COOKBOOK_STAGE}/usr/lib/"libKF6*.so.*; do
[ -f "${lib}" ] || continue
patchelf --remove-rpath "${lib}" 2>/dev/null || true
@@ -0,0 +1,6 @@
#!/bin/sh
# kded6 wrapper — prevents Qt6 Wayland QPA crash on Redox
# Qt6 Wayland page-faults at null+8 during wl_proxy_add_listener.
# kded6 is a headless D-Bus daemon; Wayland is unnecessary.
export QT_QPA_PLATFORM=offscreen
exec /usr/bin/kded6.real "$@"