Crash when removing network extension

Our application uses NEFilterPacketProvider to filter network traffic and we sometimes get a wired crash when removing/updating the network extension.

It only happens on MacOS 11-12 .

The crashing thread is always this one and it shows up after I call the completionHandler from the stopFilter func


Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: Release of a suspended object

Thread 6 Crashed:: Dispatch queue: com.apple.network.connections
0   libdispatch.dylib             	0x00007fff2039cc35 _dispatch_queue_xref_dispose.cold.1 + 24
1   libdispatch.dylib             	0x00007fff20373808 _dispatch_queue_xref_dispose + 50
2   libdispatch.dylib             	0x00007fff2036e2eb -[OS_dispatch_source _xref_dispose] + 17
3   libnetwork.dylib              	0x00007fff242b5999 __nw_queue_context_create_source_block_invoke + 41
4   libdispatch.dylib             	0x00007fff2036d623 _dispatch_call_block_and_release + 12
5   libdispatch.dylib             	0x00007fff2036e806 _dispatch_client_callout + 8
6   libdispatch.dylib             	0x00007fff203711b0 _dispatch_continuation_pop + 423
7   libdispatch.dylib             	0x00007fff203811f4 _dispatch_source_invoke + 1181
8   libdispatch.dylib             	0x00007fff20376318 _dispatch_workloop_invoke + 1784
9   libdispatch.dylib             	0x00007fff2037ec0d _dispatch_workloop_worker_thread + 811
10  libsystem_pthread.dylib       	0x00007fff2051545d _pthread_wqthread + 314
11  libsystem_pthread.dylib       	0x00007fff2051442f start_wqthread + 15

I do have a DispatchSourceTimer but I cancel it in the stop func.

Any ideas on how to tackle this?

Please post a full Apple crash report, per the advice in Posting a Crash Report.

Share and Enjoy

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

Crash when removing network extension
 
 
Q