2

OSSpinLockLock 是反复引起的,并且 lldb 没有为此显示适当的 callStackSymbols。

以下是我从 Xcode 版本 5.0.1 (5A2034a) 的 lldb 中得到的

我试图通过 [NSThread callStackSymbols] 获取更多符号,但在这种情况下无效。

这只发生在 SpriteKit (iOS7) 上。我已经在 SKEmitterNodes 周围检查了数十次,但它内部没有错误。奇怪的是,有时 copyWithZone: 消息在高速弹丸中无法正常运行,如下所示:

SKEmitterNode * template=[NSKeyedUnarchiver unarchiveObjectWithFile:[[NSBundle mainBundle] pathForResource:@"cannonball_flame" ofType:@"sks"]]; .... ... [模板副本]; // --> 在某些情况下不好

有没有人知道解决这个问题?它是由 SpriteKit 错误引起的吗?

2013 年 11 月 2 日凌晨 1:31 调用堆栈 0

libsystem_platform.dylib`OSSpinLockLock:
0x38ef1654:  movs   r1, #1

libsystem_platform.dylib`spin_lock + 2:
0x38ef1656:  ldrex  r2, [r0]
0x38ef165a:  cmp    r2, #0
0x38ef165c:  it     ne
0x38ef165e:  bne.w  0x38ef4a94                ; _OSSpinLockLockSlow$shim
0x38ef1662:  strex  r2, r1, [r0]
0x38ef1666:  cmp    r2, #0
0x38ef1668:  bne    0x38ef1656                ; spin_lock + 2
0x38ef166a:  dmb    ish
0x38ef166e:  bx     lr

