应用程序在 4 分钟后崩溃
我在 arc4random 调用期间遇到了奇怪的崩溃,该崩溃仅在应用程序运行大约 4 分钟后出现,并且并非每次都会发生。这是崩溃日志:
Incident Identifier: 25C8C57F-0434-40B2-A2E8-FE88F58ABF60
CrashReporter Key: 8683ce910e9db4ba69f61266b606396f941d08ee
Hardware Model: iPhone2,1
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-01-16 18:46:45.170 +0000
OS Version: iPhone OS 4.2.1 (8C148a)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
<App> failed to resume in time
Elapsed total CPU time (seconds): 5.930 (user 5.380, system 0.550), 100% CPU
Elapsed application CPU time (seconds): 4.790, 81% CPU
Thread 0:
0 libSystem.B.dylib 0x31168006 pthread_mutex_lock + 50
1 libSystem.B.dylib 0x3118cb10 arc4random + 24
2 <App> 0x0000f658 -[BasicGameLayer updateBoard] (BasicGameScreen.mm:318)
3 <App> 0x00010790 -[BasicGameLayer handleTouches:withEvent:] (BasicGameScreen.mm:238)
4 <App> 0x0000e504 -[BasicGameLayer ccTouchesBegan:withEvent:] (BasicGameScreen.mm:276)
BasicGameScreen.mm 的第 318 行是左大括号。我假设编译器正在删除空格,所以我认为它崩溃的行是
int selection = arc4random() % 16;
I'm getting a strange crash during an arc4random call that only appears after about 4 minutes of the app running, and it doesn't do it every time. Here's the crash log:
Incident Identifier: 25C8C57F-0434-40B2-A2E8-FE88F58ABF60
CrashReporter Key: 8683ce910e9db4ba69f61266b606396f941d08ee
Hardware Model: iPhone2,1
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-01-16 18:46:45.170 +0000
OS Version: iPhone OS 4.2.1 (8C148a)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
<App> failed to resume in time
Elapsed total CPU time (seconds): 5.930 (user 5.380, system 0.550), 100% CPU
Elapsed application CPU time (seconds): 4.790, 81% CPU
Thread 0:
0 libSystem.B.dylib 0x31168006 pthread_mutex_lock + 50
1 libSystem.B.dylib 0x3118cb10 arc4random + 24
2 <App> 0x0000f658 -[BasicGameLayer updateBoard] (BasicGameScreen.mm:318)
3 <App> 0x00010790 -[BasicGameLayer handleTouches:withEvent:] (BasicGameScreen.mm:238)
4 <App> 0x0000e504 -[BasicGameLayer ccTouchesBegan:withEvent:] (BasicGameScreen.mm:276)
Line 318 of BasicGameScreen.mm is an opening brace. I'm assuming the compiler is removing whitespace so I think the line it's crashing on is
int selection = arc4random() % 16;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
线索在这里:
这意味着您在启动时执行的操作花费了太长时间才能完成执行。
The clue is here:
It means that something you're doing on startup is taking too long to finish executing.
事实证明,这是一个无限循环(在我的代码中),是在非常特定的变量组合下触发的。
It turns out it was an infinite loop (in my code) that was triggered under a very specific combination of variables.