Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak in performance schema unit test pfs-t
Summary: Fix the following leak reported by ASAN: ==2475771==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f97e37fb151 in __interceptor_calloc (/usr/local/fbcode/gcc-5-glibc-2.23/lib/libasan.so.2+0x9a151) #1 0x445229 in my_malloc /home/tianx/mysql/5.6/mysys/my_malloc.c:38 #2 0x44b908 in _lf_alloc_new /home/tianx/mysql/5.6/mysys/lf_alloc-pin.c:440 #3 0x44dfd0 in lf_hash_insert /home/tianx/mysql/5.6/mysys/lf_hash.c:390 #4 0x416220 in find_or_create_file(PFS_thread*, PFS_file_class*, char const*, unsigned int, bool) /home/tianx/mysql/5.6/storage/perfschema/pfs_instr.cc:1353 #5 0x439265 in create_file_v1 /home/tianx/mysql/5.6/storage/perfschema/pfs.cc:1791 #6 0x4099f6 in test_locker_disabled() /home/tianx/mysql/5.6/storage/perfschema/unittest/pfs-t.cc:1150 #7 0x40aef7 in do_all_tests() /home/tianx/mysql/5.6/storage/perfschema/unittest/pfs-t.cc:1659 #8 0x403d38 in main /home/tianx/mysql/5.6/storage/perfschema/unittest/pfs-t.cc:1668 #9 0x7f97e2288857 in __libc_start_main (/usr/local/fbcode/gcc-5-glibc-2.23/lib/libc.so.6+0x20857) #10 0x404bf8 in _start (/data/users/tianx/mysql/5.6/_build-5.6-ASan-PerfSchema/storage/perfschema/unittest/pfs-t+0x404bf8) SUMMARY: AddressSanitizer: 40 byte(s) leaked in 1 allocation(s). It seems the instrumented file's name is normalized to contain `-instrumented` in it. Previously test wasn't able to clean up the instrumented file "foo". Depends on D5235521 Test Plan: mtr mysqltest.sh --asan --perfschema --unit-tests --unit-tests-report empty_table Reviewers: gunnarku Reviewed By: gunnarku Subscribers: webscalesql-eng@fb.com Differential Revision: https://phabricator.intern.facebook.com/D5235559 Tasks: 17217920 Signature: t1:5235559:1497365801:a1b886d1f09005cd17196dfa44837e4336a5dfe5
- Loading branch information