I’m trying to run this example but I’m getting a segmentation fault, as per the trace below. This example was compiled with the C-SDK from github. The config file is a json created based on this answer, and looks like this:
{"protocol":"tcp", "address":"httpbin.org","port":80}
Best,
valgrind ./host server config.json host
==151202== Memcheck, a memory error detector
==151202== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==151202== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==151202== Command: ./host server config.json host
==151202==
Running as server
==151202== Invalid read of size 1
==151202== at 0x484BD06: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==151202== by 0x4A12D51: strdup (strdup.c:41)
==151202== by 0x48BCFA6: ziti_init_opts (in /usr/lib/libziti.so)
==151202== by 0x48BE1BB: ziti_init (in /usr/lib/libziti.so)
==151202== by 0x109CDE: main (in /home/fernando/Documents/vortex/ziti/host)
==151202== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==151202==
==151202==
==151202== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==151202== Access not within mapped region at address 0x0
==151202== at 0x484BD06: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==151202== by 0x4A12D51: strdup (strdup.c:41)
==151202== by 0x48BCFA6: ziti_init_opts (in /usr/lib/libziti.so)
==151202== by 0x48BE1BB: ziti_init (in /usr/lib/libziti.so)
==151202== by 0x109CDE: main (in /home/fernando/Documents/vortex/ziti/host)
==151202== If you believe this happened as a result of a stack
==151202== overflow in your program's main thread (unlikely but
==151202== possible), you can try to increase the size of the
==151202== main thread stack using the --main-stacksize= flag.
==151202== The main thread stack size used in this run was 8388608.
==151202==
==151202== HEAP SUMMARY:
==151202== in use at exit: 1,304 bytes in 4 blocks
==151202== total heap usage: 8 allocs, 4 frees, 11,046 bytes allocated
==151202==
==151202== LEAK SUMMARY:
==151202== definitely lost: 0 bytes in 0 blocks
==151202== indirectly lost: 0 bytes in 0 blocks
==151202== possibly lost: 0 bytes in 0 blocks
==151202== still reachable: 1,304 bytes in 4 blocks
==151202== suppressed: 0 bytes in 0 blocks
==151202== Rerun with --leak-check=full to see details of leaked memory
==151202==
==151202== For lists of detected and suppressed errors, rerun with: -s
==151202== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
[1] 151202 segmentation fault (core dumped) valgrind ./host server config.json host