Multi-time initialization of openssl causes the failure of testcase "handshake_server"

12 views
Skip to first unread message

ygo...@gmail.com

unread,
Apr 30, 2019, 8:37:25 AM4/30/19
to grpc.io
Hi,
    When I run the test case "handshake_server" I randomly got an error of  "double free or corruption","Segmentation fault" or "Hang up", I write a code to regress this issue :

#include <pthread.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

void *server_thread(void *arg)
{
    SSL_load_error_strings();
    SSL_library_init();
    pthread_exit((void *)0);
}
int main()
{
    pthread_t tid;
    printf("OPENSSL_VERSION_TEXT: %s\n", OPENSSL_VERSION_TEXT);
    pthread_create(&tid, NULL, server_thread, NULL);
    SSL_load_error_strings();
    SSL_library_init();
    pthread_join(tid, NULL);
    return 0;
}
I also write a issue in here: https://github.com/grpc/grpc/issues/18900
can you point out weather it is right? thank you!
Reply all
Reply to author
Forward
0 new messages