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

mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.36, 10.0.10
    • Fix Version/s: 5.5.38, 10.0.11
    • Component/s: None
    • Environment:
      Debian Wheezy AMD64

      Description

      To reproduce the bug, launch a mysqldump with the --dump-slave option on a server it cannot connect or execute a "SHOW SLAVE STATUS" :

      # mysqldump -hunknownhost --dump-slave nulldb
      mysqldump: Got error: 2005: "Unknown MySQL server host 'unknownhost' (0)" when trying to connect
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      [...]
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
      Segmentation fault

      Expected result: It shouldnt try to execute the "SHOW SLAVE STATUS" query as it cannot connect to the server and definitely not go on a loop and segfault.


      Note: The bug might have appeared since MDEV-5624 has been fixed, i don't recall seeing that issue before 5.5.36 but I might be wrong about that.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            The error is the typo:

            err:
              /* if --dump-slave , start the slave sql thread */
              if (opt_slave_data && do_start_slave_sql(mysql))
                goto err;
            

            But I don't know what was meant to be done under if, so I'll leave it to Sergei Golubchik to fix as initially intended.

            Show
            elenst Elena Stepanova added a comment - The error is the typo: err: /* if --dump-slave , start the slave sql thread */ if (opt_slave_data && do_start_slave_sql(mysql)) goto err; But I don't know what was meant to be done under if, so I'll leave it to Sergei Golubchik to fix as initially intended.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                jb-boin Jean Weisbuch
              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 40 minutes
                  40m