gpt4 book ai didi

swift - 在 Alamofire DownloadRequest.dataResponseSerializer 行中看到断点崩溃 + 320

转载 作者:行者123 更新时间:2023-11-30 10:39:52 30 4
gpt4 key购买 nike

我看到极少数用户在野外发生崩溃,但它发生在 Alamofire 响应处理程序中。任何帮助表示赞赏。

感觉它可能取决于服务器端结果,但我无法确定哪个结果可能有问题......并且考虑到所有解析都在 try catch 中,我不清楚为什么这会崩溃。

以下是报告为 EXC_BREAKPOINT 的堆栈:

0  libswiftFoundation.dylib       0x23958417c __DataStorage.init(bytes:length:) + 280
1 Alamofire 0x101207ed0 specialized Data.InlineSlice.init(_:) (<compiler-generated>)
2 Alamofire 0x101207f78 specialized Data._Representation.init(_:) (<compiler-generated>)
3 Alamofire 0x1011df918 closure #1 in static DownloadRequest.dataResponseSerializer() + 320 (ResponseSerialization.swift:320)
4 Alamofire 0x1011df9f0 specialized thunk for @escaping @callee_guaranteed (@in_guaranteed URLRequest?, @guaranteed NSHTTPURLResponse?, @in_guaranteed URL?, @guaranteed Error?) -> (@owned Result<Data>) (<compiler-generated>)
5 Alamofire 0x1011dbdcc specialized closure #1 in DownloadRequest.response<A>(queue:responseSerializer:completionHandler:) + 224 (ResponseSerialization.swift:224)
6 Alamofire 0x1011bd0a0 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
7 Foundation 0x20bcbdef8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8 Foundation 0x20bbca3e0 -[NSBlockOperation main] + 72
9 Foundation 0x20bbc98c8 -[__NSOperationInternal _start:] + 740
10 Foundation 0x20bcbfc7c __NSOQSchedule_f + 272
11 libdispatch.dylib 0x20ac7a1cc _dispatch_block_async_invoke2 + 104
12 libdispatch.dylib 0x20ac997d4 _dispatch_client_callout + 16
13 libdispatch.dylib 0x20ac70c34 _dispatch_continuation_pop$VARIANT$armv81 + 404
14 libdispatch.dylib 0x20ac70314 _dispatch_async_redirect_invoke + 592
15 libdispatch.dylib 0x20ac7c9d4 _dispatch_root_queue_drain + 340
16 libdispatch.dylib 0x20ac7d248 _dispatch_worker_thread2 + 116
17 libsystem_pthread.dylib 0x20ae791b4 _pthread_wqthread + 464
18 libsystem_pthread.dylib 0x20ae7bcd4 start_wqthread + 4

使用面向 iOS 11 的 Swift 5 构建主应用程序以及 Alamofire Pod。AlamofireObjectMapper 正在使用 Swift 4 构建

使用以下 Pod:

- Alamofire (4.8.2)
- AlamofireImage (3.5.2):
- Alamofire (~> 4.8)
- AlamofireNetworkActivityIndicator (2.4.0):
- Alamofire (~> 4.8)
- AlamofireNetworkActivityLogger (2.4.0):
- Alamofire (~> 4.8)
- AlamofireObjectMapper (5.2.0):
- Alamofire (~> 4.7)

最佳答案

我也有同样的问题。就我而言,当我仅使用“数据”结构时,就会发生这种情况。错误的控制台输出如下

malloc: can't allocate region
*** mach_vm_map(size=920813568) failed (error code=3)
malloc: *** set a breakpoint in malloc_error_break to debug

“malloc:无法分配区域”与内存泄漏问题有关。

关于swift - 在 Alamofire DownloadRequest.dataResponseSerializer 行中看到断点崩溃 + 320,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57074903/

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