errno 13 is EACCESS (permission denied); Unfortunately the dtruss output does not show that actual arguments given to posix_spawn. The call seems to originate from :
0x10dea8000 - 0x10deb1ffb +com.cocoatech.PathFinderFoundation (1.0 - 1) <33F604F1-7108-34E9-9653-9AE45DD6996E> /Applications/Path Finder.app/Contents/Frameworks/PathFinderFoundation.framework/Versions/A/PathFinderFoundation
Dragan on 13 Nov, 2019 12:17 PM
First of all, one BIG THANK for helping to solve this issue and not giving up on Path Finder! It's really appreciated.
Just like you, I've isolated what the problem is (executing another binary from within Path Finder), and I was wondering why that happens and what the failing binary is. Hence, the version 9.0.3 (build 2019) sends some additional info in crash reports of this kind. I've already received a couple of those reports and the crash happens when Path Finder tries to discover SMB shares. SMB shares not supporting Apple's "zero configuration" (known as Bonjour) cannot be discovered automatically as they appear, so Path Finder has to periodically poll and (try to) discover them. The discovery is performed by the nmblookup binary tool, bundled inside Path Finder's application bundle. For some reason, sometimes that tool fails to start and throws exception and that crashes Path Finder. The error 13 (EACCESS) is what confuses me, since that tool, being part of the application bundle, should be readable/executable.
Anyway, I'd like to test whether this failure happens every time the tool is started in your case. So, if you're wiling to help me to diagnose this, I can prepare a special version for you. That version won't crash (at least, it shouldn't), but it will inform you with an informational panel every time the SMB discovery succeeded, as well as every time the discovery failed (stating details for the failure). Since by default Path Finder polls for SMB shares every 3 minutes, that means you'll be distracted in your work every 3 minutes !!! But I'd still appreciate it you can run it just for 2 - 3 hours and let me know what is the ratio between successful and failed attempts to discover SMB shares.
I can fix this problem just ignoring SMB discovery failure, but I'd still like to know more about reasons for that happening, so I'd appreciate if you can help me by running this special version, since you seem to be able to reproduce the problem fairly easily.
If you're willing to help me with this, please let me know and I'll prepare that special build for you and let you know how to get it and use it.
Thanks a lot for your patience, time and support, it's really appreciated!
on 14 Nov, 2019 08:56 AM
Thank you for taking the time to investigate this issue, I really appreciate it.
On my side, I customized the dtruss script in order to log the command being spawned. Unfortunately, since I did this, I did not have a crash I can report. Still, I can see that there were a lot of invocations of nmblookup which succeeded :
4656/0x15338: 144975 1491 743 posix_spawn(0x7FC1449907B0, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x700007767950, 0x700007766A78, 0x0, 0x0) = 0 0
4656/0x1611f: 54648 1019 740 posix_spawn(0x7FC1464BB630, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x700007661950, 0x700007660A78, 0x0, 0x0) = 0 0 4656/0x16719: 44020 1026 744 posix_spawn(0x7FC1460C79E0, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x70000734F950, 0x5000, 0x0, 0x0) = 0 0 4656/0x16e08: 2043 1532 791 posix_spawn(0x7FC1443CECB0, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x7000073D2950, 0x0, 0x0, 0x0) = 0 0 4656/0x17011: 1326 1050 759 posix_spawn(0x7FC145B80D10, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x700007455950, 0x0, 0x0, 0x0) = 0 0 4656/0x1723f: 1162 1460 733 posix_spawn(0x7FC144BCD560, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x700007455950, 0x0, 0x0, 0x0) = 0 0 4656/0x17406: 1125 1277 680 posix_spawn(0x7FC144B5D720, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x70000734F950, 0x0, 0x0, 0x0) = 0 0 4656/0x175d2: 4279 1008 703 posix_spawn(0x7FC1443B0CF0, "/Applications/Path Finder.app/Contents/Frameworks/PathFinderNetwork.framework/Versions/A/Helpers/nmblookup\0", 0x7000073D2950, 0x0, 0x0, 0x0) = 0 0
A critical information which you might have missed regarding my case is that the crash only happens when waking up my MacBook Pro from sleep. Once the MBP is up&running and PathFinder is started, I never encounter a crash, and I never found an occurrence of posix_spawn returning EACCESS.
Also, it seems that every time there is a PathFinder crash when waking up the MBP, there is a similar error in syslog, e.g:
Nov 10 09:59:29 malebolge com.apple.xpc.launchd1: Could not spawn trampoline /usr/libexec/xpcproxy: 13: Permission denied
The symptom (EACCESS on spawn) is very similar, and happens roughly at the same moment. I believe this to always be the case when PF crashes, but I don't have enough data to be 100% sure. I haven't been able to tell whether it's causing the PF crash (e.g. PF somehow relying on XPC), or both are different instances with the same root cause.
My theory so far is that the spawn happens at a time when not everything is set up properly in the OS just after the MBP wakes up (e.g. sometimes the login screen on wake up is sluggish until everything is loaded from disk). Might be e.g. the antivirus not being ready to scan executables. I use McAfee and did a major version upgrade since then, but the crashes still happen the same.
The crash now happens for me every 2-3 days when waking up the MBP, and apart from these occasions, nmblookup runs fine. Perhaps you could craft a version which only pops up when nmblookup crashes ?
Dragan on 14 Nov, 2019 01:12 PM
Well, in that case no special build is needed for you. I didn't know you're so technically inclined, that you could monitor nmblookup executions yourself. The sole purpose of that special build should've been to figure out if in your case EVERY execution of nmblookup fails (crashes) and if not, what is the success/failure ratio. But it seems the crash happens under very specific circumstances.
I don't really know whether crashes are related to that /usr/libexec/xpcproxy failure as well. Path Finder doesn't use XPC services to execute nmblookup, it uses NSTask object and I'm not familiar with that object's internal functioning, so those two may be related.
Anyway, with all this info collected from you, I'll finally fix the issue in the following manner; if executing of nmblookup fails, it will NOT crash the application, just an error message will be logged and Path Finder will attempt the execution again after SMB shares poll time interval (default is 3 minutes). Considering that execution failure seems to be happening under very specific and not easily reproducible circumstances, I'm not sure I can completely avoid execution failure, but at least it won't crash the application. In your case it happens immediately after waking up the machine but there may be other factors involved (some of which you mentioned), but other people may have different causes.
Once again, thanks for all the info, the fix will appear in the very next version 9.0.4 in a few days.