I appear to have solved this problem, but it’s disturbing me because it seems 
little more than voodoo.

I changed the embedded frameworks to use @loader_path instead of 
@executable_path, and the problem has gone.

I verified all of the binaries with otool and the internal dylib loading links 
were all correct, including @executable_path. These binaries launch and run 
correctly on my own systems, and for most users. Some users had the exception 
below thrown from XprotectFramework which is part of Gatekeeper. Disabling 
Gatekeeper allowed these users to launch and run the app normally. Changing the 
internal framework links to @loader_path apparently avoids the 
XprotectFramework exception.

As far as I’m aware @executable_path is not deprecated, and though the problem 
seemed more prevalent on 10.10, we also had a report from a 10.9 user.

The evidence seems to be that XprotectFramework has a bug that sometimes causes 
it not to recognise the internal linkage path when it’s set to @executable_path 
(it would not surprise me that the bug was the code contained a typo, since 
whoever wrote that code does not know how to spell ‘executable’). However the 
actuall dylib loader doesn’t have a problem with any of it, it’s just the 
preflight check performed by Gatekeeper that fails.

Does this seem reasonable to anyone else who may be a lot more familiar with 
the dylib loading mechanism than I am?

—Graham







> On 29 Jul 2015, at 10:09 am, Graham Cox <[email protected]> wrote:
> 
> ’m not 100% sure if it’s related, but one user sent this to me which appeared 
> to coincide with the launch failure:
> 
> 
> 7/28/15 4:41:01.467 PM CoreServicesUIAgent[8607]: Error -60005 creating 
> authorization
> 7/28/15 4:41:11.624 PM CoreServicesUIAgent[8607]: An uncaught exception was 
> raised
> 7/28/15 4:41:11.624 PM CoreServicesUIAgent[8607]: *** -[NSFileManager 
> fileSystemRepresentationWithPath:]: nil or empty path argument
> 7/28/15 4:41:11.624 PM CoreServicesUIAgent[8607]: (
>       0   CoreFoundation                      0x00007fff928e303c 
> __exceptionPreprocess + 172
>       1   libobjc.A.dylib                     0x00007fff966e576e 
> objc_exception_throw + 43
>       2   CoreFoundation                      0x00007fff928e2eed 
> +[NSException raise:format:] + 205
>       3   Foundation                          0x00007fff901cf29b 
> -[NSFileManager fileSystemRepresentationWithPath:] + 122
>       4   XprotectFramework                   0x00007fff8d673fbf 
> -[XProtectDylibCheck parseExececutableAndLoaderPaths:] + 329
>       5   XprotectFramework                   0x00007fff8d673cec 
> -[XProtectDylibCheck parseLoadCommands] + 898
>       6   XprotectFramework                   0x00007fff8d67440d 
> -[XProtectDylibCheck parseMacho] + 1050
>       7   XprotectFramework                   0x00007fff8d67763d 
> +[WorkerThreadClass performDylibBundleCheck:] + 602
>       8   XprotectFramework                   0x00007fff8d678b53 
> +[WorkerThreadClass threadEntry:] + 4910
>       9   Foundation                          0x00007fff90202dc2 
> __NSThread__main__ + 1345
>       10  libsystem_pthread.dylib             0x00007fff8e6a9268 
> _pthread_body + 131
>       11  libsystem_pthread.dylib             0x00007fff8e6a91e5 
> _pthread_body + 0
>       12  libsystem_pthread.dylib             0x00007fff8e6a741d thread_start 
> + 13
> )
> 7/28/15 4:41:11.624 PM CoreServicesUIAgent[8607]: *** Terminating app due to 
> uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager 
> fileSystemRepresentationWithPath:]: nil or empty path argument'
> 


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to