Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: macOS Nextcloud Finder extension is still crashing regularly, causing right-click menu to stop working #4459

Closed
4 of 8 tasks
briankendall opened this issue Apr 26, 2022 · 13 comments · Fixed by #4643
Closed
4 of 8 tasks

Comments

@briankendall
Copy link
Contributor

briankendall commented Apr 26, 2022

⚠️ Before submitting, please verify the following: ⚠️

Bug description

This is a follow up to #4277

I am running Nextcloud Desktop 3.5.0 RC3 as it contains changes to how it handles its Finder integration in macOS, which I had hoped fixed #4277. However, it has not:

On a regular basis, sometimes multiple times per day, Nextcloud's Finder extension will crash, causing the right-click menu to stop working. In order to get Finder integration working again, I need to restart Nextcloud.

Fortunately and unlike previous crashes with version 3.4.x, when this occurs, a dialog box will appear informing that the extension has crashed, allowing me to get at a crash report.

Among the crash reports, there are two unique stack traces. I have attached four recent crash logs, two for each unique crash, to this report.

Crashes: Nextcloud_Desktop_3.5.0RC3_FinderSyncExt_crashes.zip

Steps to reproduce

Unfortunately I have found no consistent way to trigger this crash, but will update if I find one.

Expected behavior

Obviously the Finder extension should not crash.

Which files are affected by this bug

N/A

Operating system

Mac OS

Which version of the operating system you are running.

macOS 10.14.6

Package

Other

Nextcloud Server version

22.2.3

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 3.3.6 to 3.4.0)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

  • Default internal user-backend
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Nextcloud Server logs

N/A

Additional info

No response

@briankendall
Copy link
Contributor Author

Quick update: just got another crash that happened while Nextcloud was idle and in the background. There was a little bit of activity in my synced folder, with a single file being updated once a minute. Other than that, I wasn't interacting with the app at all, nor using the Finder. Crash log attached
FinderSyncExt_2022-04-26-162421_Qqqqqqq.crash.txt
.

@EmmanuelLazard
Copy link

I'm having exactly the same bug since I upgraded to 3.5.0. Running on MacOS 10.13

@scheffle
Copy link

scheffle commented May 8, 2022

I've the same issue on an Intel mac while on an Apple Silicon mac it does not crash. (Both run macOS 12.3.1 connecting to the same server). This is new with version 3.5.
FinderSyncExt-2022-05-08-132140.ips.zip

@scheffle
Copy link

scheffle commented May 8, 2022

After looking at the crashlog and the source code of the crash it is obvious that the crash happens because the macOS API dispatch_source_cancel should not be called with a nullptr. (See https://developer.apple.com/documentation/dispatch/1385604-dispatch_source_cancel) which the source code does according to the callstack. So guarding the calls to dispatch_source_cancel should fix the crash.

@fiveangle
Copy link

fiveangle commented May 10, 2022

Came here to report same random crashes:

  • macOS 11.6.5
  • MacBookPro11,3 (AMD64)
  • NC 3.5.0

Issue began immediately after upgrade to 3.5.0.

Can trigger the same crash at will with following procedure:

  1. Launch 3.5.0
  2. Select "Exit" from NC menubar widget
  3. Bombs away…
[click here for crash summary details]

Process: FinderSyncExt [98495]
Path: /Applications/Nextcloud.app/Contents/PlugIns/FinderSyncExt.appex/Contents/MacOS/FinderSyncExt
Identifier: com.nextcloud.desktopclient.FinderSyncExt
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: FinderSyncExt [98495]
User ID: 504

Date/Time: 2022-05-10 12:41:34.044 -0700
OS Version: macOS 11.6.5 (20G527)
Report Version: 12
Anonymous UUID: AFFE86A5-86EC-526B-638D-922D056ABE00

Sleep/Wake UUID: D8123D1F-226F-4050-9EB1-AA0F053E7600

Time Awake Since Boot: 180000 seconds
Time Since Wake: 88000 seconds

System Integrity Protection: enabled

Crashed Thread: 2 Dispatch queue: localSocketQueue

Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [98495]

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: Release of a suspended object

@claucambra
Copy link
Collaborator

claucambra commented May 12, 2022

After looking at the crashlog and the source code of the crash it is obvious that the crash happens because the macOS API dispatch_source_cancel should not be called with a nullptr. (See https://developer.apple.com/documentation/dispatch/1385604-dispatch_source_cancel) which the source code does according to the callstack. So guarding the calls to dispatch_source_cancel should fix the crash.

Hey all,

I have been unable to reproduce the issue on my machine but looking at the stack traces it seems @scheffle is most likely right. I've opened #4520 which ensures that dispatch_source_cancel is only called on the dispatch sources when they are valid.

Thanks @scheffle for highlighting the core of the issue and thanks all for your reports, I hope we can release the next bugfix release of the client to you all soon :)

@briankendall
Copy link
Contributor Author

I'm afraid this crash isn't quite fixed yet. I'm still getting regular crashes in v3.5.1 (specifically 3.5.1git build 10326). I have several crash logs, though they all have the same stack trace so I'm attaching just the latest one. Can we reopen this issue?

FinderSyncExt_2022-06-03-093813_Qqqqqqq.crash.txt

@claucambra
Copy link
Collaborator

Looks like we are deallocating the dispatch source before dispatch_source_cancel is done. This PR should fix it, thanks for your logs @briankendall

@p-sims
Copy link

p-sims commented Aug 3, 2022

Hello, I'm not sure whether I should be raising this in a new thread or here, but I'm now running v3.5.3 and I'm still getting what I assume is finder extension issue, where the right click menu disappears. If I restart nextcloud client it comes back for a bit, but then are either hours or days it will disappear again. I can raise as a separate thread if helpful.
Screenshot 2022-08-03 at 09 33 49

When right click menu disappears the nextcloud icons next to files and folders also seem to get stuck in slightly odd place (with nextcloud icons as a tick saying all synced).
Screenshot 2022-07-18 at 17 18 36

@briankendall
Copy link
Contributor Author

I'm getting the same issue too, but with v3.5.4. The right-click context menu just stops working until I restart Nextcloud. I'll note that I've been having this issue with Nextcloud for as long as I've been using it (so a few years now), and alas it doesn't seem to be fixed even after the Finder extension was revamped.

There are no crashlogs I can send this time.

@gibelium
Copy link

Still an issue with v3.14.3 and it's not just annoying but breaks the sync mechanism. After the error occurs the Nextcloud Desktop Client is no longer able to sync files that have been changed. I have to close and restart the app before changes are synced again.

This should be fixed urgently..!!

@claucambra
Copy link
Collaborator

Still an issue with v3.14.3 and it's not just annoying but breaks the sync mechanism. After the error occurs the Nextcloud Desktop Client is no longer able to sync files that have been changed. I have to close and restart the app before changes are synced again.

This should be fixed urgently..!!

Finder extensions have absolutely no effect on sync so you must be encountering some other issue, I'd recommend you check other open issues to see if your problem has anything in common with them

@gibelium
Copy link

Finder extensions have absolutely no effect on sync so you must be encountering some other issue, I'd recommend you check other open issues to see if your problem has anything in common with them

Thank you for the clarification. I'll continue my search then...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment