正如標題所說,當垃圾回收未啓用時,我的應用程序崩潰。該應用程序會彈出幾秒鐘,然後它只是死機,什麼也沒有,但是這在調試器控制檯:應用程序崩潰未啓用垃圾回收
[Session started at 2009-08-17 15:03:20 -0600.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 12535.
unable to read unknown load command 0x22
unable to read unknown load command 0x22
unable to read unknown load command 0x22
unable to read unknown load command 0x22
我不知道爲什麼它的發生。我認爲它可能是一個內存管理問題。我使用了AnalysisTool(Clang靜態分析器的前端)檢查泄漏和內存管理問題,並修復了它找到的問題。然而,通過樂器運行應用程序會在啓動時發現內存泄漏。我不知道這個漏洞是從哪裏來的...隨着垃圾收集啓用應用程序運行良好,但儀器仍然發現泄漏。
的源代碼可應要求提供
感謝
嗨,是的,我有幾個for循環。設置斷點後,如何檢查對象是否已被釋放? – indragie 2009-08-18 17:07:55
在malloc_printf和malloc_debug_error上設置BP。 這應該帶你到你需要的地方。 – psychotik 2009-08-18 18:34:21
謝謝,我發現了這個問題:) – indragie 2009-08-18 22:01:07