Connection option MYSQL_SERVER_PUBLIC_KEY memory leak

Bug #1604419 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
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Laurynas Biveinis
5.7
Invalid
Undecided
Unassigned

Bug Description

main.plugin_auth_sha256_2 w3 [ fail ]
        Test ended at 2016-07-18 10:35:37

CURRENT_TEST: main.plugin_auth_sha256_2
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.

=================================================================
==29446==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 131 byte(s) in 1 object(s) allocated from:
    #0 0x7fc6e777e54a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4789ce in my_malloc /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/mysys/my_malloc.c:38
    #2 0x479236 in my_strdup /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/mysys/my_malloc.c:158
    #3 0x44162a in mysql_options /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/sql-common/client.c:4501
    #4 0x40d706 in sql_real_connect /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/client/mysql.cc:4856
    #5 0x40d706 in sql_connect /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/client/mysql.cc:4938
    #6 0x416e64 in main /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/client/mysql.cc:1295
    #7 0x7fc6e5b5782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

SUMMARY: AddressSanitizer: 131 byte(s) leaked in 1 allocation(s).
mysqltest: At line 10: command "$MYSQL -ukristofer -psecret --default_auth=sha256_password --server_public_key_path=$MYSQL_TEST_DIR/std_data/rsa_public_key.pem -e "select user(), current_user()"" failed

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

The fix is to backport

commit 9979e3e4e63d2c1bd64e931318afb1553c38c10c
Author: Rafal Somla <email address hidden>
Date: Mon Mar 10 18:45:27 2014 +0100

    Bug#17933308 - VALGRIND: MEMORY LEAK IN MYSQL_OPTIONS() AND MYSQL_LOAD_PLUGIN_V()

    Two leaks fixed:

    1. Freeing memory allocated for
       mysql->options.extension->server_public_key_path inside
       mysql_close_free_options() function.

    2. Freeing memory allocated inside a dummy MYSQL connection handle used
       by mysql_client_plugin_init() by calling mysql_close_free() at the
       end of the function.

    Functions mysql_close_free() and mysql_close_free_options() are made available outside the sql-common/client.c file. Also, mysql_close_free() is updated to free memory used by mysql->extension.

tags: added: asan ci upstream
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-3490

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.