[gnutls-devel] GnuTLS | Valgrind: Testsuite fails when libgnutls is built with -O2 (#944)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Feb 21 12:11:11 CET 2020



Tim Rühsen created an issue: https://gitlab.com/gnutls/gnutls/issues/944



This also affects the HTTPS tests in the Wget/Wget2 test suite.

This is on Debian (unstable) with gc 9.2.1 and valgrind 3.15.0.

```
CFLAGS="-O2 -g" ./configure --disable-doc --enable-valgrind-tests
make -j$(nproc)
make -j$(nproc) check
```

You'll see several tests failing. Here are some examples of the valgrind output.
```
cert.log:==585577== Conditional jump or move depends on uninitialised value(s)
cert.log:==585577==    at 0x48EBC40: decode_complex_string.isra.0 (common.c:397)
cert.log:==585577==    by 0x48EBF8B: _gnutls_x509_dn_to_string (common.c:466)
cert.log:==585577==    by 0x48F9BA7: append_elements (dn.c:160)
cert.log:==585577==    by 0x48FA027: _gnutls_x509_get_dn (dn.c:236)
cert.log:==585577==    by 0x4903F04: print_cert (output.c:1705)
cert.log:==585577==    by 0x4904C34: gnutls_x509_crt_print (output.c:2190)
cert.log:==585577==    by 0x109755: doit (cert.c:128)
cert.log:==585577==    by 0x1092E4: main (utils.c:254)
cert.log:==585577== 
cert.log:==585577== Conditional jump or move depends on uninitialised value(s)
cert.log:==585577==    at 0x48FE7A6: _gnutls_x509_read_pkalgo_params (mpi.c:247)
cert.log:==585577==    by 0x4903CF5: _gnutls_x509_crt_read_spki_params (x509_int.h:409)
cert.log:==585577==    by 0x4903CF5: print_crt_pubkey (output.c:1631)
cert.log:==585577==    by 0x4903CF5: print_cert (output.c:1782)
cert.log:==585577==    by 0x4904C34: gnutls_x509_crt_print (output.c:2190)
cert.log:==585577==    by 0x109755: doit (cert.c:128)
cert.log:==585577==    by 0x1092E4: main (utils.c:254)
cert.log:==585577== 
chainverify.log:==585663== Conditional jump or move depends on uninitialised value(s)
chainverify.log:==585663==    at 0x48FE77B: _gnutls_x509_read_pkalgo_params (mpi.c:247)
chainverify.log:==585663==    by 0x491DFA9: _gnutls_x509_verify_data (verify.c:1389)
chainverify.log:==585663==    by 0x491E60A: verify_crt (verify.c:767)
chainverify.log:==585663==    by 0x491F8B5: _gnutls_verify_crt_status (verify.c:1012)
chainverify.log:==585663==    by 0x491FF5B: gnutls_x509_crt_list_verify (verify.c:1475)
chainverify.log:==585663==    by 0x10C89E: doit (chainverify.c:170)
chainverify.log:==585663==    by 0x10C344: main (utils.c:254)
chainverify.log:==585663== 
dtls-etm.log:==586666== 16,801 bytes in 1 blocks are definitely lost in loss record 53 of 55
dtls-etm.log:==586666==    at 0x483677F: malloc (vg_replace_malloc.c:309)
dtls-etm.log:==586666==    by 0x4883FD5: _mbuffer_alloc_align16 (mbuffers.c:345)
dtls-etm.log:==586666==    by 0x488588D: _gnutls_dgram_read (buffers.c:258)
dtls-etm.log:==586666==    by 0x488588D: _gnutls_read (buffers.c:424)
dtls-etm.log:==586666==    by 0x488588D: _gnutls_io_read_buffered (buffers.c:582)
dtls-etm.log:==586666==    by 0x487BCC7: recv_headers (record.c:1173)
dtls-etm.log:==586666==    by 0x487BCC7: _gnutls_recv_in_buffers (record.c:1307)
dtls-etm.log:==586666==    by 0x487E36D: _gnutls_recv_int (record.c:1773)
dtls-etm.log:==586666==    by 0x487E36D: _gnutls_recv_int (record.c:1752)
dtls-etm.log:==586666==    by 0x10AAE1: client (dtls-etm.c:146)
dtls-etm.log:==586666==    by 0x10AD67: start (dtls-etm.c:319)
dtls-etm.log:==586666==    by 0x10AE75: doit (dtls-etm.c:340)
dtls-etm.log:==586666==    by 0x10A434: main (utils.c:254)
dtls-etm.log:==586666== 
pkcs7-gen.log:==586643== Conditional jump or move depends on uninitialised value(s)
pkcs7-gen.log:==586643==    at 0x490AD03: verify_hash_attr (pkcs7.c:799)
pkcs7-gen.log:==586643==    by 0x490AD03: figure_pkcs7_sigdata (pkcs7.c:873)
pkcs7-gen.log:==586643==    by 0x490F1E1: gnutls_pkcs7_sign (pkcs7.c:2528)
pkcs7-gen.log:==586643==    by 0x10A6F0: doit (pkcs7-gen.c:156)
pkcs7-gen.log:==586643==    by 0x10A364: main (utils.c:254)
pkcs7-gen.log:==586643== 
resume-with-previous-stek.log:==587985== 3,072 bytes in 1 blocks are definitely lost in loss record 2 of 2
resume-with-previous-stek.log:==587985==    at 0x4838D7B: realloc (vg_replace_malloc.c:836)
resume-with-previous-stek.log:==587985==    by 0x48A8E58: gnutls_realloc_fast (mem.c:56)
resume-with-previous-stek.log:==587985==    by 0x48AC522: gnutls_buffer_append_data (str.c:139)
resume-with-previous-stek.log:==587985==    by 0x48AD98D: _gnutls_buffer_append_data_prefix (str.c:943)
resume-with-previous-stek.log:==587985==    by 0x48AD98D: _gnutls_buffer_append_data_prefix (str.c:932)
resume-with-previous-stek.log:==587985==    by 0x4940BCB: session_ticket_pack (session_ticket.c:483)
resume-with-previous-stek.log:==587985==    by 0x489B962: pack_extension (hello_ext.c:496)
resume-with-previous-stek.log:==587985==    by 0x489B962: _gnutls_hello_ext_pack (hello_ext.c:529)
resume-with-previous-stek.log:==587985==    by 0x489D44B: _gnutls_session_pack (session_pack.c:171)
resume-with-previous-stek.log:==587985==    by 0x4898548: gnutls_session_get_data2 (session.c:172)
resume-with-previous-stek.log:==587985==    by 0x10AADC: client_handshake (resume-with-previous-stek.c:88)
resume-with-previous-stek.log:==587985==    by 0x10AADC: client (resume-with-previous-stek.c:119)
resume-with-previous-stek.log:==587985==    by 0x10AADC: run.constprop.0 (resume-with-previous-stek.c:235)
resume-with-previous-stek.log:==587985==    by 0x10AD5F: doit (resume-with-previous-stek.c:248)
resume-with-previous-stek.log:==587985==    by 0x10A3A4: main (utils.c:254)
resume-with-previous-stek.log:==587985== 
resume-with-previous-stek.log:==587993== 2,048 bytes in 1 blocks are definitely lost in loss record 2 of 2
resume-with-previous-stek.log:==587993==    at 0x48366AF: malloc (vg_replace_malloc.c:308)
resume-with-previous-stek.log:==587993==    by 0x4838DE7: realloc (vg_replace_malloc.c:836)
resume-with-previous-stek.log:==587993==    by 0x48A8E58: gnutls_realloc_fast (mem.c:56)
resume-with-previous-stek.log:==587993==    by 0x48AC522: gnutls_buffer_append_data (str.c:139)
resume-with-previous-stek.log:==587993==    by 0x48AD47C: _gnutls_buffer_append_prefix (str.c:765)
resume-with-previous-stek.log:==587993==    by 0x489CF51: _gnutls_session_pack (session_pack.c:105)
resume-with-previous-stek.log:==587993==    by 0x4898548: gnutls_session_get_data2 (session.c:172)
resume-with-previous-stek.log:==587993==    by 0x10AADC: client_handshake (resume-with-previous-stek.c:88)
resume-with-previous-stek.log:==587993==    by 0x10AADC: client (resume-with-previous-stek.c:119)
resume-with-previous-stek.log:==587993==    by 0x10AADC: run.constprop.0 (resume-with-previous-stek.c:235)
resume-with-previous-stek.log:==587993==    by 0x10AD7F: doit (resume-with-previous-stek.c:251)
resume-with-previous-stek.log:==587993==    by 0x10A3A4: main (utils.c:254)
resume-with-previous-stek.log:==587993== 
x509sign-verify-error.log:==587824== Conditional jump or move depends on uninitialised value(s)
x509sign-verify-error.log:==587824==    at 0x4F4F868: _nettle_rsa_sec_compute_root_tr (in /usr/lib/x86_64-linux-gnu/libhogweed.so.5.0)
x509sign-verify-error.log:==587824==    by 0x4F4FC4E: nettle_rsa_compute_root_tr (in /usr/lib/x86_64-linux-gnu/libhogweed.so.5.0)
x509sign-verify-error.log:==587824==    by 0x4F5052B: nettle_rsa_pkcs1_sign_tr (in /usr/lib/x86_64-linux-gnu/libhogweed.so.5.0)
x509sign-verify-error.log:==587824==    by 0x497C4E4: _wrap_nettle_pk_sign (pk.c:1086)
x509sign-verify-error.log:==587824==    by 0x48B7303: privkey_sign_prehashed (privkey.c:1426)
x509sign-verify-error.log:==587824==    by 0x48B7612: gnutls_privkey_sign_hash (privkey.c:1384)
x509sign-verify-error.log:==587824==    by 0x109559: doit (x509sign-verify-error.c:186)
x509sign-verify-error.log:==587824==    by 0x1092B4: main (utils.c:254)
x509sign-verify-error.log:==587824== 
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/944
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200221/c714a0a0/attachment.html>


More information about the Gnutls-devel mailing list