In a project where thrift is used, i was investigating a core in an assertion in apache::thrift::concurrency::~Mutex (pthread variety). The mutex in question was one of the locking mutexes that thrift gives to openssl. The core occurred in TSSLSocket::cleanupOpenSSL() where the mutexes are destroyed (on the last line).
I suspect that we might be changing the locking callbacks too early in the cleanup process; perhaps one of the other cleanup calls that follows it would have released a mutex in some situations? In any case, this needs to be investigated and I am assigning it to myself.