There is a memory problem in OpenSSL somewhere.
Valgrind output:
==9380== Invalid read of size 8
==9380== at 0x48635A5: check_free (dlerror.c:188)
==9380== by 0x4863AB1: free_key_mem (dlerror.c:221)
==9380== by 0x4863AB1: __dlerror_main_freeres (dlerror.c:239)
==9380== by 0x49DEB71: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.28.so)
==9380== by 0x482D19E: _vgnU_freeres (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so)
==9380== by 0x15C528: test_exit (test-common.c:389)
==9380== by 0x12D522: test_run_client_server.constprop.11 (test-http-payload.c:1435)
==9380== by 0x12D904: test_run_sequential (test-http-payload.c:1488)
==9380== by 0x12E5A6: test_download_server_nonblocking (test-http-payload.c:1579)
==9380== by 0x15B98D: test_run_funcs (test-common.c:282)
==9380== by 0x15C2D0: test_run (test-common.c:353)
==9380== by 0x12C647: main (test-http-payload.c:2075)
==9380== Address 0x4de7988 is 12 bytes after a block of size 12 alloc'd
==9380== at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==9380== by 0x4C5C328: CRYPTO_zalloc (mem.c:230)
==9380== by 0x4C5856D: ossl_init_get_thread_local (init.c:66)
==9380== by 0x4C5856D: ossl_init_get_thread_local (init.c:59)
==9380== by 0x4C5856D: ossl_init_thread_start (init.c:465)
==9380== by 0x4C81CB9: RAND_DRBG_get0_public (drbg_lib.c:1118)
==9380== by 0x4C81CEF: drbg_bytes (drbg_lib.c:963)
==9380== by 0x486EDF2: ssl_iostream_openssl_init (iostream-openssl.c:928)
==9380== by 0x12C56A: main_init (test-http-payload.c:2031)
==9380== by 0x12C56A: main (test-http-payload.c:2058)
==9380==
fun:backtrace_append_unwind
...
}
+{
+ <test_exit_addr8>
+ Memcheck:Addr8
+ fun:check_free
+ fun:free_key_mem
+ fun:__dlerror_main_freeres
+ fun:__libc_freeres
+ fun:_vgnU_freeres
+ fun:test_exit
+ ...
+}
+