ClickHouse / ClickHouse

ClickHouse® is a real-time analytics DBMS
https://clickhouse.com
Apache License 2.0
36.67k stars 6.78k forks source link

LeakSanitizer: detected memory leaks in OpenSSL (again) #67624

Open Algunenano opened 1 month ago

Algunenano commented 1 month ago

https://s3.amazonaws.com/clickhouse-test-reports/0/453ee52f866027d66f80e0b316c685dcdfd127a6/stress_test__asan_/run.log

Check the logs at the end:

Multiple similar reports:

=================================================================
==61299==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x55764d4bf4cf in malloc (/usr/bin/clickhouse+0xa8844cf) (BuildId: e1b56ac6b8ca3ae83128353e15ac1fee025f9f7b)
    #1 0x55767b4f239e in CRYPTO_malloc build_docker/./contrib/openssl/crypto/mem.c:202:11
    #2 0x55767b4f239e in CRYPTO_zalloc build_docker/./contrib/openssl/crypto/mem.c:222:11
    #3 0x55767b54c0af in EVP_RAND_CTX_new build_docker/./contrib/openssl/crypto/evp/evp_rand.c:353:11
    #4 0x55767b54eedb in rand_new_drbg build_docker/./contrib/openssl/crypto/rand/rand_lib.c:665:11
    #5 0x55767b54e37b in RAND_get0_private build_docker/./contrib/openssl/crypto/rand/rand_lib.c:827:16
    #6 0x55767b54e24f in RAND_priv_bytes_ex build_docker/./contrib/openssl/crypto/rand/rand_lib.c:356:12
    #7 0x55767b2435f8 in SSL_CTX_new_ex build_docker/./contrib/openssl/ssl/ssl_lib.c:4016:13
    #8 0x5576768958e6 in Poco::Net::Context::createSSLContext() build_docker/./base/poco/NetSSL_OpenSSL/src/Context.cpp
    #9 0x5576768924f4 in Poco::Net::Context::init(Poco::Net::Context::Params const&) build_docker/./base/poco/NetSSL_OpenSSL/src/Context.cpp:233:2
    #10 0x557676892315 in Poco::Net::Context::Context(Poco::Net::Context::Usage, Poco::Net::Context::Params const&) build_docker/./base/poco/NetSSL_OpenSSL/src/Context.cpp:55:2

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x55764d4bf4cf in malloc (/usr/bin/clickhouse+0xa8844cf) (BuildId: e1b56ac6b8ca3ae83128353e15ac1fee025f9f7b)
    #1 0x55767b4f239e in CRYPTO_malloc build_docker/./contrib/openssl/crypto/mem.c:202:11
    #2 0x55767b4f239e in CRYPTO_zalloc build_docker/./contrib/openssl/crypto/mem.c:222:11
    #3 0x55767b54c0af in EVP_RAND_CTX_new build_docker/./contrib/openssl/crypto/evp/evp_rand.c:353:11
    #4 0x55767b54eedb in rand_new_drbg build_docker/./contrib/openssl/crypto/rand/rand_lib.c:665:11
    #5 0x55767b54e37b in RAND_get0_private build_docker/./contrib/openssl/crypto/rand/rand_lib.c:827:16
    #6 0x55767b54e24f in RAND_priv_bytes_ex build_docker/./contrib/openssl/crypto/rand/rand_lib.c:356:12
    #7 0x55767b2435f8 in SSL_CTX_new_ex build_docker/./contrib/openssl/ssl/ssl_lib.c:4016:13
    #8 0x5576773459bd in ossl_connect_common openssl.c
    #9 0x557677338d23 in ssl_cf_connect vtls.c
    #10 0x55767723a91f in cf_setup_connect connect.c
Algunenano commented 1 month ago

Addressed in https://github.com/ClickHouse/ClickHouse/pull/65863

nickitat commented 3 weeks ago

https://s3.amazonaws.com/clickhouse-test-reports/68424/80d985a690d66621dd994b9e8066788b16cfe044/stress_test__asan_.html