链接 AssetsLibrary.framework 后逻辑测试挂在 -[MKTileCache init] () 中
我的 iOS 应用程序有一堆简单的逻辑测试,我们使用 buildot 在持续集成中运行这些测试。
最近,我开始将 AssetsLibrary 框架链接到主应用程序和逻辑测试。逻辑测试包括主应用程序中的类,这些类在某些方法中使用框架,但在逻辑测试中不会调用这些类。
从那时起,我们的构建机器人的单元测试就在这个过程的早期阶段就挂起了。当这种情况发生时,Gdb'ing 到 octest,MKTileCache 中似乎存在某种线程死锁(我不在任何地方使用):
(gdb) thread apply all bt
Thread 3 (process 77496):
#0 0x00495ff7 in -[__NSArrayM objectAtIndex:] ()
#1 0x000528fa in -[NSFileManager(NSURLExtras) _web_createDirectoryAtPathWithIntermediateDirectories:attributes:] ()
#2 0x052a554c in TileCachePrivate::runCacheThread ()
#3 0x052a5702 in _runCacheThread ()
#4 0x95f47259 in _pthread_start ()
#5 0x95f470de in thread_start ()
Thread 2 (process 77496):
#0 0x95f40382 in kevent ()
#1 0x00c1ff36 in _dispatch_mgr_invoke ()
#2 0x00c20333 in _dispatch_queue_invoke ()
#3 0x00c20593 in _dispatch_worker_thread2 ()
#4 0x95f3f781 in _pthread_wqthread ()
#5 0x95f3f5c6 in start_wqthread ()
Thread 1 (process 77496):
#0 0x95f47aa2 in __semwait_signal ()
#1 0x95f4775e in _pthread_cond_wait ()
#2 0x95f493f8 in pthread_cond_wait$UNIX2003 ()
#3 0x052a543d in TileCachePrivate::TileCachePrivate ()
#4 0x052a68de in -[MKTileCache init] ()
#5 0x052a51f8 in +[MKTileCache sharedCache] ()
#6 0x0529eb7b in +[MKMapTileView initialize] ()
#7 0x002cfd9b in _class_initialize ()
#8 0x002d773f in prepareForMethodLookup ()
#9 0x002ce069 in lookUpMethod ()
#10 0x002ce1d6 in _class_lookupMethodAndLoadCache ()
#11 0x002e10e3 in objc_msgSend ()
#12 0x20108824 in +[NSObject(SenTestRuntimeUtilities) senAllSubclasses] ()
#13 0x201074a7 in +[SenTestSuite updateCache] ()
#14 0x20107443 in +[SenTestSuite suiteForBundleCache] ()
#15 0x201073a4 in +[SenTestSuite testSuiteForBundlePath:] ()
#16 0x2010606b in +[SenTestProbe specifiedTestSuite] ()
#17 0x20106792 in +[SenTestProbe runTests:] ()
#18 0x000023c7 in ?? ()
#19 0x000025f2 in ?? ()
#20 0x0000209a in ?? ()
#21 0x00002049 in ?? ()
有人见过类似的情况吗?
My iOS app has a bunch of simple logic tests, which we run in a continuous integration using buildot.
Recently I started linking the AssetsLibrary framework to both the main app, and to the logic tests. The logic tests include classes from the main application, which use the framework in some methods, but these are not called in the logic tests.
Ever since, the unit tests on our buildbot are hanging, pretty early in the process. Gdb'ing to octest when this happens, there seems to be some sort of thread dead-lock in MKTileCache (which I don't use anywhere):
(gdb) thread apply all bt
Thread 3 (process 77496):
#0 0x00495ff7 in -[__NSArrayM objectAtIndex:] ()
#1 0x000528fa in -[NSFileManager(NSURLExtras) _web_createDirectoryAtPathWithIntermediateDirectories:attributes:] ()
#2 0x052a554c in TileCachePrivate::runCacheThread ()
#3 0x052a5702 in _runCacheThread ()
#4 0x95f47259 in _pthread_start ()
#5 0x95f470de in thread_start ()
Thread 2 (process 77496):
#0 0x95f40382 in kevent ()
#1 0x00c1ff36 in _dispatch_mgr_invoke ()
#2 0x00c20333 in _dispatch_queue_invoke ()
#3 0x00c20593 in _dispatch_worker_thread2 ()
#4 0x95f3f781 in _pthread_wqthread ()
#5 0x95f3f5c6 in start_wqthread ()
Thread 1 (process 77496):
#0 0x95f47aa2 in __semwait_signal ()
#1 0x95f4775e in _pthread_cond_wait ()
#2 0x95f493f8 in pthread_cond_wait$UNIX2003 ()
#3 0x052a543d in TileCachePrivate::TileCachePrivate ()
#4 0x052a68de in -[MKTileCache init] ()
#5 0x052a51f8 in +[MKTileCache sharedCache] ()
#6 0x0529eb7b in +[MKMapTileView initialize] ()
#7 0x002cfd9b in _class_initialize ()
#8 0x002d773f in prepareForMethodLookup ()
#9 0x002ce069 in lookUpMethod ()
#10 0x002ce1d6 in _class_lookupMethodAndLoadCache ()
#11 0x002e10e3 in objc_msgSend ()
#12 0x20108824 in +[NSObject(SenTestRuntimeUtilities) senAllSubclasses] ()
#13 0x201074a7 in +[SenTestSuite updateCache] ()
#14 0x20107443 in +[SenTestSuite suiteForBundleCache] ()
#15 0x201073a4 in +[SenTestSuite testSuiteForBundlePath:] ()
#16 0x2010606b in +[SenTestProbe specifiedTestSuite] ()
#17 0x20106792 in +[SenTestProbe runTests:] ()
#18 0x000023c7 in ?? ()
#19 0x000025f2 in ?? ()
#20 0x0000209a in ?? ()
#21 0x00002049 in ?? ()
Has anyone seen anything like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论