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"

I've attached the .ips file as a .txt file.

Perfect!

I was hoping that would lead to a relevant historical bug. Sadly, that didn’t pan out. It highlighted some bugs, but none of them look relevant to this problem.

You said you’re seeing this on macOS 11 and 12. That crash report was from macOS 12. Have you got one from macOS 11? If so, please post that.

Share and Enjoy

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

Sorry for the delay, I've attached the crash from macos 11. You mentioned a historical bug, can you tell me about it, maybe it fits somewhere

I've attached the crash from macos 11.

That’s a human readable one. Do you have the JSON version? That’s what I was looking for.

You mentioned a historical bug, can you tell me about it

Ah, sorry, that was misleading. My hope is that a different crash report might be able to lead me to a historical bug about this issue. Clearly that was a bug that’s been fixed, but look for fixed bugs is like looking for a needle in a haystack. A crash report might allow me to track it down easily. If you can’t find a JSON crash report from macOS 11, that rules out that option. And even if you can, there’s no guarantee of success.

Share and Enjoy

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

Here is the crash file that you requested, it is similar to the macos 12 one

Hmmm, that’s the human readable file. Do you have the JSON version of it?

The file you attached here shows the format I’m looking for.

Share and Enjoy

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

Crash when removing network extension
 
 
Q