Heap allocator/deallocator mismatch in scalability metrics plugin

Bug #1581050 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
New
Undecided
Unassigned

Bug Description

In 5.6:

static
sm_thd_data_t *sm_thd_data_get(MYSQL_THD thd)
{
...
    thd_data= calloc(sizeof(sm_thd_data_t), 1);
...
    thd_data->backref= list_push(thd_list_root, thd_data);
...
}

list_push will eventually do

LIST *list_cons(void *data, LIST *list)
{
  LIST *new_charset=(LIST*) my_malloc(sizeof(LIST),MYF(MY_FAE));
...

where new_charset will be stored as thd_data->backref.

But then we also have

static
void sm_thd_data_release(MYSQL_THD thd)
{
...
    thd_list_root= list_delete(thd_list_root, thd_data->backref);
...
    free(thd_data->backref);
    free(thd_data);
}

i.e. my_malloc paired with regular frees.

and we also have

      list_free(thd_list_root, TRUE);

calls, resulting in regular calloc paired with my_free.

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

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.