Error loading system extension

Hi,

I have tried to compile & execute the sample NetworkFilter project from here:

https://developer.apple.com/documentation/networkextension/filtering_network_traffic


But when executing the app, I keep getting crashes from sysextd and system extension is not loaded at all:

Time Awake Since Boot: 10000 seconds


System Integrity Protection: disabled


Crashed Thread:        1  Dispatch queue: sysextd.extension_manager


Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY


Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [1951]


Application Specific Information:
dyld3 mode
Fatal error: failed to get unique identifier: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/SystemExtensions_executables/SystemExtensions-29/core/code_signing.swift, line 45

...

Thread 1 Crashed:: Dispatch queue: sysextd.extension_manager
0   libswiftCore.dylib            0x00007fff6f3064fd specialized _assertionFailure(_:_:file:line:flags:) + 509
1   libswiftCore.dylib            0x00007fff6f0fa169 _assertionFailure(_:_:file:line:flags:) + 25
2   sysextd                        0x0000000108d0c9ca 0x108ce2000 + 174538
3   sysextd                        0x0000000108d0dd2e 0x108ce2000 + 179502
4   sysextd                        0x0000000108d0df1f 0x108ce2000 + 179999
5   sysextd                        0x0000000108ce77dd 0x108ce2000 + 22493
6   sysextd                        0x0000000108ce7458 0x108ce2000 + 21592
7   libxpc.dylib                  0x00007fff6fe94298 _xpc_connection_call_event_handler + 56
8   libxpc.dylib                  0x00007fff6fe92488 _xpc_connection_mach_event + 927
9   libdispatch.dylib              0x00007fff6fbf96ae _dispatch_client_callout4 + 9
10  libdispatch.dylib              0x00007fff6fc0eb8b _dispatch_mach_msg_invoke + 435
11  libdispatch.dylib              0x00007fff6fbfea84 _dispatch_lane_serial_drain + 263
12  libdispatch.dylib              0x00007fff6fc0f6de _dispatch_mach_invoke + 481
13  libdispatch.dylib              0x00007fff6fbfea84 _dispatch_lane_serial_drain + 263
14  libdispatch.dylib              0x00007fff6fbff556 _dispatch_lane_invoke + 363
15  libdispatch.dylib              0x00007fff6fc08bc5 _dispatch_workloop_worker_thread + 582
16  libsystem_pthread.dylib        0x00007fff6fe52860 _pthread_wqthread + 336
17  libsystem_pthread.dylib        0x00007fff6fe5269b start_wqthread + 15


Same happened to me when trying to create a basic system extension using EndpointSecurity framework.


Needless to say I am trying execution on a SIP disabled machine.


What am I doing wrong? I tried also compiling without signing, but it seems signing is essential in order to set app entitlements. Am I missing something?