Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug 1604323 (pfs_instr_config_array elements not deallocated on s… #679

Merged
merged 1 commit into from
Jul 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions mysql-test/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -604,72 +604,6 @@
fun:lf_hash_search
}

{
missing shutdown_performance_schema 8
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:_Z22add_pfs_instr_to_arrayPKcS0_
fun:mysqld_get_one_option
fun:my_handle_options
fun:handle_options
fun:_Z20handle_early_optionsv
}

{
missing shutdown_performance_schema 9
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:init_dynamic_array2
fun:_Z25init_pfs_instrument_arrayv
fun:_Z11mysqld_mainiPPc
fun:main
}

{
missing shutdown_performance_schema 9a
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:_Z22add_pfs_instr_to_arrayPKcS0_
fun:mysqld_get_one_option
fun:my_handle_options
fun:_Z20handle_early_optionsv
fun:_Z11mysqld_mainiPPc
}

# Same as shutdown_performance_schema 9,
# but the compiler/linker can sometime change the
# calls from:
# main()
# --> init_pfs_instrument_array()
# --> init_dynamic_array2()
# to:
# main()
# --> init_dynamic_array2()
# when building with optimizations.

{
missing shutdown_performance_schema 10
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:init_dynamic_array2
fun:_Z11mysqld_mainiPPc
fun:main
}

{
missing shutdown_performance_schema 11
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:init_dynamic_array2
fun:_Z11mysqld_mainiPPc
fun:(below main)
}

{
Bug 59874 Valgrind warning in InnoDB compression code
Memcheck:Cond
Expand Down
8 changes: 8 additions & 0 deletions storage/perfschema/pfs_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,15 @@ void cleanup_instrument_config()

/* Ignore if another thread has already deallocated the array */
if (my_atomic_cas32(&pfs_instr_config_state, &desired_state, PFS_INSTR_CONFIG_DEALLOCATED))
{
for (uint i= 0; i < pfs_instr_config_array.elements; i++)
{
PFS_instr_config* e;
get_dynamic(&pfs_instr_config_array, &e, i);
my_free(e);
}
delete_dynamic(&pfs_instr_config_array);
}
}

/**
Expand Down