[MDEV-137] Valgrindfailure in test maria.maria-autozerofill Created: 2012-02-08  Updated: 2012-02-09  Resolved: 2012-02-09

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5.20

Type: Bug Priority: Critical
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-31 make buildbot green for 5.5 Closed
Duplicate
duplicates MDEV-68 5.5 multiple failures on work-amd64-v... Closed

 Description   

This failure happens only when main.variables_debug is run just before it:

./mtr main.variables_debug maria.maria-autozerofill --valgrind

variables_debug does this near the end:

--echo # Test 5 - Different trace files
SET SESSION debug_dbug= '+O,../../log/bug46165.5.trace';
SET SESSION debug_dbug= '+O,../../log/bug46165.6.trace';
SET SESSION debug_dbug= '-O';

And then when maria-autozerofill restarts the server as part of the test, it
shows this leak:

==13746== 568 bytes in 1 blocks are still reachable in loss record 3 of 3
==13746== at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13746== by 0x60A634A: __fopen_internal (iofopen.c:76)
==13746== by 0xB3873A: DBUGOpenFile.isra.4 (dbug.c:1880)
==13746== by 0xB3A761: DbugParse (dbug.c:574)
==13746== by 0xB3B3A4: db_set (dbug.c:778)
==13746== by 0x6B8713: Sys_var_dbug::session_update(THD*, set_var*) (sys_vars.h:639)
==13746== by 0x55148B: sys_var::update(THD*, set_var*) (set_var.cc:208)
==13746== by 0x551A59: set_var::update(THD*) (set_var.cc:672)
==13746== by 0x552108: sql_set_variables(THD*, List<set_var_base>*) (set_var.cc:576)
==13746== by 0x5D8FC3: mysql_execute_command(THD*) (sql_parse.cc:3194)
==13746== by 0x5DC2FC: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5728)
==13746== by 0x5DD943: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1054)
==13746== by 0x5DE120: do_command(THD*) (sql_parse.cc:793)
==13746== by 0x6A2C4E: do_handle_one_connection(THD*) (sql_connect.cc:1252)
==13746== by 0x6A2D30: handle_one_connection (sql_connect.cc:1167)
==13746== by 0xACA737: pfs_spawn_thread (pfs.cc:1015)

Somehow, DBUGCloseFile() seems to not be called, or at least not to work
properly in this case. It's supposed to be called from FreeState().



 Comments   
Comment by Kristian Nielsen [ 2012-02-08 ]

The bug is not related to maria-autozerofill, that's just where it is detected due to server restart.
It is reproducible just by running main.variables_debug under --valgrind.

Comment by Kristian Nielsen [ 2012-02-08 ]

I think I found the problem, and pushed an attempted fix.

Generated at Thu Feb 08 06:26:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.