Memory leaks in unit tests

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

Bug Description

With LeakSanitizer,

...
unit_tests w0 [ fail ]
...
 4/24 Test #4: pfs_instr-oom ....................***Failed 0.09 sec
...
=================================================================
==17991==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2816000 byte(s) in 1 object(s) allocated from:
    #0 0x7f40ca77354a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x40375f in pfs_malloc(unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_pfs_global.h:39
    #2 0x4037f7 in pfs_malloc_array(unsigned long, unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_pfs_global.h:57
    #3 0x406c6d in init_instruments(PFS_global_param const*) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/pfs_instr.cc:339
    #4 0x404544 in test_oom() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs_instr-oom-t.cc:355
    #5 0x405173 in do_all_tests() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs_instr-oom-t.cc:658
    #6 0x4051c3 in main /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs_instr-oom-t.cc:667
    #7 0x7f40c987482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

SUMMARY: AddressSanitizer: 2816000 byte(s) leaked in 1 allocation(s).
...

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Download full text (110.2 KiB)

 8/24 Test #8: pfs ..............................***Failed 0.84 sec
...
=================================================================
==17999==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 222080 byte(s) in 1 object(s) allocated from:
    #0 0x7fd5db9f054a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x40360d in pfs_malloc(unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_print_error.h:24
    #2 0x4036a3 in pfs_malloc_array(unsigned long, unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_print_error.h:42
    #3 0x41d375 in init_table_share(unsigned int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/pfs_instr_class.cc:344
    #4 0x4221e6 in initialize_performance_schema(PFS_global_param*) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/pfs_server.cc:88
    #5 0x403dc6 in load_perfschema() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:176
    #6 0x40a6ae in test_file_instrumentation_leak() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:1362
    #7 0x40b976 in do_all_tests() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:1636
    #8 0x40b9c6 in main /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:1644
    #9 0x7fd5db08982f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 222080 byte(s) in 1 object(s) allocated from:
    #0 0x7fd5db9f054a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x40360d in pfs_malloc(unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_print_error.h:24
    #2 0x4036a3 in pfs_malloc_array(unsigned long, unsigned long, int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/stub_print_error.h:42
    #3 0x41d375 in init_table_share(unsigned int) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/pfs_instr_class.cc:344
    #4 0x4221e6 in initialize_performance_schema(PFS_global_param*) /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/pfs_server.cc:88
    #5 0x403dc6 in load_perfschema() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:176
    #6 0x40416c in test_bad_registration() /mnt/workspace/percona-server-5.6-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/storage/perfschema/unittest/pfs-t.cc:192
    #7 0x40b967 in do_all_tests() /m...

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-2157

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

Other bug subscribers

Remote bug watches

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