Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-137

Valgrindfailure in test maria.maria-autozerofill

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.20
    • Component/s: None
    • Labels:
      None

      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().

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              knielsen Kristian Nielsen added a comment -

              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.

              Show
              knielsen Kristian Nielsen added a comment - 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.
              Hide
              knielsen Kristian Nielsen added a comment -

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

              Show
              knielsen Kristian Nielsen added a comment - I think I found the problem, and pushed an attempted fix.

                People

                • Assignee:
                  knielsen Kristian Nielsen
                  Reporter:
                  knielsen Kristian Nielsen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 2 hours
                    2h