我的iOS应用程序仅在部署(临时)时崩溃 - 我已经在本地测试了应用程序,似乎从来没有出现过相同的问题。它与发送HTTP Post请求有关。
这是崩溃日志:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000c18bbec8
Triggered by Thread: 0
这是代码:
NSMutableURLRequest * request = [NSMutableURLRequest new];
[request setURL:addURL];
[request setHTTPMethod:@"POST"];
// setup the request headers
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:holder];
NSURLResponse * response = nil;
NSData * receivedData = nil;
receivedData = [NSMutableData data];
// this next line throws an error
receivedData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
关于应用程序崩溃原因的任何想法(或尝试调试部署版本的应用程序的任何提示?)
以下是完整的崩溃报告:
Incident Identifier: 65D7C33B-D082-4E78-9F73-4489D528AC8B
CrashReporter Key: 8722e51d4300c003d1ac939808b1a9c67f112194
Hardware Model: iPhone6,1
Process: [] [200]
Path: /private/var/mobile/Containers/Bundle/Application/5EE4D0E6-303F-4EF3-8C81-489A74425679/[].app/[]
Identifier: edu.self.[]
Version: 1.1 (1.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2014-09-26 19:57:39.918 -0400
Launch Time: 2014-09-26 19:57:31.383 -0400
OS Version: iOS 8.0.2 (12A405)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000001d111bec8
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019591a964 __kill + 8
1 [] 0x000000010010c404 CLSSignalHandler + 224
2 libsystem_platform.dylib 0x00000001959b0958 _sigtramp + 64
3 [] 0x00000001000ca954 -[EditProjectViewController addStep] (EditProjectViewController.m:231)
4 [] 0x00000001000cb2a4 -[EditProjectViewController prepareForSegue:sender:] (EditProjectViewController.m:369)
5 UIKit 0x0000000189902fc4 -[UIStoryboardSegueTemplate _perform:] + 188
6 UIKit 0x000000018936ce64 -[UIApplication sendAction:to:from:forEvent:] + 92
7 UIKit 0x000000018936ce64 -[UIApplication sendAction:to:from:forEvent:] + 92
8 UIKit 0x0000000189355fbc -[UIControl _sendActionsForEvents:withEvent:] + 608
9 UIKit 0x000000018936c800 -[UIControl touchesEnded:withEvent:] + 588
10 UIKit 0x000000018932c294 _UIGestureRecognizerUpdate + 8532
11 CoreFoundation 0x0000000184b6e384 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
12 CoreFoundation 0x0000000184b6b310 __CFRunLoopDoObservers + 356
13 CoreFoundation 0x0000000184b6b6f0 __CFRunLoopRun + 832
14 CoreFoundation 0x0000000184a99660 CFRunLoopRunSpecific + 392
15 GraphicsServices 0x000000018dbdb5a0 GSEventRunModal + 164
16 UIKit 0x000000018939e4f4 UIApplicationMain + 1484
17 [] 0x00000001000cd2c8 main (main.m:17)
18 libdyld.dylib 0x0000000195802a04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000195900c94 kevent64 + 8
1 libdispatch.dylib 0x00000001957e897c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x00000001957db4a0 _dispatch_mgr_thread + 48
Thread 2:
0 libsystem_kernel.dylib 0x000000019591bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001959b5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x00000001959b4fa4 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x000000019591bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001959b5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x00000001959b4fa4 start_wqthread + 0
Thread 4:
0 libsystem_kernel.dylib 0x000000019591bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001959b5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x00000001959b4fa4 start_wqthread + 0
Thread 5 name: com.crashlytics.MachExceptionServer
Thread 5:
0 libsystem_kernel.dylib 0x0000000195900e7c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000195900cf4 mach_msg + 68
2 [] 0x00000001000fca00 CLSMachExceptionServer + 128
3 libsystem_pthread.dylib 0x00000001959b7e7c _pthread_body + 160
4 libsystem_pthread.dylib 0x00000001959b7dd8 _pthread_start + 156
5 libsystem_pthread.dylib 0x00000001959b4fac thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x000000019591bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001959b5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x00000001959b4fa4 start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x000000019591bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001959b5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x00000001959b4fa4 start_wqthread + 0
Thread 8 name: com.apple.NSURLConnectionLoader
Thread 8:
0 libsystem_kernel.dylib 0x0000000195900e7c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000195900cf4 mach_msg + 68
2 CoreFoundation 0x0000000184b6d804 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000184b6b758 __CFRunLoopRun + 936
4 CoreFoundation 0x0000000184a99660 CFRunLoopRunSpecific + 392
5 CFNetwork 0x000000018459a054 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
6 Foundation 0x0000000185a82608 __NSThread__main__ + 1068
7 libsystem_pthread.dylib 0x00000001959b7e7c _pthread_body + 160
8 libsystem_pthread.dylib 0x00000001959b7dd8 _pthread_start + 156
9 libsystem_pthread.dylib 0x00000001959b4fac thread_start + 0
Thread 9 name: com.apple.CFSocket.private
Thread 9:
0 libsystem_kernel.dylib 0x000000019591b498 __select + 8
1 CoreFoundation 0x0000000184b731fc __CFSocketManager + 656
2 libsystem_pthread.dylib 0x00000001959b7e7c _pthread_body + 160
3 libsystem_pthread.dylib 0x00000001959b7dd8 _pthread_start + 156
4 libsystem_pthread.dylib 0x00000001959b4fac thread_start + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000001 x3: 0x00000001958315e4
x4: 0x000000016fd49928 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000a50
x8: 0x0000000199477360 x9: 0x000000019946b050 x10: 0x0000000000000000 x11: 0x000000000000000f
x12: 0x0000000000000001 x13: 0x000000000003dbd4 x14: 0x0000000000000015 x15: 0x0000000000000000
x16: 0x0000000000000025 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x000000000000000b
x20: 0x0000000000000003 x21: 0x000000016fd49928 x22: 0x000000016fd498c0 x23: 0x00000001001766f0
x24: 0x000000017805b1e0 x25: 0x0000000178053ad0 x26: 0x000000017804f5d0 x27: 0x0000000178053ad0
x28: 0x000000017822cc00 fp: 0x000000016fd49890 lr: 0x000000010010c408
sp: 0x000000016fd49840 pc: 0x000000019591a964 cpsr: 0x00000000
答案 0 :(得分:1)
在发布版本中,如果用户界面收到超过约2秒无法处理的输入,则会终止该应用。我敢打赌,这就是在这种情况下发生的事情。