2013-10-23 47 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会清除之前由您删除的旧对象。

通过强制内存警告按 + + 中号模拟器上复制此问题。

要解决您的问题,您必须存储变量,指向稍后要在某个全局字典中重新打开的窗口对象。