当我使用SpriteKit iOS7编程游戏时,有没有人知道解决OSSpinLockLock问题?

时间:2013-11-01 17:47:55

标签: ios7 spinlock xcode5.0.1

OSSpinLockLock是反复出现的,lldb没有显示适当的callStackSymbols。

以下是我从Xcode Version 5.0.1(5A2034a)的lldb获得的内容

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

只有SpriteKit(iOS7)才会发生这种情况。我已经在SKEmitterNodes周围检查了几十次,但内部没有任何错误。 很不错,有时候复制带有:消息不能在高速弹丸中正常运行如下:

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

有谁知道解决这个问题?它是由SpriteKit bug引起的吗?

02NOV2013 1:31 AM 调用堆栈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.dylib spin_lock + 2     帧#1:0x30c2d980 SpriteKit SKSpinLockSync(int*, void () block_pointer) + 92 frame #2: 0x30bf38fc SpriteKit - [SKTexture loadImageData] + 300     帧#3:0x30bf67ee SpriteKit -[SKTexture size] + 42 frame #4: 0x30c163a4 SpriteKit SKCEmitterSprite :: update(double)+ 3136     帧#5:0x30c262aa SpriteKit SKCSprite::update(double) + 354 frame #6: 0x30c262aa SpriteKit SKCSprite :: 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 QuartzCore CA :: 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 IOMobileFramebuffer IOMobileFramebufferVsyncNotifyFunc + 104     帧#17:0x2f266be4 IOKit IODispatchCalloutFromCFMessage + 248 frame #18: 0x2e544b80 CoreFoundation _CFMachPortPerform + 136     帧#19:0x2e54f776 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34 frame #20: 0x2e54f712 CoreFoundation __ CFRunLoopDoSource1 + 346     帧#21:0x2e54dede CoreFoundation __CFRunLoopRun + 1406 frame #22: 0x2e4b8470 CoreFoundation CFRunLoopRunSpecific + 524     帧#23:0x2e4b8252 CoreFoundation CFRunLoopRunInMode + 106 frame #24: 0x331f22ea GraphicsServices GSEventRunModal + 138     帧#25:0x30d6d844 UIKit UIApplicationMain + 1136 frame #26: 0x000e7258 NaughtyBirds main(argc = 1,argv = 0x27d2bc4c)+ 228 at main.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 usleep + 52     帧#3:0x00350ad0 GPUToolsCore smt_poll_thread_entry(void*) + 124 frame #4: 0x38ef7c5c libsystem_pthread.dylib _ pthread_body + 140     第5帧:0x38ef7bce libsystem_pthread.dylib`_pthread_start + 102

线程#7:tid = 0xcf5e0,0x38e7e838 libsystem_kernel.dylib kevent64 + 24, queue = 'com.apple.libdispatch-manager frame #0: 0x38e7e838 libsystem_kernel.dylib kevent64 + 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.dylib mach_msg_trap + 20     帧#1:0x38e7e880 libsystem_kernel.dylib mach_msg + 40 frame #2: 0x2df353c2 AudioToolbox AURemoteIO :: IOThread :: Run()+ 106     帧#3:0x2df38600 AudioToolbox AURemoteIO::IOThread::Entry(void*) + 8 frame #4: 0x2de75772 AudioToolbox CAPThread :: Entry(CAPThread *)+ 210     第5帧:0x38ef7c5c libsystem_pthread.dylib _pthread_body + 140 frame #6: 0x38ef7bce libsystem_pthread.dylib _ pthread_start + 102 (LLDB)

1 个答案:

答案 0 :(得分:-3)

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