<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="675185">
  <date_last_updated>2012-09-20 08:03:12.325237+00:00</date_last_updated>
  <duplicates>
    <bug id="105457"/>
    <bug id="183596"/>
    <bug id="662024"/>
    <bug id="752326"/>
  </duplicates>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/675185</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~jakobunt</bug_owner_link>
    <milestone_link>https://api.launchpad.net/1.0/maria/+milestone/5.1</milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/675185/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/675185/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/675185</bug_web_link>
  <owner>Jakob Unterwurzacher</owner>
  <assignee>Kristian Nielsen</assignee>
  <milestone_title>Maria 5.1</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>[Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU</title>
  <status>Fix Released</status>
  <importance>Medium</importance>
  <created>2010-11-14 14:08:36.952223+00:00</created>
  <description>
<![CDATA[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 #!/bin/bash instead of #!/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.]]>  </description>
  <activities>
    <activity datechanged="2010-11-14T14:04:14.768236+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2010-11-14T14:04:14.768236+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[fix.diff https://bugs.launchpad.net/bugs/675185/+attachment/1733135/+files/fix.diff]]>      </newvalue>
      <whatchanged>attachment added</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-14T14:04:55.106262+00:00">
      <oldvalue>
<![CDATA[Symptoms are: After mysql server upgrades + restarts the old mysqld_safe keeps running and consumes 100% cpu, strace shows:
14:18:18.789847 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
14:18:18.789920 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
14:18:18.789992 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

NOTES: mysqld_safe will be replaced by an upstart job. But Hardy has support for 3 more years, justifiying a fix.]]>      </oldvalue>
      <newvalue>
<![CDATA[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 processes)
wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </newvalue>
      <whatchanged>description</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-14T14:06:23.868399+00:00">
      <oldvalue>
<![CDATA[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 processes)
wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </oldvalue>
      <newvalue>
<![CDATA[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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </newvalue>
      <whatchanged>description</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-14T14:08:36.952223+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[maria]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-14T14:55:27.522813+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[dash (Ubuntu)]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Marc Deslauriers</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-14T17:31:15.289570+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Brian Murray</person>
      <message>added subscriber Ubuntu Review Team</message>
    </activity>
    <activity datechanged="2010-11-14T17:31:18.339717+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[patch]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Brian Murray</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-15T15:19:58.138897+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Confirmed]]>      </newvalue>
      <whatchanged>mysql-dfsg-5.0 (Ubuntu): status</whatchanged>
      <person>Chuck Short</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-21T09:48:29.667530+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[In Progress]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-21T09:48:32.842211+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Kristian Nielsen (knielsen)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-21T09:48:37.518493+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Medium]]>      </newvalue>
      <whatchanged>maria: importance</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-21T14:34:54.368855+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message>added subscriber Ubuntu Stable Release Updates Team</message>
    </activity>
    <activity datechanged="2010-11-22T10:54:47.713699+00:00">
      <oldvalue>
<![CDATA[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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </oldvalue>
      <newvalue>
<![CDATA[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.

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </newvalue>
      <whatchanged>description</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-22T10:55:10.509721+00:00">
      <oldvalue>
<![CDATA[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.

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

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

]]>      </oldvalue>
      <newvalue>
<![CDATA[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.

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

NOTES: mysqld_safe was replaced by an upstart job in Lucid. But Hardy has support for 3 more years, justifiying a fix.
]]>      </newvalue>
      <whatchanged>description</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-23T06:44:46.254703+00:00">
      <oldvalue>
<![CDATA[In Progress]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Committed]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-30T16:03:51.683740+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[5.1]]>      </newvalue>
      <whatchanged>maria: milestone</whatchanged>
      <person>Sergei</person>
      <message></message>
    </activity>
    <activity datechanged="2011-01-06T15:12:14.405133+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Ryan Tucker</person>
      <message>added subscriber Ryan Tucker</message>
    </activity>
    <activity datechanged="2011-02-15T19:29:06.677954+00:00">
      <oldvalue>
<![CDATA[Fix Committed]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Released]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2011-04-06T20:56:39.841570+00:00">
      <oldvalue>
<![CDATA[mysql-dfsg-5.0 (Ubuntu)]]>      </oldvalue>
      <newvalue>
<![CDATA[mysql-5.1 (Ubuntu)]]>      </newvalue>
      <whatchanged>affects</whatchanged>
      <person>Chuck Short</person>
      <message></message>
    </activity>
    <activity datechanged="2011-05-19T06:59:25.467955+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-07-05T05:51:09.122843+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Medium]]>      </newvalue>
      <whatchanged>percona-server: importance</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-09-19T21:39:17.338742+00:00">
      <oldvalue>
<![CDATA[patch]]>      </oldvalue>
      <newvalue>
<![CDATA[patch testcase]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Ubuntu Foundation's Bug Bot</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:28:30.684990+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/5.1]]>      </newvalue>
      <whatchanged>nominated for series</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:28:30.684990+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/5.1]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:28:30.684990+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/5.5]]>      </newvalue>
      <whatchanged>nominated for series</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:28:30.684990+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/5.5]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:28:51.894653+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Ignacio Nin (ignacio-nin)]]>      </newvalue>
      <whatchanged>percona-server/5.1: assignee</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-08-06T07:29:03.524529+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Ignacio Nin (ignacio-nin)]]>      </newvalue>
      <whatchanged>percona-server/5.5: assignee</whatchanged>
      <person>Laurynas Biveinis</person>
      <message></message>
    </activity>
    <activity datechanged="2012-09-20T01:20:05.016993+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Invalid]]>      </newvalue>
      <whatchanged>percona-server/5.5: status</whatchanged>
      <person>Raghavendra D Prabhu</person>
      <message></message>
    </activity>
    <activity datechanged="2012-09-20T01:20:10.370884+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Invalid]]>      </newvalue>
      <whatchanged>percona-server/5.1: status</whatchanged>
      <person>Raghavendra D Prabhu</person>
      <message></message>
    </activity>
    <activity datechanged="2012-09-20T08:03:12.167784+00:00">
      <oldvalue>
<![CDATA[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.

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

NOTES: mysqld_safe was replaced by an upstart job in Lucid. But Hardy has support for 3 more years, justifiying a fix.
]]>      </oldvalue>
      <newvalue>
<![CDATA[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 #!/bin/bash instead of #!/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.]]>      </newvalue>
      <whatchanged>description</whatchanged>
      <person>Jakob Unterwurzacher</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/0" datecreated="2010-11-14T14:04:14.768236+00:00">
      <person>Jakob Unterwurzacher</person>
      <subject>
<![CDATA[[Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Symptoms are: After mysql server upgrades + restarts the old mysqld_safe keeps running and consumes 100% cpu, strace shows:
14:18:18.789847 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
14:18:18.789920 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
14:18:18.789992 wait4(4294967295, 0x7fffb3b3d59c, 0, NULL) = -1 ECHILD (No child processes)
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, fixed by http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea .

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

SRU JUSTIFICATION: Obviously safe patch.

PATCH: Attached, run mysqld_safe in bash instead of dash.

REGRESSION POTENTIAL: Minimal. 1) Bash is a superset of dash. 2) Before dash became the default sh, bash was used, we just revert that change.

NOTES: mysqld_safe will be replaced by an upstart job. But Hardy has support for 3 more years, justifiying a fix.]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/1" datecreated="2010-11-14T14:04:14.768236+00:00">
      <person>Jakob Unterwurzacher</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/2" datecreated="2010-11-15T15:19:58.138897+00:00">
      <person>Chuck Short</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Thanks for the patch, can you follow the process outlined by:

https://wiki.ubuntu.com/StableReleaseUpdates

thanks
chuck]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/3" datecreated="2010-11-16T22:51:19.946869+00:00">
      <person>Jilles Tjoelker</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Be sure to verify that the script works with bash's non-POSIX mode as well. A not so well known feature of bash is that it enters POSIX mode when called as "sh". This causes various subtle differences. Therefore, a #!/bin/sh script with /bin/sh -> bash might behave differently from a #!/bin/bash script.]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/4" datecreated="2010-11-22T08:33:16.201831+00:00">
      <person>Martin Pitt</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Please get this fixed in natty first (or at least alongside). The patch looks okay as a minimal workaround, so please get it uploaded.]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/5" datecreated="2010-11-22T10:58:04.908670+00:00">
      <person>Jakob Unterwurzacher</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Thing is, mysqld_safe isn't used anymore since Lucid as upstart has taken over (the file is still there though).]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/6" datecreated="2010-11-23T06:44:46.254703+00:00">
      <person>Kristian Nielsen</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[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.]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/7" datecreated="2011-02-15T19:29:06.677954+00:00">
      <person>Kristian Nielsen</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[Fixed in MariaDB 5.2.4 and 5.1.53]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/8" datecreated="2012-09-20T01:07:42.128316+00:00">
      <person>Raghavendra D Prabhu</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[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 #!/bin/sh to #!/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.
]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/ubuntu/+source/mysql-5.1/+bug/675185/comments/9" datecreated="2012-09-20T01:21:15.431812+00:00">
      <person>Raghavendra D Prabhu</person>
      <subject>
<![CDATA[Re: [Hardy SRU] dash bug causes mysqld_safe to spin at 100% CPU]]>      </subject>
      <content>
<![CDATA[lp:1053183 is the issue for providing upstart scripts with percona-server.]]>      </content>
    </comment>
  </comments>
  <messages>
    <message created="2010-11-14 14:04:14.768236+00:00" owner="Jakob Unterwurzacher">
<![CDATA[]]>      <attachment link="https://bugs.launchpad.net/bugs/675185/+attachment/1733135" type="Patch">
        <title>fix.diff</title>
        <file>LPexportBug675185_fix.diff</file>
      </attachment>
    </message>
  </messages>
</launchpad-bug>
