应用程序在 4 分钟后崩溃

发布于 2024-10-12 17:18:39 字数 1331 浏览 2 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请帮我爱他 2024-10-19 17:18:39

线索在这里:

异常代码:0x8badf00d

这意味着您在启动时执行的操作花费了太长时间才能完成执行。

The clue is here:

Exception Codes: 0x8badf00d

It means that something you're doing on startup is taking too long to finish executing.

淡淡の花香 2024-10-19 17:18:39

事实证明,这是一个无限循环(在我的代码中),是在非常特定的变量组合下触发的。

It turns out it was an infinite loop (in my code) that was triggered under a very specific combination of variables.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文