Afnetworking: Crash on iOS 14(AFNetworking 4.0.0)

Created on 23 Oct 2020  路  13Comments  路  Source: AFNetworking/AFNetworking

Hi guy,

Have anyone help me fix this bug?

Screen Shot 2020-10-23 at 13 28 42

Most helpful comment

Wating...

All 13 comments

same issue in AFNetworking 4.0.1

Wating...

Could someone provide a demo project for this issue?

I am facing the same issue on iOS 14 devices, could anyone provide me a solution?

iOS Version: 14.0.1 (18A393)
AFNetworking: 4.0.1
Language: Objective-C

Crashed: NSOperationQueue 0x104d55550 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x1c14b4010 objc_retain + 16
1  CoreFoundation                 0x1ad305888 -[__NSDictionaryM setObject:forKeyedSubscript:] + 376
2  Abacus                         0x100b966e4 -[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:] + 183 (AFURLSessionManager.m:183)
3  Abacus                         0x100b9ae1c -[AFURLSessionManager URLSession:task:didCompleteWithError:] + 1087 (AFURLSessionManager.m:1087)
4  CFNetwork                      0x1adbdb728 _CFNetworkHTTPConnectionCacheSetLimit + 151368
5  Foundation                     0x1ae7347f4 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 24
6  Foundation                     0x1ae627120 -[NSBlockOperation main] + 104
7  Foundation                     0x1ae736bb8 __NSOPERATION_IS_INVOKING_MAIN__ + 24
8  Foundation                     0x1ae626da8 -[NSOperation start] + 808
9  Foundation                     0x1ae737624 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 24
10 Foundation                     0x1ae7370d0 __NSOQSchedule_f + 184
11 libdispatch.dylib              0x1ad028834 _dispatch_block_async_invoke2 + 148
12 libdispatch.dylib              0x1ad01aac8 _dispatch_client_callout + 20
13 libdispatch.dylib              0x1ad01dd60 _dispatch_continuation_pop + 416
14 libdispatch.dylib              0x1ad01d494 _dispatch_async_redirect_invoke + 592
15 libdispatch.dylib              0x1ad02b104 _dispatch_root_queue_drain + 356
16 libdispatch.dylib              0x1ad02b8e8 _dispatch_worker_thread2 + 116
17 libsystem_pthread.dylib        0x1f3c7c8cc _pthread_wqthread + 216
18 libsystem_pthread.dylib        0x1f3c8377c start_wqthread + 8

I am facing the same issue on iOS 14 devices, could anyone provide me a solution?
iOS Version: 14.1 (18A8395)
AFNetworking: 4.0.1
Language: Objective-C

WX20201112-163422@2x

We also have the same issue on iOS 14+ and iOS 12.2 devices.
Here also our stack trace which is quite similar to the others that are posted here:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x0000003bd22bb580
VM Region Info: 0x3bd22bb580 is in 0x1000000000-0x7000000000;  bytes after start: 188209673600  bytes before end: 224107186815
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)      fc0000000-1000000000 [  1.0G] ---/--- SM=NUL  ...(unallocated)
--->  GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
      UNUSED SPACE AT END

...


Thread 14 name:  Dispatch queue: NSOperationQueue 0x12d235210 (QOS: UNSPECIFIED)
Thread 14 Crashed:
0   libobjc.A.dylib                 0x000000019c9fe0f8 objc_msgSend + 24
1   My App                              0x000000010246ef90 0x102444000 + 176016
2   My App                              0x000000010245f1d8 0x102444000 + 111064
3   My App                          0x000000010248bfa4 0x102444000 + 294820
4   CFNetwork                       0x0000000188c81a94 0x188aa8000 + 1940116
5   Foundation                      0x00000001897f8850 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 24
6   Foundation                      0x00000001896e5740 -[NSBlockOperation main] + 104
7   Foundation                      0x00000001897faca4 __NSOPERATION_IS_INVOKING_MAIN__ + 24
8   Foundation                      0x00000001896e53c8 -[NSOperation start] + 808
9   Foundation                      0x00000001897fb74c __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 24
10  Foundation                      0x00000001897fb1d4 __NSOQSchedule_f + 184
11  libdispatch.dylib               0x00000001880aefb8 _dispatch_block_async_invoke2 + 148
12  libdispatch.dylib               0x00000001880a0db0 _dispatch_client_callout + 20
13  libdispatch.dylib               0x00000001880a412c _dispatch_continuation_pop + 416
14  libdispatch.dylib               0x00000001880a3854 _dispatch_async_redirect_invoke + 592
15  libdispatch.dylib               0x00000001880b193c _dispatch_root_queue_drain + 356
16  libdispatch.dylib               0x00000001880b2120 _dispatch_worker_thread2 + 116
17  libsystem_pthread.dylib         0x00000001d18c47c8 _pthread_wqthread + 216
18  libsystem_pthread.dylib         0x00000001d18cb75c start_wqthread + 8

@mattt

@ElfSundae If the AFNetworking keep sending requests and got no responses from the API, after a huge amount of requests, it may crashed

@Zzzzzzzack Thank you for the information, could you please provide a demo project for this case?

same issue

This issue may occur if we are not using the AFURLSessionManager as a singleton.
I call the [invalidateSessionCancelingTasks:resetSession] method after the request finished, and there's no crash any more.

same issue

Was this page helpful?
0 / 5 - 0 ratings