Bug #79541 Valgrind suppression needed for libstdc++ 5
Submitted: 7 Dec 2015 9:38 Modified: 11 Dec 2015 13:54
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.7.9 OS:Ubuntu (15.10)
Assigned to: CPU Architecture:Any
Tags: mtr, valgrind

[7 Dec 2015 9:38] Laurynas Biveinis
Description:
Valgrinding any testcase on Ubuntu 15.10 results in

72,704 bytes in 1 blocks are still reachable in loss record 3 of 3
   at 0x4C2BBCF: malloc (vg_replace_malloc.c:299)
   by 0x5FD81FF: pool (eh_alloc.cc:117)
   by 0x5FD81FF: __static_initialization_and_destruction_0 (eh_alloc.cc:244)
   by 0x5FD81FF: _GLOBAL__sub_I_eh_alloc.cc (eh_alloc.cc:307)
   by 0x40105B9: call_init.part.0 (dl-init.c:72)
   by 0x40106CA: call_init (dl-init.c:30)
   by 0x40106CA: _dl_init (dl-init.c:120)
   by 0x4000D09: ??? (in /lib/x86_64-linux-gnu/ld-2.21.so)
   by 0x7: ???
   by 0xFFEFFC756: ???
   by 0xFFEFFC78F: ???
   by 0xFFEFFC7AA: ???
   by 0xFFEFFC7F8: ???
   by 0xFFEFFC80A: ???
   by 0xFFEFFC829: ???
   by 0xFFEFFC83E: ???
   by 0xFFEFFC84D: ???

This seems to be an expected issue with libstdc++ version 5: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65434

How to repeat:
On Ubuntu 15.10:

cmake ... -DBUILD_CONFIG=mysql_release -DWITH_DEBUG=ON -DWITH_SSL=system -DWITH_BOOST=...
..
./mtr --debug-server --valgrind-mysqld 1st
...
main.1st                                 [ pass ]    605
worker[1] Valgrind report from /home/laurynas/obj-mysql-5.7.9-valgrind/mysql-test/var/log/mysqld.1.err after tests:
 main.1st
--------------------------------------------------------------------------
HEAP SUMMARY:
    in use at exit: 72,768 bytes in 3 blocks
  total heap usage: 41,463 allocs, 41,460 frees, 356,223,550 bytes allocated

32 bytes in 1 blocks are still reachable in loss record 1 of 3
   at 0x4C2BBCF: malloc (vg_replace_malloc.c:299)
   by 0x553DD87: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
   by 0x55F555E: sk_new (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
   by 0x52B5FF9: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x52B80F8: SSL_COMP_get_compression_methods (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x52BD7E2: SSL_library_init (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x1DF2F67: ssl_start (viosslfactories.c:367)
   by 0xE8DBB7: init_ssl() (mysqld.cc:3323)
   by 0xE90B9D: mysqld_main(int, char**) (mysqld.cc:4725)
   by 0xE87EE5: main (main.cc:25)

32 bytes in 1 blocks are still reachable in loss record 2 of 3
   at 0x4C2BBCF: malloc (vg_replace_malloc.c:299)
   by 0x553DD87: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
   by 0x55F557C: sk_new (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
   by 0x52B5FF9: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x52B80F8: SSL_COMP_get_compression_methods (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x52BD7E2: SSL_library_init (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
   by 0x1DF2F67: ssl_start (viosslfactories.c:367)
   by 0xE8DBB7: init_ssl() (mysqld.cc:3323)
   by 0xE90B9D: mysqld_main(int, char**) (mysqld.cc:4725)
   by 0xE87EE5: main (main.cc:25)

72,704 bytes in 1 blocks are still reachable in loss record 3 of 3
   at 0x4C2BBCF: malloc (vg_replace_malloc.c:299)
   by 0x5FD81FF: pool (eh_alloc.cc:117)
   by 0x5FD81FF: __static_initialization_and_destruction_0 (eh_alloc.cc:244)
   by 0x5FD81FF: _GLOBAL__sub_I_eh_alloc.cc (eh_alloc.cc:307)
   by 0x40105B9: call_init.part.0 (dl-init.c:72)
   by 0x40106CA: call_init (dl-init.c:30)
   by 0x40106CA: _dl_init (dl-init.c:120)
   by 0x4000D09: ??? (in /lib/x86_64-linux-gnu/ld-2.21.so)
   by 0x7: ???
   by 0xFFEFFC756: ???
   by 0xFFEFFC78F: ???
   by 0xFFEFFC7AA: ???
   by 0xFFEFFC7F8: ???
   by 0xFFEFFC80A: ???
   by 0xFFEFFC829: ???
   by 0xFFEFFC83E: ???
   by 0xFFEFFC84D: ???

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 72,768 bytes in 3 blocks
        suppressed: 0 bytes in 0 blocks

For counts of detected and suppressed errors, rerun with: -v
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

valgrind_report                          [ fail ]

The first two errors are bug 70490, the last one is the current bug.

Suggested fix:
Add a suppression.
[7 Dec 2015 9:48] MySQL Verification Team
Hello Laurynas,

Thank you for the report.

Thanks,
Umesh
[7 Dec 2015 10:30] Laurynas Biveinis
Thanks Umesh. Maybe bug 70490 can be set to Verified as well?
[11 Dec 2015 13:54] Paul DuBois
Fixed in 5.7.11.

Changes for test suite. No changelog entry needed.