gpt4 book ai didi

iOS 6.1.3 EXC_BAD_ACCESS KERN_INVALID_ADDRESS

转载 作者:行者123 更新时间:2023-11-29 13:13:01 25 4
gpt4 key购买 nike

我有一个客户端周期性崩溃的应用程序。我无法重现崩溃,但我能够从客户端获得错误日志,我希望有人能指出我应该查看的正确方向。这是少数崩溃报告,大多数其他崩溃报告都是低内存事件。如果重要,应用程序会使用 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

最佳答案

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

我正在使用 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 的所有内存

关于iOS 6.1.3 EXC_BAD_ACCESS KERN_INVALID_ADDRESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16723908/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com