grpc / grpc

The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io
Apache License 2.0
41.97k stars 10.56k forks source link

OpenSSL cleanup #22608

Closed hdnn closed 4 years ago

hdnn commented 4 years ago

What version of gRPC and what language are you using?

1.23.0

What did you do?

My application use gRPC(with secured channel) and another library(UA-AnsiC) that also use OpenSSL. When gRPC client make first request to server, it call init_openssl() function from ssl_transport_security.cc that call CRYPTO_set_id_callback() OpenSSL function. On application shutdown step, gRPC exit first without any deinit\cleanup of OpenSSL. So, when second lib doing OpenSSL_Cleanup, application will crashed with access violation on next lines

//cryptlib.c:499
if (id_callback) {
        CRYPTO_THREADID_set_numeric(id, id_callback());
        return;
    }

What did you expect to see?

At least CRYPTO_set_id_callback(nullptr); should be called in time gRPC library unloading.

What did you see instead?

Application crash in case gRPC works with another another library that use OpenSSL

stale[bot] commented 4 years ago

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!