Opening a database with TLS and then exiting can cause client crashes
Open
bug
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 1.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 126
Description
This appears to be due to the fact that OpenSSL uses an atexit handler to free static resources, and this races with the still executing network thread. AJ found this issue was [already reported upstream](https://github.com/openssl/openssl/issues/6214).
The suggested fix is to call `OPENSSL_init_crypto()` with `OPENSSL_INIT_NO_ATEXIT` in `startNetworkThread()`, which will not register the handler. We should then call `OPENSSL_cleanup()` in `stopNetworkThread()`.
Contributor guide
Assessment
This issue has not been assessed yet.