Prevent crash on wake (Ticket#96101255) - #10290
Merged
Merged
Conversation
The tray window loads avatars and file previews over the network. When the Mac wakes from sleep, the client resets the account's network manager, which threw away the in-flight image download. The image-loading thread then tried to read that already-deleted download and crashed. Keep the network manager alive until the image request finishes, and clean up the download afterwards, so nothing is read after it's gone. Fixes the SIGSEGV in AsyncImageResponse::processNetworkReply reported on 33.0.7 (crash ~5s after wake from sleep). Signed-off-by: Iva Horn <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
|
/backport to stable-34.0 |
Collaborator
Author
|
/backport to stable-33.0 |
Collaborator
Author
|
/backport to stable-4.0 |
Contributor
|
Artifact containing the AppImage: nextcloud-appimage-pr-10290.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
i2h3
enabled auto-merge
July 2, 2026 14:56
i2h3
disabled auto-merge
July 2, 2026 14:56
This was referenced Jul 2, 2026
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.




What
Fixes a crash in the desktop client that could happen right after the computer wakes from sleep.
Why it crashed
The tray window shows avatars and file previews that are downloaded from the server. On wake, the client rebuilds its network connection and throws away any download that was still in progress. But a background thread was still holding on to that download and tried to read it - after it had already been deleted. Reading deleted memory = crash.
The fix
AsyncImageResponsenow keeps the account's network manager alive for the full duration of the image request (using the shared pointer the code already provides for exactly this), so the download can't be deleted out from under the thread that's reading it. It also explicitly cleans up the download when done, which additionally fixes a small leak.One file changed:
src/gui/tray/asyncimageresponse.cpp(~9 lines).Checklist
AI (if applicable)