datatheorem / TrustKit

Easy SSL pinning validation and reporting for iOS, macOS, tvOS and watchOS.
MIT License
2k stars 360 forks source link

Crash at [TSKNSURLConnectionDelegateProxy swizzleNSURLConnectionConstructors:] TSKNSURLConnectionDelegateProxy.m:103 #285

Open emarashliev opened 2 years ago

emarashliev commented 2 years ago

Hello guy, we have the next crash:

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.myApp>:99955] failed to terminate gracefully after 5.0s
ProcessVisibility: Unknown
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 4.930 (user 3.310, system 1.620), 16% CPU",
"Elapsed application CPU time (seconds): 0.019, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Kernel Triage:
VM - pmap_enter failed with resource shortage
Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001f5a8f4dc semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib               0x00000001bdcc0fcc _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib               0x00000001bdcc1674 _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   CFNetwork                       0x00000001be854b88 CFURLConnectionSendSynchronousRequest + 380 (CFURLConnection_Synchronous.c:209)
4   CFNetwork                       0x00000001be8ff3f8 +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 120 (NSURLConnection.mm:480)
5   MyApp                               0x000000010541614c __70+[TSKNSURLConnectionDelegateProxy swizzleNSURLConnectionConstructors:]_block_invoke_2.38 + 184 (TSKNSURLConnectionDelegateProxy.m:103)
6   MyApp                               0x00000001055b759c __swizzleNSURLConnectionSendSynchronousRequest_block_invoke + 476 (CRNSURLConnectionDelegateProxy.m:556)
7   Foundation                      0x00000001bf8615d4 -[NSData(NSData) initWithContentsOfURL:options:maxLength:error:] + 280 (NSData.m:894)

The first crash appeared around one year ago. Any ideas or help what could be? Seem like the problem comes from the swizzled code by RSSwizzleClassMethod in TSKNSURLConnectionDelegateProxy.m:103 https://github.com/datatheorem/TrustKit/blob/0617d99b534de6adb632ada2475ca8c20c644736/TrustKit/Swizzling/TSKNSURLConnectionDelegateProxy.m#L102-L113 Does anyone have the same crash?