The following call to getaddrinfo makes ‘PacketTunnelProvider’ system extension SIGSEGV:
if (hostname != NULL) {
int ret = getaddrinfo(hostname, port, &hints, results);
if (ret != 0) {
printf(“Failed to resolve host : %s by getaddrinfo, err : %d", hostname, ret);
return false;
}
}
Most of the time getaddrinfo() is working fine. Can someone please help in understanding what could be causing this crash.
Can this caused due to stack corruption due to C++/C code switched to objective C?
Below is the crash details:
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: com.mycompany.client.product-Client.ui.pkttunnel [29951]
Path: /Library/SystemExtensions/*/com.mycompany.client.product-Client.ui.pkttunnel
Identifier: com.mycompany.client.product-Client.ui.pkttunnel
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 0
Date/Time: 2023-08-18 20:04:43.6346 +0530
OS Version: macOS 13.5 (22G74)
Report Version: 12
Bridge OS Version: 7.6 (20P6072)
Anonymous UUID: F235BB2F-C030-0A58-E5C1-C3FE9796F29C
Sleep/Wake UUID: C73181BF-B3A9-4DED-9556-897ED8C2E0A1
Time Awake Since Boot: 65000 seconds
Time Since Wake: 37781 seconds
System Integrity Protection: enabled
Crashed Thread: 2
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000001e13dfa50
Exception Codes: 0x0000000000000001, 0x00000001e13dfa50
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [29951]
VM Region Info: 0x1e13dfa50 is not in any region. Bytes after previous region: 3477011025 Bytes before following region: 105545042363824
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
shared memory 111fef000-111ff0000 [ 4K] rw-/rw- SM=SHM
---> GAP OF 0x5ffeee010000 BYTES
MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV
Thread 0:
0 libsystem_kernel.dylib 0x7ff80ee222b2 __sigsuspend_nocancel + 10
1 libdispatch.dylib 0x7ff80eccbd2f _dispatch_sigsuspend + 36
2 libdispatch.dylib 0x7ff80eccbd0b _dispatch_sig_thread + 49
Thread 1:
********************
********************
********************
********************
Thread 2 Crashed:
0 libobjc.A.dylib 0x7ff80eac64a9 objc_msgSend + 41
1 libobjc.A.dylib 0x7ff80eae6582 objc_object::sidetable_release(bool, bool) + 270
2 Network 0x7ff81553fa04 -[NWConcrete_nw_endpoint .cxx_destruct] + 52
3 libobjc.A.dylib 0x7ff80eacfa5b object_cxxDestructFromClass(objc_object*, objc_class*) + 83
4 libobjc.A.dylib 0x7ff80eac8e31 objc_destructInstance + 99
5 libobjc.A.dylib 0x7ff80eac8dbf _objc_rootDealloc + 62
6 Network 0x7ff81553e05a -[NWConcrete_nw_endpoint dealloc] + 778
7 Network 0x7ff815c30f1a -[NWOSAddressEndpoint dealloc] + 74
8 Network 0x7ff815a175bf nw_array_dispose + 383
9 Network 0x7ff815718ab1 -[OS_nw_array dealloc] + 17
10 Network 0x7ff815bd2b3d -[NWConcrete_nw_path .cxx_destruct] + 93
11 libobjc.A.dylib 0x7ff80eacfa5b object_cxxDestructFromClass(objc_object*, objc_class*) + 83
12 libobjc.A.dylib 0x7ff80eac8e31 objc_destructInstance + 99
13 libobjc.A.dylib 0x7ff80eac8dbf _objc_rootDealloc + 62
14 Network 0x7ff815bd29af -[NWConcrete_nw_path dealloc] + 127
15 Network 0x7ff815bd045a -[NWConcrete_nw_path_evaluator .cxx_destruct] + 58
16 libobjc.A.dylib 0x7ff80eacfa5b object_cxxDestructFromClass(objc_object*, objc_class*) + 83
17 libobjc.A.dylib 0x7ff80eac8e31 objc_destructInstance + 99
18 libobjc.A.dylib 0x7ff80eac8dbf _objc_rootDealloc + 62
19 Network 0x7ff815bd0377 -[NWConcrete_nw_path_evaluator dealloc] + 967
20 Network 0x7ff815a606ca nw_nat64_get_interface_state_internal + 2634
21 Network 0x7ff815a5f905 nw_nat64_copy_prefixes_internal + 101
22 Network 0x7ff815a5f482 nw_nat64_copy_prefixes + 210
23 Network 0x7ff815a62537 nw_nat64_synthesize + 215
24 libsystem_info.dylib 0x7ff80ee9447e _gai_nat64_synthesis + 309
25 libsystem_info.dylib 0x7ff80ee940c2 si_addrinfo + 886
26 libsystem_info.dylib 0x7ff80ee93caf getaddrinfo + 176
27 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3c2bb4 ******::resolvehostname(char const*, char const*, addrinfo, addrinfo**) + 32
28 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3c4e57 ******::udp_connect() + 323
29 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3c48c7 ******::ssl_create() + 129
30 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3c9014 ******::ssl_initiate_connect(fd_set&, fd_set&, int&) + 288
31 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3c3b3c ******::ssl_connect_thread(int) + 228
32 com.mycompany.client.product-Client.ui.pkttunnel 0x10f3cc691 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(int), int>>(void*) + 39
33 libsystem_pthread.dylib 0x7ff80ee5b1d3 _pthread_start + 125
34 libsystem_pthread.dylib 0x7ff80ee56bd3 thread_start + 15