NEFilterDataProvider crashing on resumeFlow

I am trying to pause NEFilterFlow and then resuming NEFilterFlow from function **handleInboundData**

let goingToApply = someFunctionWithClosure { applied in
                       if applied {
                            let verdict: NEFilterNewFlowVerdict = .allow()
                            self.resumeFlow(flow, with: verdict)
                        }
                     }
 if goingToApply == true  {
        return .pause()
  }                       

The line self.resumeFlow(flow, with: verdict) crashing with following exception:

terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NEFilterNewFlowVerdict passBytes]: unrecognized selector sent to instance 0x10b8662a0'

Crash dump showing below logs:

Thread 3 Crashed::  Dispatch queue: NEFilterExtensionProviderContext queue
0   libsystem_kernel.dylib        	       0x1b7aa6d78 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1b7adbee0 pthread_kill + 288
2   libsystem_c.dylib             	       0x1b7a16340 abort + 168
3   libc++abi.dylib               	       0x1b7a96b18 abort_message + 132
4   libc++abi.dylib               	       0x1b7a86a54 demangling_terminate_handler() + 336
5   libobjc.A.dylib               	       0x1b797c320 _objc_terminate() + 144
6   libc++abi.dylib               	       0x1b7a95eb4 std::__terminate(void (*)()) + 20
7   libc++abi.dylib               	       0x1b7a95e50 std::terminate() + 64
8   libdispatch.dylib             	       0x1b79181c8 _dispatch_client_callout + 40
9   libdispatch.dylib             	       0x1b791f8a8 _dispatch_lane_serial_drain + 668
10  libdispatch.dylib             	       0x1b7920404 _dispatch_lane_invoke + 392
11  libdispatch.dylib             	       0x1b792ac98 _dispatch_workloop_worker_thread + 648
12  libsystem_pthread.dylib       	       0x1b7ad8360 _pthread_wqthread + 288
13  libsystem_pthread.dylib       	       0x1b7ad7080 start_wqthread + 8

Why this exception is occurring for .allow() verdict only. For .drop() it is not crashing. No where i'm calling passBytes method on NEFilterNewFlowVerdict

Accepted Reply

You seem to be passing an NEFilterNewFlowVerdict to resumeFlow(_:with:). In this case I think it’s expecting an NEFilterDataVerdict.

Share and Enjoy

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

Replies

Crash dump showing below logs:

Please post the full crash report. See Posting a Crash Report for advice on how to do that.

Share and Enjoy

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

Hi Eskimo, Please find the crash dumps attached.

You seem to be passing an NEFilterNewFlowVerdict to resumeFlow(_:with:). In this case I think it’s expecting an NEFilterDataVerdict.

Share and Enjoy

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