mysql_client_test memory leaks

Bug #1589819 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Invalid
Undecided
Unassigned
5.7
Invalid
Undecided
Unassigned

Bug Description

main.mysql_client_test w3 [ fail ]
        Test ended at 2016-06-06 11:20:24

CURRENT_TEST: main.mysql_client_test
mysqltest: At line 17: command "$MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1" failed
...
=================================================================
==7686==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8199 byte(s) in 1 object(s) allocated from:
    #0 0x7f47e7c8954a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4d6a87 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x557217 in my_net_init /home/laurynas/mysql-server/sql/net_serv.cc:116
    #3 0x47dd0a in mysql_real_connect /home/laurynas/mysql-server/sql-common/client.c:3399
    #4 0x42718b in test_bug42373 /home/laurynas/mysql-server/tests/mysql_client_test.c:18003
    #5 0x46a664 in main /home/laurynas/mysql-server/tests/mysql_client_fw.c:1379
    #6 0x7f47e6f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 8160 byte(s) in 1 object(s) allocated from:
    #0 0x7f47e7c8954a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4d6a87 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x4c5410 in alloc_root /home/laurynas/mysql-server/mysys/my_alloc.c:217
    #3 0x4788e3 in unpack_fields /home/laurynas/mysql-server/sql-common/client.c:1478
    #4 0x47a0c6 in cli_read_query_result /home/laurynas/mysql-server/sql-common/client.c:3943
    #5 0x48e12a in execute /home/laurynas/mysql-server/libmysql/libmysql.c:2066
    #6 0x490bae in cli_stmt_execute /home/laurynas/mysql-server/libmysql/libmysql.c:2170
    #7 0x49467f in mysql_stmt_execute /home/laurynas/mysql-server/libmysql/libmysql.c:2546
    #8 0x427468 in test_bug42373 /home/laurynas/mysql-server/tests/mysql_client_test.c:18010
    #9 0x46a664 in main /home/laurynas/mysql-server/tests/mysql_client_fw.c:1379
    #10 0x7f47e6f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 816 byte(s) in 1 object(s) allocated from:
    #0 0x7f47e7c8954a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4d6a87 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x48f26b in mysql_stmt_init /home/laurynas/mysql-server/libmysql/libmysql.c:1492
    #3 0x45d5d7 in test_bug43560 /home/laurynas/mysql-server/tests/mysql_client_test.c:17677
    #4 0x46a664 in main /home/laurynas/mysql-server/tests/mysql_client_fw.c:1379
    #5 0x7f47e6f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 496 byte(s) in 1 object(s) allocated from:
    #0 0x7f47e7c8954a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4d6a87 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x4c2272 in vio_new /home/laurynas/mysql-server/vio/vio.c:212
    #3 0x47d15d in mysql_real_connect /home/laurynas/mysql-server/sql-common/client.c:3204
    #4 0x42718b in test_bug42373 /home/laurynas/mysql-server/tests/mysql_client_test.c:18003
    #5 0x46a664 in main /home/laurynas/mysql-server/tests/mysql_client_fw.c:1379
    #6 0x7f47e6f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 152 byte(s) in 1 object(s) allocated from:
    #0 0x7f47e7c8954a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4d6a87 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x48fdc6 in mysql_stmt_result_metadata /home/laurynas/mysql-server/libmysql/libmysql.c:1802
    #3 0x439b83 in test_wl4435_3 /home/laurynas/mysql-server/tests/mysql_client_test.c:1082
    #4 0x46a664 in main /home/laurynas/mysql-server/tests/mysql_client_fw.c:1379
    #5 0x7f47e6f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
...

Tags: asan ci upstream
tags: added: asan ci upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The fix would be to backport

commit 640ff30e35c22a17bfc4a2cfbd8408d0980000f1
Author: Tor Didriksen <email address hidden>
Date: Thu Nov 1 11:59:32 2012 +0100

    Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TEST

    Add missing DBUG_RETURNs, otherwise the debug-stack gets messed up,
    and _db_enter_ and _db_exit_ will access data outside the current stack frame.

    Add some missing mysql_free_xx() mysql_close_xx() to fix memory leaks.

commit e5d2a53b783d9a0b5240b21d21883b66f036009b
Author: Tor Didriksen <email address hidden>
Date: Thu Nov 1 17:23:06 2012 +0100

    Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TEST

    Add missing DBUG_RETURNs, otherwise the debug-stack gets messed up,
    and _db_enter_ and _db_exit_ will access data outside the current stack frame.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3462

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.