Aperture adapter fails with EXC_BAD_ACCESS

I am trying to run SampleFTPExportPlugIn which comes with Aperture SDK 2.1 . I had to configure the Base SDK and manually copy the PluginManager.Framework folder to / Library / Frameworks, as described here .

All compilations and Aperture 3.2.3 now offer the menu item File / Export / FTP.

When choosing the "FTP" export method and thus launching the plug-in code, Aperture crashes with EXC_BAD_ACCESS. Illegal memory is accessed in the initWithAPIManager of the SampleFTPExportPlugIn class when trying to get a link to ApertureExportManager :

  _exportManager = [[_apiManager apiForProtocol:@protocol(ApertureExportManager)] retain]; 

This is the second line that starts after Aperture transfers control to the plug-in and appears to be the standard way to get the ApertureExportManager link in any Aperture plug-in (I have not found any alternative ways to achieve the same).

Here's the stacktrace:

 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: 0x000000000000000d, 0x0000000000000000 VM Regions Near 0: --> __TEXT 0000000100000000-0000000100798000 [ 7776K] rx/rwx SM=COW /Applications/Aperture.app/Contents/MacOS/Aperture Application Specific Information: objc_msgSend() selector name: class objc[3000]: garbage collection is OFF Performing @selector(a_exportPlugIn:) from sender NSMenuItem 0x111d2a540 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x00007fff8711c090 objc_msgSend_vtable2 + 16 1 com.apple.CoreFoundation 0x00007fff8381e25f -[__NSCFString isEqualToString:] + 63 2 com.apple.PluginManager 0x0000000101211218 -[PROBundleHandler apiForProtocol:] + 109 3 com.apple.CoreFoundation 0x00007fff83852f4c __invoking___ + 140 4 com.apple.CoreFoundation 0x00007fff83852de4 -[NSInvocation invoke] + 132 5 com.apple.CoreFoundation 0x00007fff83852fb4 -[NSInvocation invokeWithTarget:] + 52 6 com.apple.CoreFoundation 0x00007fff8384dff4 ___forwarding___ + 756 7 com.apple.CoreFoundation 0x00007fff8384dc88 _CF_forwarding_prep_0 + 232 8 com.apple.SampleFTPExportPlugIn 0x000000012c0d5361 -[SampleFTPExportPlugIn initWithAPIManager:] + 209 9 com.apple.PluginManager 0x000000010120c6fa -[PROConcretePlugIn plugInInstance] + 212 

I read all about Objective-C memory management, but can't figure it out. All other examples that I found on the Internet are implemented that way, so I assume that I have a compatibility problem, something is missing in my Aperture / Library installation. How can I narrow the problem?

EDIT:

The problem seems to be related to the passed in apiManager. Method Signature:

  - (id)initWithAPIManager:(id<PROAPIAccessing>)apiManager 

This parameter is then assigned to our internal link:

  _apiManager = apiManager; 

However, the actual class passed is equal to PROPlugInFirewall , as this output is repeated:

  NSLog(@"_apiManager class is: %@", [[_apiManager class] description]); 

Then calling respondsToSelector also fails, although this method is inherited from NSObject.

  if ( [_apiManager respondsToSelector:@selector(apiForProtocol:)] ) { NSLog(@"responds"); } 

_ApiManager itself describes itself as:

  _apiManager is: <[*<PROBundleHandler: 0x14d79130> (PROAPIAccessing)*]> 

Still stuck ...

EDIT:

So it looks like Aperture is passing a pointer pointing to nirvana ... However, I just installed another plugin from the Apple web page, with the installer and everything else. It also did not work out when called ...

+6
source share
2 answers
  • Download FXPlug 1.2.5 SDK
  • Open the contents of the installer package
  • Copy the PluginManager.framework file to / Library / Frameworks

Your plugin should now work!

Newer versions of PluginManager.framework in the FXPlug SDK (2.2 / 2.4) will cause this failure.

Tested on 10.8 with Xcode 4.5

+2
source

I found that the Justin answer above did not work for me when he needed to build Aperture 3.4, because it requires the x86_64 architecture, which versions of FXPlug 1.x do not support.

After using different versions of the PluginManager framework, I found that the version available here does not cause the aforementioned failure and also contains a valid 64-bit architecture. Just replace the contents of /Library/Frameworks/PluginManager.framework/Versions/B with the contents of the linked archive, and you're good to go.

+1
source

Source: https://habr.com/ru/post/914556/


All Articles