Two DBUG +O commands in a row leak the first output file handle

Bug #1612118 reported by Laurynas Biveinis on 2016-08-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Invalid
Low
Laurynas Biveinis
5.7
Invalid
Low
Laurynas Biveinis

Bug Description

SET SESSION debug= '+O,../../log/bug46165.5.trace';
SET SESSION debug= '+O,../../log/bug46165.6.trace';
SET SESSION debug= '-O';

results in unclosed bug46165.5.trace.

This also shows up as a Valgrind error on main.variables_debug on 5.5 trunk:

main.variables_debug w3 [ pass ] 563
worker[3] Valgrind report from /home/laurynas/obj-percona-5.5-valgrind/mysql-test/var/3/log/mysqld.1.err after tests:
 main.variables_debug
--------------------------------------------------------------------------
HEAP SUMMARY:
    in use at exit: 30,644,184 bytes in 209 blocks
  total heap usage: 66,915 allocs, 66,706 frees, 87,992,076 bytes allocated

552 bytes in 1 blocks are still reachable in loss record 107 of 128
   at 0x4C2DB8F: malloc (vg_replace_malloc.c:299)
   by 0x666BC8C: __fopen_internal (iofopen.c:69)
   by 0xAC4619: DBUGOpenFile (dbug.c:1904)
   by 0xAC65AE: DbugParse (dbug.c:607)
   by 0xAC68B7: _db_set_ (dbug.c:800)
   by 0x67FB08: Sys_var_dbug::session_update(THD*, set_var*) (sys_vars.h:609)
   by 0x51E2BE: sys_var::update(THD*, set_var*) (set_var.cc:204)
   by 0x51E658: set_var::update(THD*) (set_var.cc:677)
   by 0x51EF92: sql_set_variables(THD*, List<set_var_base>*) (set_var.cc:577)
   by 0x5A035E: mysql_execute_command(THD*) (sql_parse.cc:3447)
   by 0x5A4B6F: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6060)
   by 0x5A63AC: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1075)
   by 0x5A8158: do_command(THD*) (sql_parse.cc:789)
   by 0x661DF2: do_handle_one_connection(THD*) (sql_connect.cc:1418)
   by 0x661EEF: handle_one_connection (sql_connect.cc:1325)
   by 0x83F867: pfs_spawn_thread (pfs.cc:1015)

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 552 bytes in 1 blocks
        suppressed: 30,643,632 bytes in 208 blocks

tags: added: ci upstream valgrind
summary: - Two DBUG +O commands in a row leak the first output file
+ Two DBUG +O commands in a row leak the first output file handle

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2170

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

Other bug subscribers