Crashes has been reported when using mongodb modules compiled with mongo-c-driver having ssl enabled. Using mongo-c-driver without ssl enabled doesn't expose the issue.
To investigate mongo-c-driver sources and see if it is messing up with the memory manager set for libssl.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/660
Just for tracking Using kamailio 4.4.1 *with mongo-c-driver-1.2.4 - with driver compiled with --enable-ssl=yes => segfault - with driver compiled with --enable-ssl=no => working but may break compatibility to connect to mongodb 3.x requiring advanced authentication. In latest driver 1.3.5 code has been added for TLS certificates checks but also locking between threads but * with mongo-c-driver-1.3.5 with --enable-ssl=yes => segfault
Notes : tls.so module is using it's own locking functions for Openssl, and also mongo-c-driver.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/660#issuecomment-226409774
@lglayal -- can you give here the backtrace from gdb when you get the crash with mongo-c-driver-1.3.5 with --enable-ssl=yes ?
I was digging a bit in mongodb-c-driver and looks like they don't set the locking functions if they are already set:
``` static void _mongoc_openssl_thread_startup (void) { int i;
gMongocOpenSslThreadLocks = (mongoc_mutex_t *)OPENSSL_malloc (CRYPTO_num_locks () * sizeof (mongoc_mutex_t));
for (i = 0; i < CRYPTO_num_locks (); i++) { mongoc_mutex_init(&gMongocOpenSslThreadLocks[i]); }
if (!CRYPTO_get_locking_callback ()) { CRYPTO_set_locking_callback (_mongoc_openssl_thread_locking_callback); CRYPTO_set_id_callback (_mongoc_openssl_thread_id_callback); } } ```
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/660#issuecomment-231307672