加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – Aperture插件与EXC_BAD_ACCESS崩溃

发布时间:2020-12-14 19:35:00 所属栏目:百科 来源:网络整理
导读:我尝试运行Aperture SDK 2.1附带的SampleFTPExportPlugIn.我必须调整Base SDK设置并手动将PluginManager.Framework文件夹复制到/ Library / Frameworks,如 here所述. 所有编译和Aperture 3.2.3现在提供菜单项File / Export / FTP. 选择“FTP”导出方法并因此
我尝试运行Aperture SDK 2.1附带的SampleFTPExportPlugIn.我必须调整Base SDK设置并手动将PluginManager.Framework文件夹复制到/ Library / Frameworks,如 here所述.

所有编译和Aperture 3.2.3现在提供菜单项File / Export / FTP.

选择“FTP”导出方法并因此触发插件代码时,Aperture会发生EXC_BAD_ACCESS崩溃.当尝试获取对ApertureExportManager的引用时,非法内存访问发生在类SampleFTPExportPlugIn的initWithAPIManager方法中:

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

这是在Aperture将控制交给插件后执行的第二行,似乎是在任何Aperture插件中获取ApertureExportManager引用的标准方法(我还没有找到任何替代方法来实现在任何地方).

这里的堆栈跟踪:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d,0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 0000000100000000-0000000100798000 [ 7776K] r-x/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

我阅读了有关Objective-C内存管理的所有内容,但无法理解它.我在网上找到的所有其他示例都是这样实现的,所以我想我有一个兼容性问题,我的Aperture / Library安装中缺少一些东西.我该如何缩小问题范围?

编辑:

问题似乎是传入apiManager.方法签名是:

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

然后将该参数分配给我们的内部参考:

_apiManager = apiManager;

然而传入的实际类是PROPlugInFirewall,因为此输出重新启动:

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

然后调用respondsToSelector会导致同样的崩溃,尽管此方法是从NSObject继承的.

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

_apiManager本身将自身描述为:

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

还是卡住……

编辑:

所以看起来Aperture正在传递一个指向天堂的指针…但是,我刚从Apple网页安装了另一个插件,安装程序和所有内容.那个在调用时也失败了……

解决方法

>下载FXPlug 1.2.5 SDK
>打开安装程序包的内容
>将PluginManager.framework复制到/ Library / Frameworks

你的插件现在应该工作!

FXPlug SDK(2.2 / 2.4)中较新版本的PluginManager.framework将导致此崩溃.

使用Xcode 4.5在10.8上测试

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读