Skip to content

hyprland/ipc: use deleteLater for request socket - #1538

Open
LordMikkel wants to merge 1 commit into
quickshell-mirror:masterfrom
LordMikkel:hyprland-ipc-deletelater-socket
Open

LordMikkel wants to merge 1 commit into
quickshell-mirror:masterfrom
LordMikkel:hyprland-ipc-deletelater-socket

Conversation

@LordMikkel

Copy link
Copy Markdown

Describe your changes

Quickshell crashed in my session, and again after a restart. From the logs and
strace I could see that the crash was related to makeRequest(). The request
socket is deleted inside its own readyRead handler, but I think Qt still
touches the object after the handler returns, which is what crashes. So it
looks like a use-after-free.

Now it disconnects the socket first and calls deleteLater(), so Qt frees it
when it's done with it.

Details and descisions

I got the idea because I saw that errorCallback in the same function already
does it this way.

You can get the crash with a shell.qml that only has import Quickshell.Hyprland.

Before: crashed 3 of 3 times, within 1 s of startup.
After: started fine 3 of 3 times, with plain Hyprland, stock Caelestia, and Caelestia with my own changes.

I installed the patched package and it's been fine since.

Arch, Hyprland 0.57.2 (Lua config), Qt 6.12.0, quickshell 9b0f339.

Open concerns

I don't know why it only started crashing now...

Participation

I want to keep working on this. If you want changes, tell me and I'll do them.

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