Skip to content

Prevent crash on wake (Ticket#96101255) - #10290

Merged
i2h3 merged 1 commit into
masterfrom
i2h3/fix/96101255-crash
Jul 2, 2026
Merged

Prevent crash on wake (Ticket#96101255)#10290
i2h3 merged 1 commit into
masterfrom
i2h3/fix/96101255-crash

Conversation

@i2h3

@i2h3 i2h3 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

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

AsyncImageResponse now 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)

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]>
@i2h3 i2h3 added this to the 34.0.0 milestone Jul 2, 2026
@i2h3 i2h3 self-assigned this Jul 2, 2026
@i2h3 i2h3 added the bug label Jul 2, 2026
@i2h3 i2h3 added os: 🍎 macOS Apple macOS, formerly also known as OS X feature: ☁️ GUI System tray icon and menu. labels Jul 2, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Jul 2, 2026
@i2h3

i2h3 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.0

@i2h3

i2h3 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-33.0

@i2h3

i2h3 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-4.0

@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-10290.zip

Digest: sha256:0a694484e0de0724941d8662fb39506c01f15aa8a9394828d46476ff384df946

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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4 New Code Smells (required ≤ 0)
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@i2h3
i2h3 enabled auto-merge July 2, 2026 14:56
@i2h3
i2h3 disabled auto-merge July 2, 2026 14:56
@i2h3
i2h3 merged commit 9317ab8 into master Jul 2, 2026
22 of 23 checks passed
@i2h3
i2h3 deleted the i2h3/fix/96101255-crash branch July 2, 2026 14:56
@github-project-automation github-project-automation Bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Jul 2, 2026
@mgallien mgallien modified the milestones: 34.0.0, 35.0.0 Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: ☁️ GUI System tray icon and menu. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants