Skip to content

Commit

Permalink
Fix another instrumented filename in perfscema unittest
Browse files Browse the repository at this point in the history
Summary: As title.

Test Plan:
I couldn't reproduce it on my local server, but it fails consistently on
sandcastle. Sandcastle filename+dirname may be too long and cause flakiness,
while the `-instrumented` postfix has some magic of avoiding/cleaning up leaks.

Ran `[build dir]/storage/perfschema/unittest/pfs-t`.

Before the fix:
  =================================================================
  ==678962==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 40 byte(s) in 1 object(s) allocated from:
      #0 0x7fd33820a151 in __interceptor_calloc (/usr/local/fbcode/gcc-5-glibc-2.23/lib/libasan.so.2+0x9a151)
      facebook#1 0x447409 in my_malloc /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/mysys/my_malloc.c:38
      facebook#2 0x44dae8 in _lf_alloc_new /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/mysys/lf_alloc-pin.c:440
      facebook#3 0x4501b0 in lf_hash_insert /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/mysys/lf_hash.c:390
      facebook#4 0x418400 in find_or_create_file(PFS_thread*, PFS_file_class*, char const*, unsigned int, bool) /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/storage/perfschema/pfs_instr.cc:1353
      facebook#5 0x441926 in end_file_open_wait_and_bind_to_descriptor_v1 /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/storage/perfschema/pfs.cc:3996
      facebook#6 0x40c160 in test_file_instrumentation_leak() /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/storage/perfschema/unittest/pfs-t.cc:1438
      facebook#7 0x40d0dc in do_all_tests() /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/storage/perfschema/unittest/pfs-t.cc:1659
      facebook#8 0x403d38 in main /data/sandcastle/boxes/trunk-git-mysql-int-tools-primary/mysql-src/storage/perfschema/unittest/pfs-t.cc:1667
      facebook#9 0x7fd336c97857 in __libc_start_main (/usr/local/fbcode/gcc-5-glibc-2.23/lib/libc.so.6+0x20857)
      facebook#10 0x404bf8 in _start (/data/sandcastle/boxes/trunk-git-mysql-int-secondary/_build-5.6-ASan-PerfSchema/storage/perfschema/unittest/pfs-t+0x404bf8)

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

Clean run after the change.

Reviewers: gunnarku

Reviewed By: gunnarku

Differential Revision: https://phabricator.intern.facebook.com/D5243042

Tasks: 17217920

Signature: t1:5243042:1497460215:c79e007405676c8ea585e1eb09c881fd3ed1ce1f
  • Loading branch information
tianx committed Jun 14, 2017
1 parent 53ca3a6 commit c46a78f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/perfschema/unittest/pfs-t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ void test_file_instrumentation_leak()

/* Simulate OPEN + READ of 100 bytes + CLOSE on descriptor 12 */

file_locker= psi->get_thread_file_name_locker(&file_state, file_key_A, PSI_FILE_OPEN, "AAA", NULL);
file_locker= psi->get_thread_file_name_locker(&file_state, file_key_A, PSI_FILE_OPEN, "AAA-instrumented", NULL);
ok(file_locker != NULL, "locker");
psi->start_file_open_wait(file_locker, __FILE__, __LINE__);
psi->end_file_open_wait_and_bind_to_descriptor(file_locker, 12);
Expand Down

0 comments on commit c46a78f

Please sign in to comment.