call stack 1
SpriteKit`SKSpinLockSync(int*, void () block_pointer):
0x30c2d924:  push   {r4, r5, r6, r7, lr}
0x30c2d926:  add    r7, sp, #12
0x30c2d928:  push.w {r8, r10, r11}
0x30c2d92c:  sub.w  r4, sp, #64
0x30c2d930:  bic    r4, r4, #15
0x30c2d934:  mov    sp, r4
0x30c2d936:  vst1.64 {d8, d9, d10, d11}, [r4, :128]!
0x30c2d93a:  vst1.64 {d12, d13, d14, d15}, [r4, :128]
0x30c2d93e:  sub    sp, #64
0x30c2d940:  mov    r4, r0
0x30c2d942:  mov    r0, r1
0x30c2d944:  str    r4, [sp, #4]
0x30c2d946:  blx    0x30c44114                ; symbol stub for: dispatch_async$shim
0x30c2d94a:  movw   r2, #1712
0x30c2d94e:  ldr    r1, [pc, #140]            ; SKSpinLockSync(int*, void () block_pointer) + 184
0x30c2d950:  movt   r2, #2171
0x30c2d954:  str    r0, [sp, #8]
0x30c2d956:  add    r0, sp, #12
0x30c2d958:  add    r2, pc
0x30c2d95a:  ldr    r2, [r2]
0x30c2d95c:  add    r1, pc
0x30c2d95e:  str    r2, [sp, #36]
0x30c2d960:  str    r1, [sp, #40]
0x30c2d962:  ldr    r1, [pc, #124]            ; SKSpinLockSync(int*, void () block_pointer) + 188
0x30c2d964:  str    r7, [sp, #44]
0x30c2d966:  str.w  sp, [sp, #52]
0x30c2d96a:  orr    r1, r1, #1
0x30c2d96e:  add    r1, pc
0x30c2d970:  str    r1, [sp, #48]
0x30c2d972:  movs   r1, #1
0x30c2d974:  str    r1, [sp, #16]
0x30c2d976:  blx    0x30c44274                ; symbol stub for: SKCRenderPassNew::operator=(SKCRenderPassNew const&)
0x30c2d97a:  mov    r0, r4
0x30c2d97c:  blx    0x30c44234                ; symbol stub for: +[SKOpenGLNode openGLNodeWithViewportSize:]
0x30c2d980:  ldr    r0, [sp, #8]
0x30c2d982:  movs   r2, #2
0x30c2d984:  ldr    r1, [r0, #12]
0x30c2d986:  ldr    r0, [sp, #8]
0x30c2d988:  str    r2, [sp, #16]
0x30c2d98a:  blx    r1
0x30c2d98c:  movs   r0, #3
0x30c2d98e:  str    r0, [sp, #16]
0x30c2d990:  ldr    r0, [sp, #4]
0x30c2d992:  blx    0x30c44244                ; symbol stub for: -[SKOpenGLNode needsRenderForTime:]
0x30c2d996:  ldr    r0, [sp, #8]
0x30c2d998:  blx    0x30c44104                ; symbol stub for: objc_copyWeak$shim
0x30c2d99c:  add    r0, sp, #12
0x30c2d99e:  blx    0x30c44294                ; symbol stub for: SKCRenderPassNew::~SKCRenderPassNew()
0x30c2d9a2:  add    r4, sp, #64
0x30c2d9a4:  vld1.64 {d8, d9, d10, d11}, [r4, :128]!
0x30c2d9a8:  vld1.64 {d12, d13, d14, d15}, [r4, :128]
0x30c2d9ac:  sub.w  r4, r7, #24
0x30c2d9b0:  mov    sp, r4
0x30c2d9b2:  pop.w  {r8, r10, r11}
0x30c2d9b6:  pop    {r4, r5, r6, r7, pc}
0x30c2d9b8:  ldr    r0, [sp, #16]
0x30c2d9ba:  cmp    r0, #3
0x30c2d9bc:  bls    0x30c2d9c0                ; SKSpinLockSync(int*, void () block_pointer) + 156
0x30c2d9be:  trap   
0x30c2d9c0:  tbb    [pc, r0]
0x30c2d9c4:  lsls   r2, r0, #8
0x30c2d9c6:  movs   r2, r0
0x30c2d9c8:  ldr    r4, [sp, #20]
0x30c2d9ca:  ldr    r0, [sp, #8]
0x30c2d9cc:  blx    0x30c44104                ; symbol stub for: objc_copyWeak$shim
0x30c2d9d0:  mov.w  r0, #4294967295
0x30c2d9d4:  str    r0, [sp, #16]
0x30c2d9d6:  mov    r0, r4
0x30c2d9d8:  blx    0x30c44284                ; symbol stub for: SKCRenderPassNew::~SKCRenderPassNew()
0x30c2d9dc:  ldr    r3, [sp, #400]
0x30c2d9de:  movs   r1, r0
0x30c2d9e0:  lsls   r6, r0, #1
0x30c2d9e2:  movs   r0, r0


didBeginContact: Hit Tree
(lldb) po [NSThread callStackSymbols]
<_NSCallStackArray 0x7f9fe40>(
0   ???                                 0x00571654 0x0 + 5707348,
1   NaughtyBirds                        0x000e7175 main + 0,
2   SpriteKit                           0x30bf38fd <redacted> + 300,
3   SpriteKit                           0x30bf67ef <redacted> + 42,
4   SpriteKit                           0x30c163a5 <redacted> + 3136,
5   SpriteKit                           0x30c262ab <redacted> + 354,
6   SpriteKit                           0x30c262ab <redacted> + 354,
7   SpriteKit                           0x30c262ab <redacted> + 354,
8   SpriteKit                           0x30beeb93 <redacted> + 174,
9   SpriteKit                           0x30c03449 <redacted> + 324,
10  SpriteKit                           0x30c00add <redacted> + 820,
11  SpriteKit                           0x30bfe51b <redacted> + 130,
12  SpriteKit                           0x30c20c87 <redacted> + 254,
13  libglInterpose.dylib                0x002bb5ff -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270,
14  QuartzCore                          0x309dfad3 <redacted> + 98,
15  QuartzCore                          0x309df87d <redacted> + 344,
16  IOMobileFramebuffer                 0x3360f76d <redacted> + 104,
17  IOKit                               0x2f266be5 IODispatchCalloutFromCFMessage + 248,
18  CoreFoundation                      0x2e544b81 <redacted> + 136,
19  CoreFoundation                      0x2e54f777 <redacted> + 34,
20  CoreFoundation                      0x2e54f713 <redacted> + 346,
21  CoreFoundation                      0x2e54dedf <redacted> + 1406,
22  CoreFoundation                      0x2e4b8471 CFRunLoopRunSpecific + 524,
23  CoreFoundation                      0x2e4b8253 CFRunLoopRunInMode + 106,
24  GraphicsServices                    0x331f22eb GSEventRunModal + 138,
25  UIKit                               0x30d6d845 UIApplicationMain + 1136,
26  NaughtyBirds                        0x000e7259 main + 228,
27  libdyld.dylib                       0x38ddaab7 <redacted> + 2

)

(lldb) bt all * thread #1: tid = 0xcf5af, 0x38ef1656 libsystem_platform.dylib spin_lock + 2, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x38ef1656 libsystem_platform.dylibspin_lock + 2 frame #1: 0x30c2d980 SpriteKit SKSpinLockSync(int*, void () block_pointer) + 92 frame #2: 0x30bf38fc SpriteKit-[SKTexture loadImageData] + 300 frame #3: 0x30bf67ee SpriteKit -[SKTexture size] + 42 frame #4: 0x30c163a4 SpriteKitSKCEmitterSprite::update(double) + 3136 frame #5: 0x30c262aa SpriteKit SKCSprite::update(double) + 354 frame #6: 0x30c262aa SpriteKitSKCSprite::update(double) + 354 帧 #7: 0x30c262aa SpriteKit SKCSprite::update(double) + 354 frame #8: 0x30beeb92 SpriteKit-[SKScene _update:] + 174 帧 #9: 0x30c03448 SpriteKit -[SKView(Private) _update:] + 324 frame #10: 0x30c00adc SpriteKit-[SKView renderCallback:] + 820 帧 #11: 0x30bfe51a SpriteKit __29-[SKView setUpRenderCallback]_block_invoke + 130 frame #12: 0x30c20c86 SpriteKit-[ SKDisplayLink callbackForNextFrame:] + 254 帧 #13: 0x002bb5fe libglInterpose.dylib -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270 frame #14: 0x309dfad2 QuartzCoreCA::Display::DisplayLinkItem::dispatch() + 98 帧 #15: 0x309df87c QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 344 frame #16: 0x3360f76c IOMobileFramebufferIOMobileFramebufferVsyncNotifyFunc + 104 帧 #17: 0x2f266be4 IOKitIODispatchCalloutFromCFMessage + 248 frame #18: 0x2e544b80 CoreFoundation_CFMACHPORTPERFORM + 136帧#19:0x2E54F776核心__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34 frame #20: 0x2e54f712 CoreFoundation控件__cfrunloopdosource1 + 346框架#21:0x2E54DEDE COREFOUNDECFRUNOOPRUNSPECIFIC __CFRunLoopRun + 1406 frame #22: 0x2e4b8470 CoreFoundation+ 524框架23:0x2E4B8252 COREFOUND AT2 AT2 AT2 AT2 AT2 ARG2 ARG2 ARGRIUK + iik + iik + iik @ indriik + iik CFRunLoopRunInMode + 106 frame #24: 0x331f22ea GraphicsServices@ influn + iik @ n.and inder + 30 UIApplicationMain + 1136 frame #26: 0x000e7258 NaughtyBirds. .m:18

线程 #5:tid = 0xcf5de,0x38e91550 libsystem_kernel.dylib __semwait_signal + 24, name = 'gputools.smt_poll.0x15d305b0 frame #0: 0x38e91550 libsystem_kernel.dylib__semwait_signal + 24 帧 #1:0x38e024ec libsystem_c.dylib 睡眠nanosleep + 172 frame #2: 0x38e0243c libsystem_c.dylib+ 52 帧 #3:0x00350ad0 GPUToolsCore smt_poll_thread_entry(void*) + 124 frame #4: 0x38ef7c5c libsystem_pthread.dylib_pthread_body + 140 帧 #5:0x38ef7bce libsystem_pthread.dylib`p`_p

线程 #7:tid = 0xcf5e0,0x38e7e838 libsystem_kernel.dylib kevent64 + 24, queue = 'com.apple.libdispatch-manager frame #0: 0x38e7e838 libsystem_kernel.dylibkevent64 + 24 帧 #1:0x38dcd0d4 libdispatch.dylib _dispatch_mgr_invoke + 232 frame #2: 0x38dc7622 libdispatch.dylib_dispatch_mgr_thread + 38

线程 #8: tid = 0xcf655, 0x38e91c7c libsystem_kernel.dylib __workq_kernreturn + 8 frame #0: 0x38e91c7c libsystem_kernel.dylib__workq_kernreturn + 8 帧 #1: 0x38ef5e0a libsystem_pthread.dylib`_pthread_wqthread + 310

线程 #9: tid = 0xcf664, 0x38e7ea84 libsystem_kernel.dylib mach_msg_trap + 20 frame #0: 0x38e7ea84 libsystem_kernel.dylibmach_msg_trap + 20 帧 #1: 0x38e7e880 libsystem_kernel.dylib mach_msg + 40 frame #2: 0x2df353c2 AudioToolboxAURemoteIO::IOThread::Run() + 106 帧 #3: 0x2df38600 AudioToolbox AURemoteIO::IOThread::Entry(void*) + 8 frame #4: 0x2de75772 AudioToolboxCAPThread::Entry(CAPThread*) + 210帧 #5:0x38ef7c5c libsystem_pthread.dylib _pthread_body + 140 frame #6: 0x38ef7bce libsystem_pthread.dylib_pthread_start + 102 (lldb)

4

1 回答 1

-4

最后我找到了解决方案。能够从互联网搜索获得的所有帖子对解决方案都是无效的。有时,如果动作包含多线程概念,则特殊动作类型会导致此问题,而不是由于捆绑中的纹理损坏或丢失。我确实解决了它!

于 2013-11-12T16:13:17.143 回答