如何从valgrind中抑制openssl

如何从valgrind中抑制openssl,openssl,valgrind,Openssl,Valgrind,我正在使用openssl库。 我从valgrind那里得到很多警告 ==923== Conditional jump or move depends on uninitialised value(s) ==923== at 0x66614C: ssl3_get_finished (in ./app.out) ==923== by 0x65FA39: ssl3_connect (in ./app.out) ==923== by 0x63A9E4: ossl_connect_com

我正在使用openssl库。 我从valgrind那里得到很多警告

==923== Conditional jump or move depends on uninitialised value(s)
==923==    at 0x66614C: ssl3_get_finished (in ./app.out)
==923==    by 0x65FA39: ssl3_connect (in ./app.out)
==923==    by 0x63A9E4: ossl_connect_common (in ./app.out)
==923==    by 0x63C054: Curl_ossl_connect (in ./app.out)
==923==    by 0x625DA6: Curl_ssl_connect (in ./app.out)
==923==    by 0x62B2BF: Curl_http_connect (in ./app.out)
==923==    by 0x6372ED: Curl_protocol_connect (in ./app.out)
==923==    by 0x637599: Curl_setup_conn (in ./app.out)
==923==    by 0x637643: Curl_connect (in ./app.out)
==923==    by 0x640A70: Curl_do_perform (in ./app.out)

==923== 
==923== Syscall param write(buf) points to uninitialised byte(s)
==923==    at 0x507ECCD: ??? (syscall-template.S:82)
==923==    by 0x6859EC: sock_write (in ./app.out)
==923==    by 0x583A86: BIO_write (in ./app.out)
==923==    by 0x6640AF: ssl3_write_pending (in ./app.out)
==923==    by 0x664734: ssl3_write_bytes (in ./app.out)
==923==    by 0x63891D: ossl_send (in ./app.out)
==923==    by 0x62F4B1: Curl_write (in ./app.out)
==923==    by 0x62BFF5: Curl_add_buffer_send (in ./app.out)
==923==    by 0x62DE8F: Curl_http (in ./app.out)
==923==    by 0x6378AA: Curl_do (in ./app.out)
==923==    by 0x640AE8: Curl_do_perform (in ./app.out)

==923==  Address 0xa2262ca is 490 bytes inside a block of size 17,584 alloc'd
==923==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==923==    by 0x581B93: CRYPTO_malloc (in ./app.out)
==923==    by 0x666B6F: ssl3_setup_write_buffer (in ./app.out)
==923==    by 0x666BD6: ssl3_setup_buffers (in ./app.out)
==923==    by 0x666E63: ssl23_connect (in ./app.out)
==923==    by 0x63A9E4: ossl_connect_common (in ./app.out)
==923==    by 0x63C054: Curl_ossl_connect (in ./app.out)
==923==    by 0x625DA6: Curl_ssl_connect (in ./app.out)
==923==    by 0x62B2BF: Curl_http_connect (in ./app.out)
==923==    by 0x6372ED: Curl_protocol_connect (in ./app.out)
==923==    by 0x637599: Curl_setup_conn (in ./app.out)
==923==    by 0x637643: Curl_connect (in ./app.out)
==923== 

有什么方法可以禁止valgrind发出此警告吗?

如果可以重建openssl,可以使用-DPURIFY来消除这些警告,请参阅openssl。@ks1322那么我是否需要使用-DPURIFY only valgrind进行编译,或者在发布版本中使用目标库没有问题。是,openssl使用未初始化的缓冲区来生成随机数,这是正常的,这就是Valgrind所抱怨的-DPURIFY应仅用于调试,例如不要错过其他Valgrind警告。解释了如何使用Valgrind的API进行测试,但我自己还没有测试过