1

我有一个应用程序会定期为客户端崩溃。我无法复制崩溃,但我能够从客户端获得错误日志,我希望有人能指出我应该查看的正确方向。这是少数崩溃报告,大多数其他崩溃报告都是低内存事件。如果重要,该应用程序会使用 ARC。

我是新手,所以我只需要指出正确的方向,最好是善意的:)

Incident Identifier: C21570BF-3E76-44DD-BEB1-03FDA4A12750
CrashReporter Key:   ebcd6d296e2badb36644f9abfdae158007ba680e
Hardware Model:      iPad2,1
Process:         APP_NAME [106]
Path:            /var/mobile/Applications/F083D896-D881-4F8F-81FE-44BDA9C072EA/APP_NAME.app/APP_NAME
Identifier:      APP_NAME
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-05-17 14:26:42.639 -0700
OS Version:      iOS 6.1.3 (10B329)
Report Version:  104

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

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3b46b5b0 objc_msgSend + 16
1   UIKit                           0x35566080 -[UIAlertView(Private) _performPopup:animationType:revealedBySpringBoardAlert:] + 504
2   UIKit                           0x35582f28 -[UIAlertView(Private) _repopup] + 76
3   UIKit                           0x3556cbd4 -[UIAlertView(Private) _removeAlertWindowOrShowAnOldAlert] + 192
4   UIKit                           0x3556c996 -[UIAlertView(Private) _popoutAnimationDidStop:finished:] + 590
5   UIKit                           0x35429aae -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 154
6   UIKit                           0x3549e8ea -[UIViewAnimationState animationDidStop:finished:] + 46
7   QuartzCore                      0x351d3bfc CA::Layer::run_animation_callbacks(void*) + 204
8   libdispatch.dylib               0x3b8874b4 _dispatch_client_callout + 20
9   libdispatch.dylib               0x3b88c1b8 _dispatch_main_queue_callback_4CF$VARIANT$mp + 220
10  CoreFoundation                  0x335dff36 __CFRunLoopRun + 1286
11  CoreFoundation                  0x33552eb8 CFRunLoopRunSpecific + 352
12  CoreFoundation                  0x33552d44 CFRunLoopRunInMode + 100
13  GraphicsServices                0x371092e6 GSEventRunModal + 70
14  UIKit                           0x354682fc UIApplicationMain + 1116
15  APP_NAME                            0x000bd492 main (main.m:16)
16  libdyld.dylib                   0x3b8a7b1c start + 0
4

1 回答 1

1

我现在意识到这个问题的框架不是很好。

我正在使用 AFNetworking 将文件上传到服务器。我正在使用:

NSData *videoData = [NSData dataWithContentsOfURL:[NSURL URLWithString:video.filename]];
NSMutableURLRequest *request = [[AppApiManager sharedManager] multipartFormRequestWithMethod:@"POST" path:@"videos/upload" parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData>formData) {
[formData appendPartWithFileData:videoData name:@"video_filename" fileName:@"ipad-video.mov" mimeType:@"video/quicktime"];
}];

因此,基本上,我将内存分配给该视频文件的大小。解决方案是使用不同的方法将文件附加到从磁盘流式传输的表单请求:

-appendPartWithFileURL:name:fileName:mimeType:error: will stream data directly from the file, making memory allocation beforehand unnecessary.

长话短说,我完全忽略了分配给 NSData 的所有内存

于 2014-01-24T19:16:12.767 回答