Crash on iOS 14.5:nw_endpoint_flow_copy_path + 44

Hi,
Apps crashed when enter foreground and want to connect with server,since iOS 14.5 released on April 27。

Crash stack like this:

Monitor Type: Mach Exception
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010
Crashed Thread: 40
Pthread id: 867350
Thread 40 Crashed:
0 libnetwork.dylib nw_endpoint_flow_copy_path + 44
1 libnetwork.dylib nw_endpoint_flow_copy_path + 40
2 libnetwork.dylib nw_endpoint_flow_connected + 320
3 libnetwork.dylib nw_flow_connected + 3668
4 libnetwork.dylib nw_socket_connect + 584
5 libnetwork.dylib nw_endpoint_flow_connect + 164
6 libnetwork.dylib nw_endpoint_flow_setup_protocols + 3272
7 libnetwork.dylib -[NWConcrete_nw_endpoint_flow startWithHandler:] + 3616
8 libnetwork.dylib nw_endpoint_handler_path_change + 10592
9 libnetwork.dylib nw_endpoint_handler_start + 1184
10 libnetwork.dylib __nw_connection_start_block_invoke + 1460
11 imeituan __innerBlockOnce_block_invoke (SCRCrashMonitor_GCD.mm:191)
12 libdispatch.dylib _dispatch_call_block_and_release + 32
13 libdispatch.dylib _dispatch_client_callout + 20
14 libdispatch.dylib _dispatch_lane_serial_drain + 620
15 libdispatch.dylib _dispatch_lane_invoke + 456
16 libdispatch.dylib _dispatch_workloop_invoke + 1680
17 libdispatch.dylib _dispatch_workloop_worker_thread + 764
18 libsystem_pthread.dylib _pthread_wqthread + 276
Enqueue thread backtrace:
0 imeituan innerBlockOnce (SCRCrashMonitor_GCD.mm:0)
1 imeituan _dispatch_async (SCRCrashMonitor_GCD.mm:0)
2 libnetwork.dylib nw_connection_start + 280
3 libnetwork.dylib tcp_connection_start + 1496
4 CFNetwork 0x0000000180b7c3bc + 168
5 CFNetwork 0x0000000180b79b80 + 2776
6 CFNetwork 0x0000000180b77918 + 1724
7 CoreFoundation _CFStreamOpen + 140
8 imeituan -[GCDAsyncSocket openStreams] (GCDAsyncSocket.m:6998)
9 imeituan __29-[GCDAsyncSocket didConnect:]_block_invoke330 (GCDAsyncSocket.m:2369)
10 imeituan __29-[GCDAsyncSocket didConnect:]_block_invoke_2 (GCDAsyncSocket.m:2396)
11 imeituan __innerBlockOnce_block_invoke (SCRCrashMonitor_GCD.mm:191)
12 libdispatch.dylib _dispatch_call_block_and_release + 32
13 libdispatch.dylib _dispatch_client_callout + 20
14 libdispatch.dylib _dispatch_lane_serial_drain + 620
15 libdispatch.dylib _dispatch_lane_invoke + 404
16 libdispatch.dylib _dispatch_workloop_worker_thread + 764
17 libsystem_pthread.dylib _pthread_wqthread + 276
18 libsystem_pthread.dylib start_wqthread + 8

if the ipv6 host is forcibly used for connection, is there any hope to reduce the occurrence of this crash?

I don’t know if the IP protocol version plays a part in this problem. Sorry.

Share and Enjoy

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

Crashed: com.apple.network.connection-23

0 libnetwork.dylib 0x182fe8c90 nw_endpoint_flow_copy_path + 40

1 libnetwork.dylib 0x183007ab0 nw_endpoint_flow_connected + 344

2 libnetwork.dylib 0x1833ffd08 nw_flow_connected + 3732

3 libnetwork.dylib 0x183288708 nw_socket_connect + 564

4 libnetwork.dylib 0x182fe82ac nw_endpoint_flow_connect + 160

5 libnetwork.dylib 0x182fe3dbc nw_endpoint_flow_setup_protocols + 3300

6 libnetwork.dylib 0x182fdb69c -[NWConcrete_nw_endpoint_flow startWithHandler:] + 3644

7 libnetwork.dylib 0x1830e0dc0 nw_endpoint_handler_path_change + 10480

8 libnetwork.dylib 0x1830e8918 nw_endpoint_handler_start + 1172

9 libnetwork.dylib 0x183442c84 __nw_connection_start_block_invoke + 1448

10 libdispatch.dylib 0x1821a22b0 _dispatch_call_block_and_release + 24

11 libdispatch.dylib 0x1821a3298 _dispatch_client_callout + 16

12 libdispatch.dylib 0x18217f344 _dispatch_lane_serial_drain$VARIANT$armv81 + 568

13 libdispatch.dylib 0x18217fe60 _dispatch_lane_invoke$VARIANT$armv81 + 452

14 libdispatch.dylib 0x182180f70 _dispatch_workloop_invoke$VARIANT$armv81 + 1560

15 libdispatch.dylib 0x18218966c _dispatch_workloop_worker_thread + 692

16 libsystem_pthread.dylib 0x1ca9b95bc _pthread_wqthread + 272

17 libsystem_pthread.dylib 0x1ca9bc86c start_wqthread + 8

can this fixed the bug ?

I’m not quite sure what you’re asking here, so here’s a recap:

  • This system bug seems to be triggered by GCDAsyncSocket. If you use Network framework directly, you won’t hit it.

  • Moreover, moving to Network framework is the right thing to do in the long term.

  • With regards Apple fixing this bug, see my post upthread.

Share and Enjoy

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

We found that this problem still exists in the release version of iOS 14.7. So… Is this problem really fixed?

Well, that’s our understanding but it seems you have evidence that we are wrong. My advice is that you put that evidence into a bug report.

Please post your bug number, just for the record.

Share and Enjoy

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

We are seeing occurrences of this crash in iOS v14.7.0 and v14.7.1 as well.

https://feedbackassistant.apple.com/feedback/9407987

Mark

So, How to Solve it? Do you have some idea? Thx.

Mark

MARK

Crash on iOS 14.5:nw_endpoint_flow_copy_path + 44
 
 
Q