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

LP:675185 - [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU

    Details

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

      Description

      Symptoms are: After mysql server upgrades + restarts the old mysqld_safe keeps running and consumes 100% cpu, strace shows:
      wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child ...
      wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child ...
      wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child ...
      For more info see the dupes, particularily bug 105457. Does not happen always, for reliable test case see below.

      This is a bug (race condition) in dash, partly fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea . This fixes the test case and mysqld_safe, but introduces another regression: http://eeek.borgchat.net/lists/dash/msg00268.html (patch for that in the thread)

      TEST CASE: Script in the commit message (link above). Allows to reproduce this always, even on Karmic still.

      (Proposed fix of using #Unable to render embedded object: File (/bin/bash instead of #) not found./bin/sh is not as straigtforward as expected. bash called as sh goes into sh compatibility mode, called as bash it may behave subtle differently)

      NOTES: mysqld_safe was replaced by an upstart job in Lucid. But Hardy has support for 3 more years, justifiying a fix.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            knielsen Kristian Nielsen added a comment -

            Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU
            I fixed this for mariadb by adding a patch to the .deb packaging that puts #!/bin/bash in the header of mysqld_safe.

            Fix will be available from 5.1.52 and 5.2.4.

            Show
            knielsen Kristian Nielsen added a comment - Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU I fixed this for mariadb by adding a patch to the .deb packaging that puts #!/bin/bash in the header of mysqld_safe. Fix will be available from 5.1.52 and 5.2.4.
            Hide
            knielsen Kristian Nielsen added a comment -

            Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU
            Fixed in MariaDB 5.2.4 and 5.1.53

            Show
            knielsen Kristian Nielsen added a comment - Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU Fixed in MariaDB 5.2.4 and 5.1.53
            Hide
            ratzpo Rasmus Johansson added a comment -

            Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU
            I tested the testcase in the commit on Precise and there seem to no issue there
            (probably fixed there).

            Also, it is not the right approach to change #Unable to render embedded object: File (/bin/sh to #) not found./bin/bash since
            former invokes POSIX compatibility mode and if dash has problems on any
            platform, then that should be fixed rather than changing it in mysqld_safe or
            #!/bin/sh needs to pointed elsewhere (or with update-alternatives).

            Regarding the init scripts, I see that Percona Server is not packaged with
            upstart script (hence vulnerable to this if on a platform with a buggy dash) as
            mysql-server-55 does. I will open a separate issue to add that.

            Show
            ratzpo Rasmus Johansson added a comment - Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU I tested the testcase in the commit on Precise and there seem to no issue there (probably fixed there). Also, it is not the right approach to change # Unable to render embedded object: File (/bin/sh to #) not found. /bin/bash since former invokes POSIX compatibility mode and if dash has problems on any platform, then that should be fixed rather than changing it in mysqld_safe or #!/bin/sh needs to pointed elsewhere (or with update-alternatives). Regarding the init scripts, I see that Percona Server is not packaged with upstart script (hence vulnerable to this if on a platform with a buggy dash) as mysql-server-55 does. I will open a separate issue to add that.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU
            lp:1053183 is the issue for providing upstart scripts with percona-server.

            Show
            ratzpo Rasmus Johansson added a comment - Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU lp:1053183 is the issue for providing upstart scripts with percona-server.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 675185

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 675185

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: