ospfranco / sol

MacOS launcher & command palette
MIT License
1.92k stars 89 forks source link

Random crash on 1.1.42 #59

Closed foss- closed 1 year ago

foss- commented 1 year ago

Unsure which change introduced this problem but since updating to 1.1.42 I am unable to reliably launch Sol via cmd+space which I selected in the setup wizard.

When I open Sol from spotlight it shows and I can use it. If it then vanishes and I try to invoke it via cmd+space nothing happens.

error   16:04:53.664577+0200    tccd    <TCCDProcess: identifier=com.ospfranco.sol, pid=3928, auid=501, euid=501, binary_path=/Applications/sol.app/Contents/MacOS/sol> attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement
error   16:04:53.891621+0200    sol Connection 1: received failure notification
error   16:04:53.891664+0200    sol Connection 1: failed to connect 1:57, reason -1
error   16:04:53.891686+0200    sol Connection 1: encountered error(1:57)
error   16:04:53.892968+0200    sol Task <X>.<1> HTTP load failed, 0/0 bytes (error code: -1005 [1:57])
error   16:04:53.893520+0200    sol Task <X>.<1> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 UserInfo={_kCFStreamErrorCodeKey=57, NSUnderlyingError=0x6000008a98c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, ipv4, ipv6, dns, _kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=<private>, _NSURLErrorRelatedURLSessionTaskErrorKey=<private>, NSLocalizedDescription=<private>, NSErrorFailingURLStringKey=<private>, NSErrorFailingURLKey=<private>, _kCFStreamErrorDomainKey=1}
error   16:04:53.904968+0200    tccd    <TCCDProcess: identifier=com.ospfranco.sol, pid=3928, auid=501, euid=501, binary_path=/Applications/sol.app/Contents/MacOS/sol> attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement
error   16:04:57.428127+0200    tccd    Prompting policy for hardened runtime; service: kTCCServiceAddressBook requires entitlement com.apple.security.personal-information.addressbook but it is missing for requesting={<TCCDProcess: identifier=com.ospfranco.sol, pid=3928, auid=501, euid=501, binary_path=/Applications/sol.app/Contents/MacOS/sol>},
ospfranco commented 1 year ago

hmm I think I know what it is

ospfranco commented 1 year ago

1.1.44 is out, give it a try and let me know if it works

foss- commented 1 year ago

Thanks for looking into this. 1.1.44 output:

error   16:43:42.480643+0200    sol XPC connection was invalidated
error   16:43:42.712790+0200    runningboardd   RBSStateCapture remove item called for untracked item 189-172-10294 (target:[app<application.com.ospfranco.sol.68169369.68169375(501)>:4286])
error   16:43:42.712832+0200    runningboardd   RBSStateCapture remove item called for untracked item 189-172-10295 (target:[app<application.com.ospfranco.sol.68169369.68169375(501)>:4286])

Still not showing when trying to invoke via keyboard shortcut.

ospfranco commented 1 year ago

Weird but nothing from the logs shows me an error I can act upon, did you try restarting the app (or your computer maybe)?

foss- commented 1 year ago

Restarted the mac. So there is one interesting observation to add:

Then it is not surprising it would open on keyboard shortcut. The question remains, why it would vanish in the first place. Maybe that gives a clue as to what is going on?

ospfranco commented 1 year ago

If it is gone from the monitor it is because it crashed. I will take a look later.

foss- commented 1 year ago

Crashes persisting with 1.1.45.

Crash log (1 month): https://bin.disroot.org/?a05a3ba283304322#8frWd89kZVuHzteiYaCuMhHhKBkAWHX6mRHhecNvJAqA

ospfranco commented 1 year ago

Native crashes with RN are not very useful, I also have error reporting built-in, it would be more useful though if you can find some reproducible steps. Have you given the app all the permissions it asked for? Do you type something specific? Which settings have you enabled? which OS are you running?

foss- commented 1 year ago

macOS 12.5 (as per crash log) Re: built in error reporting, sentry.io is blocked here

Repro steps are here https://github.com/ospfranco/sol/issues/59#issuecomment-1215888599 and for me they are 100 % reproducible.

Permissions:

ospfranco commented 1 year ago

No sorry, I can't seem to be able to reproduce it, and without sentry symbolicating the javascript calls, the crash dump is not useful too me

ospfranco commented 1 year ago

Which shortcut are you using? did you also remove Spotlight before or after binding to Cmd + space?

foss- commented 1 year ago

Unblocked sentry.ui and created three crashes. Spotlight keyboard shortcuts are disabled. Hope the data is helpful in understanding why the crash happens.

ospfranco commented 1 year ago

I can see the crashes but the traces still do not help and I cannot reproduce it. I will release an update with updated dependencies, since it seems to be an issue with RN itself, but otherwise I will have to take longer to try to reproduce it myself.

foss- commented 1 year ago

If you want to debug on my machine, I can reach out. It is 100 % reproducible and rather instant here. Sol opens once (e.g. manually from finder) and then won't open a second time. The crash takes a few more seconds but will reliably happen in less then 10 seconds after the second attempt to open Sol.

Wondering how the recent changes may have caused this crash as I did not see the problem prior to updating to 1.1.42.

ospfranco commented 1 year ago

1.1.42 had some native changes, which are the most likely cause for the issue. I will try to take a look later, but I have a real job to take care of first :P

ospfranco commented 1 year ago

1.1.46 is out, give it a try and let me know

foss- commented 1 year ago

Sadly no change with 1.1.46. If there is any other info I can provide which could help, let me know. The behavior is identical as described above.

ospfranco commented 1 year ago

Unless I can run it attached to a debugger I'm afraid it won't help much, but there is one thing I can try before having to connect to your machine, I'll report back in a bit

ospfranco commented 1 year ago

I've just uploaded the DSYM files to sentry, hopefully now crash dumps should be symbolicated, can you try one more time to crash the app?

foss- commented 1 year ago

Done (3 crashes should be sent)

ospfranco commented 1 year ago

Nothing... there was only one big native change that could be causing issues:

https://github.com/ospfranco/sol/commit/ee35a42191838e57927820bc7823ecd7c5fd0e3e

Do you have any nested folders or extraneous files on your Applications (and ~/Applications) folder?

foss- commented 1 year ago

Yes, one subfolder example was given in the respective feature request: https://github.com/ospfranco/sol/issues/58 There is also an app outside the default application folder.

ospfranco commented 1 year ago

What do you mean outside the application folder? I'm out of ideas at this point, can we jump into a call? reach out at ospfranco@protonmail.com

ospfranco commented 1 year ago

I just released 1.1.48, I've refactored some of the native code to bail-out the moment something is wrong, give it a try and let me know!

foss- commented 1 year ago

Can confirm 1.1.48 fixes the crash. Thanks so much for the quick fix.