繁体   English   中英

仅在OS X 10.6和10.7中关闭应用程序时崩溃

[英]Crash on closing app in OS X 10.6 and 10.7 only

我的应用程序仅在OS X 10.6和OS X 10.7上存在一个错误:该应用程序在关闭时崩溃。

更好地说明:当用户关闭应用程序窗口(结果是关闭应用程序)时,用户会看到崩溃对话框,这意味着应用程序在关闭时崩溃了。

我设法在OS X 10.7用户的帮助下使用了该应用程序的Debug版本,想象它会产生一个更易于理解的崩溃日志,但是没有任何变化。

Process: MyApp [838]
Path: /Applications/MyApp.app/Contents/MacOS/MyApp
Identifier: MyApp
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: MyApp [650]

Date/Time: 2016-07-20 17:38:24.043 0200
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9

Crashed Thread: Unknown

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00007fff5fc01028

Backtrace not available

Unknown thread crashed with X86 Thread State (64-bit):
rax: 0x0000000000000055 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x0000000000000000
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x0000000000000000 rsp: 0x0000000000000000
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x00007fff5fc01028 rfl: 0x0000000000010203 cr2: 0x00007fff5fc01028
Logical CPU: 0

Binary images description not available


External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 316
thread_create: 0
thread_set_state: 0

Report Version及更高Report Version ,除task_for_pid之外,其他所有内容都始终相同。

我知道它不会影响程序的使用,因为它只会在程序关闭后才会发生,但是每次关闭应用程序时看到崩溃报告肯定会很痛苦。

请记住,此错误在OS X 10.8或更高版本中不会发生,并且我使用的是10.11 SDK。

最后我解决了这个问题。 尽管OS X表示崩溃是我的应用程序引起的,但事实并非如此。 在我的applicationWillTerminate:函数中,我正在运行二进制抛出NSTask,但是该二进制代码被编译为与10.9+兼容,这导致崩溃。

使用OS X 10.6重建二进制文件作为目标版本修复了崩溃问题。 部分类似于@Willeke的建议,我在Mac(双引导)上安装了Snow Leopard,以便在其中测试我的应用程序,因此现在我将在Snow Leopard和El Capitan中对其进行测试。 最旧和最新的版本(而Sierra尚未发布稳定版本)。

我不知道为什么在OS X 10.8中也没有发生该错误。 苹果可能已经改变了系统应对此类问题的方式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM