草庐IT

iOS 崩溃堆栈解密

coder 2024-01-13 原文

我们的 iPad 应用程序“MyApp”每天有大约 3000 名用户,我们从现场收到了多份无法重现的崩溃报告。原因:“发送到实例的无法识别的选择器” 受影响的设备:仅 iPad 1。

崩溃报告是指 [__NSCFDictionary buttonPressed:]buttonPressed: 是 UIButton 的操作。显然在崩溃的情况下,按钮还没有准备好接收消息。相反,消息被分派(dispatch)到内存中的某个其他实例(在大多数情况下是字典)。

操作 buttonPressed: 通过 xib 文件附加到按钮(还有一种情况是操作以编程方式附加到 ImageView )。 buttonPressed: 是当应用程序出现在最前面时用户可能首先触发的操作。我怀疑在这些情况下,应用程序未完全初始化(返回到前面)并且无法恢复。

我的怀疑是基于符号(总是与这些崩溃一起发生):_resourceLoadLoop(在主线程中执行?)和_dispatch_mgr_wakeup

你有什么看法?您是否遇到过与 iPad 1 客户类似的事情?是否存在已知错误?

以下是典型崩溃堆栈的内容:

Hardware Model:      iPad1,1
Code Type:       ARM
Parent Process:  launchd [1]

Date/Time:       2012-12-04 06:35:48 +0000
OS Version:      iPhone OS 5.1.1 (9B206)
Report Version:  104

Exception Type:  SIGABRT
Exception Codes: #0 at 0x35a2f32c
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception \'NSInvalidArgumentException\', reason: \'-[__NSCFDictionary buttonPressed:]: unrecognized selector sent to instance 0x40eaa0\'

Last Exception Backtrace:
0   CoreFoundation                      0x359b988f __exceptionPreprocess + 163
1   libobjc.A.dylib                     0x335dd259 objc_exception_throw + 33
2   CoreFoundation                      0x359bca9b -[NSObject doesNotRecognizeSelector:] + 175
3   CoreFoundation                      0x359bb915 ___forwarding___ + 301
4   CoreFoundation                      0x35916650 _CF_forwarding_prep_0 + 48
5   CoreFoundation                      0x359133fd -[NSObject performSelector:withObject:withObject:] + 53
6   UIKit                               0x330d4e07 -[UIApplication sendAction:to:from:forEvent:] + 63
7   UIKit                               0x330d4dc3 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 31
8   UIKit                               0x330d4da1 -[UIControl sendAction:to:forEvent:] + 45
9   UIKit                               0x330d4b11 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 493
10  UIKit                               0x330d5449 -[UIControl touchesEnded:withEvent:] + 477
11  UIKit                               0x330d392b -[UIWindow _sendTouchesForEvent:] + 319
12  UIKit                               0x330d3319 -[UIWindow sendEvent:] + 381
13  UIKit                               0x330b9695 -[UIApplication sendEvent:] + 357
14  UIKit                               0x330b8f3b _UIApplicationHandleEvent + 5827
15  GraphicsServices                    0x336ab22b PurpleEventCallback + 883
16  CoreFoundation                      0x3598d523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
17  CoreFoundation                      0x3598d4c5 __CFRunLoopDoSource1 + 141
18  CoreFoundation                      0x3598c313 __CFRunLoopRun + 1371
19  CoreFoundation                      0x3590f4a5 CFRunLoopRunSpecific + 301
20  CoreFoundation                      0x3590f36d CFRunLoopRunInMode + 105
21  GraphicsServices                    0x336aa439 GSEventRunModal + 137
22  UIKit                               0x330e7cd5 UIApplicationMain + 1081
23  MyApp                               0x0002411b main (main.m:14)
24  MyApp                               0x000240c0 start + 40


Thread 0 Crashed:
0   libsystem_kernel.dylib              0x35a2f32c __pthread_kill + 8
1   libsystem_c.dylib                   0x34c1029f abort + 95
2   MyApp                               0x0012d595 +[PLCrashReporter sharedReporter] + 1
3   CoreFoundation                      0x359b9957 __handleUncaughtException + 75
4   libobjc.A.dylib                     0x335dd345 _objc_terminate + 129
5   libc++abi.dylib                     0x352253c5 safe_handler_caller(void (*)()) + 77
6   libc++abi.dylib                     0x35225451 operator delete(void*) + 1
7   libc++abi.dylib                     0x35226825 __cxa_current_exception_type + 1
8   libobjc.A.dylib                     0x335dd2a9 objc_exception_rethrow + 13
9   CoreFoundation                      0x3590f50d CFRunLoopRunSpecific + 405
10  CoreFoundation                      0x3590f36d CFRunLoopRunInMode + 105
11  GraphicsServices                    0x336aa439 GSEventRunModal + 137
12  UIKit                               0x330e7cd5 UIApplicationMain + 1081
13  MyApp                               0x0002411b main (main.m:14)

Thread 1:
0   libsystem_kernel.dylib              0x35a1f3a8 kevent + 24
1   libdispatch.dylib                   0x33d52bc9 _dispatch_mgr_wakeup + 1

Thread 2:
0   libsystem_kernel.dylib              0x35a1f004 mach_msg_trap + 20
1   CoreFoundation                      0x3598d3f3 __CFRunLoopServiceMachPort + 127
2   CoreFoundation                      0x3598c12b __CFRunLoopRun + 883
3   CoreFoundation                      0x3590f4a5 CFRunLoopRunSpecific + 301
4   CoreFoundation                      0x3590f36d CFRunLoopRunInMode + 105
5   WebCore                             0x37655ca3 RunWebThread(void*) + 403
6   libsystem_c.dylib                   0x34bd8735 _pthread_start + 321

Thread 3:
0   libsystem_kernel.dylib              0x35a1f004 mach_msg_trap + 20
1   CoreFoundation                      0x3598d3f3 __CFRunLoopServiceMachPort + 127
2   CoreFoundation                      0x3598c12b __CFRunLoopRun + 883
3   CoreFoundation                      0x3590f4a5 CFRunLoopRunSpecific + 301
4   CoreFoundation                      0x3590f36d CFRunLoopRunInMode + 105
5   Foundation                          0x34d54bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6   Foundation                          0x34d54a81 -[NSThread main] + 73
7   Foundation                          0x34de8591 __NSThread__main__ + 1049
8   libsystem_c.dylib                   0x34bd8735 _pthread_start + 321

Thread 4:
0   libsystem_kernel.dylib              0x35a2f570 __select + 20
1   libsystem_c.dylib                   0x34bd8735 _pthread_start + 321

Thread 5:
0   libsystem_kernel.dylib              0x35a2fcd4 __workq_kernreturn + 8

Thread 6:
0   libsystem_kernel.dylib              0x35a2fcd4 __workq_kernreturn + 8

Thread 0 crashed with ARM Thread State:
    r0: 0x00000000     r1: 0x00000000     r2: 0x00000001     r3: 0x00000000 
    r4: 0x00000006     r5: 0x3f2dbd98     r6: 0x00000002     r7: 0x2fe20a38 
    r8: 0x00469e00     r9: 0x00000000    r10: 0x00000000    r11: 0x0040eaa0 
    ip: 0x00000148     sp: 0x2fe20a2c     lr: 0x34c1720f     pc: 0x35a2f32c 
  cpsr: 0x00080010 

Binary Images:
   0x22000 -   0x288fff +MyApp armv7  <1f677ffc81aa3ccf958c65a92cce8418> /var/mobile/Applications/1D49C89A-36EA-43FC-BE76-7B770E36491B/MyApp.app/MyApp
0x3049d000 - 0x30550fff  iTunesStore armv7  <b3c0cce5f8e632e18f841c32b68f57a1> /System/Library/PrivateFrameworks/iTunesStore.framework/iTunesStore
0x30555000 - 0x305d8fff  MapKit armv7  <e39706ac199134a497954e1f1d6d7245> /System/Library/Frameworks/MapKit.framework/MapKit
0x305d9000 - 0x305dffff  liblaunch.dylib armv7  <aa2bcba6fc7a36a191958fef2e995475> /usr/lib/system/liblaunch.dylib
0x306dd000 - 0x306f1fff  PersistentConnection armv7  <54091a638f8731cd85ccf00fa06972c3> /System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConnection
0x30745000 - 0x30824fff  RawCamera armv7  <293f818ba6533dceae8b900b6ed3c887> /System/Library/CoreServices/RawCamera.bundle/RawCamera
0x30825000 - 0x30882fff  StoreServices armv7  <6ce256d3cf433e4aa1af8d696bf1f75d> /System/Library/PrivateFrameworks/StoreServices.framework/StoreServices
0x30883000 - 0x308cffff  CoreTelephony armv7  <b8f80d5d594c31d2b5d8fba9fdedb7e1> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x308f1000 - 0x30929fff  VideoToolbox armv7  <9f25f38d1cd13a1daff99cfde8884410> /System/Library/PrivateFrameworks/VideoToolbox.framework/VideoToolbox
0x3092a000 - 0x30956fff  libtidy.A.dylib armv7  <3aacc5b650e037c086a8ff6657d154bf> /usr/lib/libtidy.A.dylib
0x30ef1000 - 0x30f42fff  CoreText armv7  <5bfac4ee88d03d5b87a1f105abb7756c> /System/Library/Frameworks/CoreText.framework/CoreText
0x30f43000 - 0x30f47fff  CertUI armv7  <f503892ef60e36108d28d8f9d6144d2a> /System/Library/PrivateFrameworks/CertUI.framework/CertUI
0x30fb3000 - 0x30fb3fff  liblangid.dylib armv7  <644ff4bcfbf337b5b5859e3f0fc0a9a8> /usr/lib/liblangid.dylib
0x30fb4000 - 0x30fcafff  EAP8021X armv7  <952fcfdec0633aff923768fca1a26fcb> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X
0x30fcb000 - 0x30fe0fff  libresolv.9.dylib armv7  <66f7557fa4b43979b186e00271839fdb> /usr/lib/libresolv.9.dylib
0x3129d000 - 0x312bafff  libsystem_info.dylib armv7  <50863bcbf478323e96a8e5b1a83ea6f9> /usr/lib/system/libsystem_info.dylib
0x312c0000 - 0x31433fff  MediaPlayer armv7  <63cdf8f9c66d36e7a4e69e2f6cae854f> /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
0x315ea000 - 0x315eafff  vecLib armv7  <a2cfe25e77aa36bfb4a30b2d0d2dd465> 
[...]

最佳答案

与其被过早激活,可能是实现了 buttonPressed: 的 Controller 已经被释放,并且它的内存被重新用于另一个对象。如果它仅限于某些设备,则可能是由于内存警告...以及已从 iOS 6 中删除的 View 卸载。

关于iOS 崩溃堆栈解密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13722031/

有关iOS 崩溃堆栈解密的更多相关文章

  1. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  2. Ruby Readline 在向上箭头上使控制台崩溃 - 2

    当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby​​安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少

  3. ruby - 如何验证 IO.copy_stream 是否成功 - 2

    这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下

  4. Ruby 文件 IO 定界符? - 2

    我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的

  5. 区块链之加解密算法&数字证书 - 2

    目录一.加解密算法数字签名对称加密DES(DataEncryptionStandard)3DES(TripleDES)AES(AdvancedEncryptionStandard)RSA加密法DSA(DigitalSignatureAlgorithm)ECC(EllipticCurvesCryptography)非对称加密签名与加密过程非对称加密的应用对称加密与非对称加密的结合二.数字证书图解一.加解密算法加密简单而言就是通过一种算法将明文信息转换成密文信息,信息的的接收方能够通过密钥对密文信息进行解密获得明文信息的过程。根据加解密的密钥是否相同,算法可以分为对称加密、非对称加密、对称加密和非

  6. Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting - 2

    1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里

  7. ruby - Ruby 中的单 block AES 解密 - 2

    我需要尝试一些AES片段。我有一些密文c和一个keyk。密文已使用AES-CBC加密,并在前面加上IV。不存在填充,纯文本的长度是16的倍数。所以我这样做:aes=OpenSSL::Cipher::Cipher.new("AES-128-CCB")aes.decryptaes.key=kaes.iv=c[0..15]aes.update(c[16..63])+aes.final它工作得很好。现在我需要手动执行CBC模式,所以我需要单个block的“普通”AES解密。我正在尝试这个:aes=OpenSSL::Cipher::Cipher.new("AES-128-ECB")aes.dec

  8. ruby - 为什么不能使用类IO的实例方法noecho? - 2

    print"Enteryourpassword:"pass=STDIN.noecho(&:gets)puts"Yourpasswordis#{pass}!"输出:Enteryourpassword:input.rb:2:in`':undefinedmethod`noecho'for#>(NoMethodError) 最佳答案 一开始require'io/console'后来的Ruby1.9.3 关于ruby-为什么不能使用类IO的实例方法noecho?,我们在StackOverflow上

  9. ruby-on-rails - 我如何比较 'Bcrypt' Gem解密的密码和加密的密码 - 2

    我正在尝试对某些帖子的评论使用简单的身份验证。用户使用即时ID和密码输入评论我使用“bcrypt”gem将密码存储在数据库中。在comments_controller.rb中像这样@comment=Comment.new(comment_params)bcrypted_pwd=BCrypt::Password.create(@comment.user_pwd)@comment.user_pwd=bcrypted_pwd当用户想要删除他们的评论时,我使用data-confirm-modalgem来确认数据在这部分,我必须解密用户输入的密码以与数据库中的加密密码进行比较我怎样才能解密密码,

  10. ruby - 在多个线程中引用类方法会导致自动加载循环依赖崩溃 - 2

    代码:threads=[]Thread.abort_on_exception=truebegin#throwexceptionsinthreadssowecanseethemthreadseputs"EXCEPTION:#{e.inspect}"puts"MESSAGE:#{e.message}"end崩溃:.rvm/gems/ruby-2.1.3@req/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:478:inload_missing_constant':自动加载常量MyClass时检测到循环依赖稍加研究后,

随机推荐