应用程序崩溃,但只有在为Ad-Hoc发行版构建时才会崩溃

时间:2011-02-04 15:57:17

标签: iphone cocoa-touch memory uikit crash

我的问题是这个。我有一个应用程序,在调试模式下构建并运行良好,没有崩溃,内存错误等。一旦我进行Ad-hoc构建并尝试在设备上运行它,主线程在某一点崩溃,因为没有显而易见的原因......我设法从设备日志中获取的堆栈跟踪因此......

0   libSystem.B.dylib               0x30d7c2d4 __kill + 8
1   libSystem.B.dylib               0x30d7c2c4 kill + 4
2   libSystem.B.dylib               0x30d7c2b6 raise + 10
3   libSystem.B.dylib               0x30d90d72 abort + 50
4   libstdc++.6.dylib               0x34981a20 __gnu_cxx::__verbose_terminate_handler() + 376
5   libobjc.A.dylib                 0x34a83594 _objc_terminate + 104
6   libstdc++.6.dylib               0x3497fdf2 __cxxabiv1::__terminate(void (*)()) + 46
7   libstdc++.6.dylib               0x3497fe46 std::terminate() + 10
8   libstdc++.6.dylib               0x3497ff16 __cxa_throw + 78
9   libobjc.A.dylib                 0x34a824c4 objc_exception_throw + 64
10  CoreFoundation                  0x3587a7c2 +[NSException raise:format:arguments:] + 62
11  CoreFoundation                  0x3587a7fc +[NSException raise:format:] + 28
12  QuartzCore                      0x31071222 CALayerSetPosition(CALayer*, CA::Vec2<double> const&, bool) + 134
13  QuartzCore                      0x31071190 -[CALayer setPosition:] + 32
14  UIKit                           0x341e4378 -[UIView(Geometry) setCenter:] + 16
15  MyApp                           0x00012b2c 0x1000 + 72492
16  MyApp                           0x0001276a 0x1000 + 71530
17  UIKit                           0x341e3270 -[UIViewController view] + 104
18  UIKit                           0x341efd04 -[UIViewController contentScrollView] + 16
19  UIKit                           0x341efb74 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 24
20  UIKit                           0x341efa72 -[UINavigationController _layoutViewController:] + 18
21  UIKit                           0x341ef4cc -[UINavigationController _startTransition:fromViewController:toViewController:] + 248
22  UIKit                           0x341ef358 -[UINavigationController _startDeferredTransitionIfNeeded] + 176
23  UIKit                           0x341e30be -[UINavigationController pushViewController:transition:forceImmediate:] + 634
24  UIKit                           0x341e2e34 -[UINavigationController pushViewController:animated:] + 28
25  MyApp                           0x00004f80 0x1000 + 16256
26  UIKit                           0x3420b834 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 656
27  UIKit                           0x342cb60c -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 124
28  Foundation                      0x31181df6 __NSFireDelayedPerform + 362
29  CoreFoundation                  0x3583109c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
30  CoreFoundation                  0x35830b54 __CFRunLoopDoTimer + 844
31  CoreFoundation                  0x358021ae __CFRunLoopRun + 1082
32  CoreFoundation                  0x35801c80 CFRunLoopRunSpecific + 224
33  CoreFoundation                  0x35801b88 CFRunLoopRunInMode + 52
34  GraphicsServices                0x320c84a4 GSEventRunModal + 108
35  GraphicsServices                0x320c8550 GSEventRun + 56
36  UIKit                           0x341dc322 -[UIApplication _run] + 406
37  UIKit                           0x341d9e8c UIApplicationMain + 664

另一个非常奇怪的事情是,如果你关闭应用程序并在后台停止运行(崩溃后),然后重新启动它,几乎立即引用它... ...

<Warning>: Application 'MyApp' exited abnormally with signal 11: Segmentation fault

我认为是内存访问错误(未初始化的内存访问)。我没有用指针或任何东西做任何疯狂的事情,所以我可以假设它是CF库的一个问题......

任何想法或帮助都会非常感激:)

1 个答案:

答案 0 :(得分:2)

如果不了解更多,很难确切地说出答案是什么,但我的第一个猜测是你为UIView的{​​{1}}财产提供了一些无效的价值。

缺少两条信息可以帮助您/我找到答案。

首先,需要对堆栈跟踪中的这些行进行符号化处理:

center

了解这两行中发生的事情将有助于您追踪它,并且知道抛出的异常(从堆栈跟踪中的第11行开始)包含将有助于进一步。您可以通过在Xcode的管理器中查看设备的控制台输出来获取此信息。

如果您拥有在为AdHoc分发构建应用程序时创建的dSYM文件,则可以对崩溃报告进行符号化。将崩溃报告拖动到Xcode的管理器窗口将尝试自动对其进行符号化。如果这不起作用,您可以尝试直接使用symbolicatecrash脚本。它隐藏在这样的道路上:

  

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

相关问题