request timeout (nw_hash_table_apply called with null table, dumping backtrace)

Hi All,

I'm suddenly getting request timeout errors frequently. When I run the app I am getting the following log-in console. Sometimes it works and then after 2-3 times, I'm getting request timeout errors. Does anyone know how to fix this? Or is this a bug in iOS 14.8 and 15.x?

2021-10-26 09:58:38.577117+0530 AppName[488:50389] [tcp] tcp_input [C48.1.1:3] flags=[R.] seq=449875231, ack=1694438629, win=61 state=LAST_ACK rcv_nxt=449875231, snd_una=1694438629
2021-10-26 09:58:38.581718+0530 AppName[488:50389] [tcp] tcp_input [C48.1.1:3] flags=[R] seq=449875231, ack=0, win=0 state=CLOSED rcv_nxt=449875231, snd_una=1694438629
2021-10-26 09:58:41.538216+0530 AppName[488:50389] [tcp] tcp_input [C49.1.1:3] flags=[R.] seq=1812650897, ack=2152629715, win=61 state=LAST_ACK rcv_nxt=1812650897, snd_una=2152629715
2021-10-26 09:58:41.541819+0530 AppName[488:50389] [tcp] tcp_input [C49.1.1:3] flags=[R] seq=1812650897, ack=0, win=0 state=CLOSED rcv_nxt=1812650897, snd_una=2152629715
2021-10-26 09:58:46.871426+0530 AppName[488:50391] Connection 59: received failure notification
2021-10-26 09:58:46.871744+0530 AppName[488:50391] Connection 59: failed to connect 1:60, reason -1
2021-10-26 09:58:46.871943+0530 AppName[488:50391] Connection 59: encountered error(1:60)
2021-10-26 09:58:46.875132+0530 AppName[488:50391] Task <79B1645D-5B16-4E3C-A077-0C5E3555E982>.<1> HTTP load failed, 0/0 bytes (error code: -1001 [1:60])
2021-10-26 09:58:46.877763+0530 AppName[488:50897] Task <79B1645D-5B16-4E3C-A077-0C5E3555E982>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=60, NSUnderlyingError=0x281fe3a80 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=60, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <79B1645D-5B16-4E3C-A077-0C5E3555E982>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <79B1645D-5B16-4E3C-A077-0C5E3555E982>.<1>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=GetCallURL, NSErrorFailingURLKey=GetCallURL, _kCFStreamErrorDomainKey=1}
2021-10-26 09:58:46.878487+0530 AppName[488:50096] status code: 0
2021-10-26 09:58:51.069488+0530 AppName[488:50808] [tcp] tcp_input [C51.1.1:3] flags=[R.] seq=374730860, ack=3161538488, win=61 state=LAST_ACK rcv_nxt=374730860, snd_una=3161538488
2021-10-26 09:58:51.072876+0530 AppName[488:50808] [tcp] tcp_input [C51.1.1:3] flags=[R] seq=374730860, ack=0, win=0 state=CLOSED rcv_nxt=374730860, snd_una=3161538488
2021-10-26 09:59:00.326847+0530 AppName[488:50897] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_hash_table_apply called with null table"

Replies

Consider:

2021-10-26 09:58:46.871744+0530 AppName[488:50391] Connection 59: failed to connect 1:60, reason -1

In this context 60 is ETIMEDOUT. So, the underlying TCP connection has failed with a timeout, and that’s why your NSURLSession task has failed with NSURLErrorTimedOut (-1001).

The failed to connect message suggests that this isn’t a timeout while the connection was in flight but rather a timeout during the connection process. It’s hard to glean more from this log snippet.

Seeing as this problem happens “frequently”, I recommend that you run an RVI packet trace and then, when you see this error, go back through the trace to see what happened on the ‘wire’. I suspect that this timeout is actually because your server isn’t responding, and a packet trace will either prove or disprove that theory.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

We have fixed the issue by generating a new SSL certificate.