Crash when deallocating NEAppProxyFlow

Hello, I'm working on a Transparent Proxy and when the proxy is being stopped, I'm stopping all the flows by calling

flow.closeWriteWithError(POSIXError(.ECANCELED))
flow.closeReadWithError(POSIXError(.ECANCELED))

Then all the flows are deallocated.

When deallocating the flow the crash occurs:

OS Version:            macOS 14.1.2 (23B92)
Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x000000018c2ef704
Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [553]

Thread 32 Crashed::  Dispatch queue: <my dispatch queue>
0   CoreFoundation                	       0x18c2ef704 CF_IS_OBJC + 76
1   CoreFoundation                	       0x18c23f61c CFErrorGetDomain + 32
2   libnetworkextension.dylib     	       0x19fe56a00 flow_error_to_errno + 28
3   libnetworkextension.dylib     	       0x19fe56920 flow_handle_pending_write_requests + 216
4   libnetworkextension.dylib     	       0x19fe5667c __NEFlowDeallocate + 380
5   CoreFoundation                	       0x18c2efe28 _CFRelease + 292
6   NetworkExtension              	       0x19d208390 -[NEAppProxyFlow dealloc] + 36

Is there any way to debug what is happening and if it's related to closing the flow with POSIXError?

Thank you

That’s a mighty interesting crash you have there. I have an idea as what might be happening here, but I’d like to confirm some things. Please post a full 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'm attaching the full crash report. Thank you!

I've also created a feedback https://feedbackassistant.apple.com/feedback/19169473

thanks

Crash when deallocating NEAppProxyFlow
 
 
Q