2013-10-23 45 views
3

我正在爲Titanium for Android和IOS做一個應用程序。當我在應用程序中導航很多時,我有一個隨機異常,應用程序崩潰。如何理解EXC_BAC_ACCESS(SIGSEGV)KERN_INVALID_ADDRESS日誌?

我怎麼知道問題在哪裏?

該應用程序是有點複雜的解釋:

它有兩個窗口,第一窗口是「家」的觀點,即只有在縱向模式下,當我點擊進入另一種觀點,我關閉第一個窗口,我打開另一個窗口,然後添加一個視圖,其內容顯示在此窗口中。內容視圖使用不同的網址加載相同的網頁視圖。

該應用程序加載好,我可以瀏覽不同的意見和窗口好。但是,當我導航了很多,最後我有一個EXC_BAC_ACCESS(SIGSEGV)和KERN_INVALID_ADDRESS

這隻發生在設備上(在模擬器上它工作正常)與iPad操作系統5.1.1和操作系統7.0.2。

這是日誌,其中螺紋崩潰:

Incident Identifier: 1A3E94A0-E6FC-4BFF-BB3B-7651D66664DE 
CrashReporter Key: d4422d11c83ca9acf2212996b20dd1078f00f36c 
Hardware Model:  iPad3,3 
Process:   Appname [16747] 
Path:   /var/mobile/Applications/1BACB160-AED8-4F5F-A599-4F7F1F4A4DC4/Appname.app/Appname 
Identifier:  Appname 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Date/Time:  2013-10-31 11:56:58.680 +0100 
OS Version:  iPhone OS 5.1.1 (9B206) 
Report Version: 104 

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000 
Crashed Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libicucore.A.dylib    0x37953fb2 utext_setNativeIndex + 122 
1 libicucore.A.dylib    0x379542a6 icu::RuleBasedBreakIterator::following(int) + 246 
2 WebKit       0x35f20b2c -[NSString(WebStringDrawing) __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:renderedStringOut:drawUnderline:] + 2176 
3 WebKit       0x35e99078 -[NSString(WebStringDrawing) __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:renderedStringOut:] + 108 
4 WebKit       0x35e98ffc -[NSString(WebStringDrawing) __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:] + 100 
5 WebKit       0x35e98f88 -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:truncationRect:measureOnly:] + 100 
6 WebKit       0x35e98f14 -[NSString(WebStringDrawing) _web_sizeInRect:withFont:ellipsis:lineSpacing:] + 80 
7 UIKit       0x34fba65c -[NSString(UIStringDrawing) sizeWithFont:constrainedToSize:lineBreakMode:lineSpacing:] + 108 
8 UIKit       0x3512ee0e -[NSString(UIStringDrawing) sizeWithFont:constrainedToSize:lineBreakMode:] + 46 
9 Appname       0x0014528c -[TiUILabel sizeForFont:] (TiUILabel.m:57) 
10 Appname       0x0014537a -[TiUILabel contentWidthForWidth:] (TiUILabel.m:69) 
11 Appname       0x001449bc -[TiUILabelProxy contentWidthForWidth:] (TiUILabelProxy.m:17) 
12 Appname       0x00116fb4 -[TiViewProxy autoWidthForSize:] (TiViewProxy.m:756) 
13 Appname       0x00120dbc -[TiViewProxy computeChildSandbox:withBounds:] (TiViewProxy.m:2543) 
14 Appname       0x0011fbb8 -[TiViewProxy measureChildren:] (TiViewProxy.m:2352) 
15 Appname       0x00121e36 -[TiViewProxy layoutChildren:] (TiViewProxy.m:2818) 
16 Appname       0x0011dd9a -[TiViewProxy refreshView:] (TiViewProxy.m:2061) 
17 Appname       0x0011f25c -[TiViewProxy layoutChildrenIfNeeded] (TiViewProxy.m:2264) 
18 Appname       0x001d5ba0 +[TiLayoutQueue layoutProxy:] (TiLayoutQueue.m:79) 
19 Appname       0x001d59b0 performLayoutRefresh (TiLayoutQueue.m:46) 
20 CoreFoundation     0x32a5fa2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8 
21 CoreFoundation     0x32a5f692 __CFRunLoopDoTimer + 358 
22 CoreFoundation     0x32a5e268 __CFRunLoopRun + 1200 
23 CoreFoundation     0x329e149e CFRunLoopRunSpecific + 294 
24 CoreFoundation     0x329e1366 CFRunLoopRunInMode + 98 
25 GraphicsServices    0x32b2e432 GSEventRunModal + 130 
26 UIKit       0x34fc0cce UIApplicationMain + 1074 
27 Appname       0x000b8c34 main (main.m:36) 
28 Appname       0x000b8470 ___lldb_unnamed_function1$$Appname + 32 

Thread 0 crashed with ARM Thread State: 
    r0: 0x00000000 r1: 0x00000000  r2: 0x00000000  r3: 0x00000000 
    r4: 0x0d65c6b0 r5: 0x0d65c690  r6: 0x00000000  r7: 0x2feabfac 
    r8: 0x00000003 r9: 0x2feabf6c  r10: 0x00000003  r11: 0x08052950 
    ip: 0x00000000 sp: 0x2feabfa4  lr: 0x00000000  pc: 0x37953fb2 
    cpsr: 0x80000030 

我也有其他的線程和關於二值圖像信息的日誌。如果它有用,我可以粘貼它。

我怎麼知道問題的原因是什麼以及問題在哪裏?

非常感謝您

+0

您需要用符號表示該堆棧跟蹤。 –

+0

我該怎麼做?謝謝 –

+1

GIYF:http://kevincupp.com/2011/05/12/symbolicating-ios-crash-logs.html –

回答

0

最後,我認爲這是一個webview組件的問題。我在每個視圖中創建了一個Web視圖(我需要它來顯示一些圖),並且當我返回到主視圖時,我試圖將其刪除。我認爲問題在於你無法完全刪除它,並且需要很多內存。

最後我解決了它在app.js中創建webview並在所有視圖中使用它來更改url和尺寸。

3

你得到EXC_BAC_ACCESS因爲你試圖訪問其從內存中刪除的對象。它只在設備上導航到多個窗口時纔會發生,因爲每個窗口都佔用一部分內存,而當沒有更多空間用於新窗口時,iOS會清除之前由您刪除的舊對象。

通過強制內存警告按 + + 中號模擬器上覆制此問題。

要解決您的問題,您必須存儲變量,指向稍後要在某個全局字典中重新打開的窗口對象。