Skip to content

fix(file-provider): Prevent concurrent write crash in XPC utils - #10665

Merged
Rello merged 4 commits into
masterfrom
work/launch-crash-fp
Aug 26, 2026
Merged

fix(file-provider): Prevent concurrent write crash in XPC utils#10665
Rello merged 4 commits into
masterfrom
work/launch-crash-fp

Conversation

@claucambra

Copy link
Copy Markdown
Collaborator

Summary

On launch, it is possible for concurrent accesses to be made to some of the internal members of FileProviderXPCUtils, triggering a crash:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000181f8abf0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x0000000181a1691c objc_exception_throw + 88
	2   CoreFoundation                      0x0000000181ea2ec8 -[__NSPlaceholderArray initWithObjects:count:] + 640
	3   CoreFoundation                      0x0000000181ec6310 -[NSArray initWithArray:range:copyItems:] + 364
	4   Nextcloud                           0x0000000102c664e4 _ZN3OCC3Mac20FileProviderXPCUtils23getFileProviderServicesEP7NSArrayIP21NSFileProviderManagerE + 332
	5   Nextcloud                           0x0000000102c60e10 _ZN3OCC3Mac15FileProviderXPC28connectToFileProviderDomainsEv + 236
	6   Nextcloud                           0x0000000102c45a6c _ZN3OCC3Mac12FileProvider12configureXPCEv + 344
	7   Nextcloud                           0x0000000102c5b954 _ZNK3OCC3Mac30FileProviderSettingsController16operationMessageEv + 164
	8   Nextcloud                           0x0000000102c55f94 _ZN3OCC3Mac30FileProviderSettingsControllerC2EP7QObject + 92
	9   Nextcloud                           0x0000000102c55ef0 _ZN3OCC3Mac30FileProviderSettingsController8instanceEv + 80
	10  Nextcloud                           0x0000000102a0af24 _ZN3OCC11ApplicationC2ERiPPc + 7088
	11  Nextcloud                           0x0000000102979d44 main + 160
	12  dyld                                0x0000000181aa3da4 start + 6992
)
libc++abi: terminating due to uncaught exception of type NSException

This PR synchronises writes to these data structures

Checklist

AI (if applicable)

@claucambra claucambra added this to the 34.0.3 milestone Aug 25, 2026
@claucambra claucambra self-assigned this Aug 25, 2026
@claucambra claucambra added os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Aug 25, 2026
@claucambra

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.0 please

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
… in FileProviderXPC utils

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@mgallien
mgallien force-pushed the work/launch-crash-fp branch from 98419be to 402dfa4 Compare August 25, 2026 14:41
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

Digest: sha256:347d9b57bbf9d3e0a8e56cd4b0183dcd67a4ffe13045e0d2190a5a537dc3d688

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

Copy link
Copy Markdown

Comment thread test/macOS/testfileproviderxpcutils.cpp Outdated
{
Q_OBJECT

private slots:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private slots:
private Q_SLOTS:

due to test error

@Rello
Rello merged commit 20219b9 into master Aug 26, 2026
24 checks passed
@Rello
Rello deleted the work/launch-crash-fp branch August 26, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants