我看到很少的用户在野外崩溃,但它发生在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)发布于 2019-07-18 14:55:35
我也有同样的问题。在我的例子中,当我只使用'Data‘结构时,就会发生这种情况。错误的控制台输出如下
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:无法分配区域”与内存泄漏问题有关。
https://stackoverflow.com/questions/57074903
复制相似问题