[英]“Symbol not found” Crash while Testing Mac OS X 10.7-specific code on 10.6
[英]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.