Repository navigation
hyprland/ipc: use deleteLater for request socket - #1538
Open
LordMikkel wants to merge 1 commit into
Open
LordMikkel wants to merge 1 commit into
LordMikkel wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 requestsocket 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 itwhen it's done with it.
Details and descisions
I got the idea because I saw that
errorCallbackin the same function alreadydoes 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.