<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="625107">
  <date_last_updated>2011-06-07 01:05:54.270668+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/625107</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~sergii</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/625107/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/625107/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/625107</bug_web_link>
  <owner>Sergei</owner>
  <assignee></assignee>
  <milestone_title>Maria 5.1</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>xtradb crashes on shutdown</title>
  <status>New</status>
  <importance>Undecided</importance>
  <created>2010-08-27 05:43:24.551728+00:00</created>
  <description>
<![CDATA[on windows, mariadb-5.1, built with default options (win\configure.js) - xtradb is built as dll.
On load it prints "Mutexes and rw_locks use InnoDB's own implementation"
On shutdown it crashes.

In innobase_shutdown_for_mysql() there is:

2192         dict_close();
2193         btr_search_sys_free();
2194 
2195         /* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
2196         them */
2197         os_aio_free();
2198         sync_close();
2199         srv_free();

Now, btr_search_sys_free() is

 182 btr_search_sys_free(void)
 184 {
 185         mem_free(btr_search_latch_temp);
 186         btr_search_latch_temp = NULL;

It crashes later, in sync_close():

1449         mutex = UT_LIST_GET_FIRST(mutex_list); 
1451         while (mutex) {
1458                 mutex_free(mutex);
1459                 mutex = UT_LIST_GET_FIRST(mutex_list);
1460         }

because one of the mutexes (3rd in the list) is filled with 0xFEEEFEEE. This is the value that windows uses to fill the freed memory. And this mutex is freed in btr_search_sys_free(), line 185. When I comment this line (185) out, xtradb doesn't crash anymore.]]>  </description>
  <activities>
    <activity datechanged="2010-08-27T05:42:46.376865+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Sergei</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2010-08-27T05:43:24.551728+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[maria]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Sergei</person>
      <message></message>
    </activity>
    <activity datechanged="2010-11-30T16:35:35.453381+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[5.1]]>      </newvalue>
      <whatchanged>maria: milestone</whatchanged>
      <person>Sergei</person>
      <message></message>
    </activity>
    <activity datechanged="2011-06-07T01:05:51.014281+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Invalid]]>      </newvalue>
      <whatchanged>percona-xtradb: status</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/percona-xtradb/+bug/625107/comments/1" datecreated="2011-06-07T01:05:53.212301+00:00">
      <person>Stewart Smith</person>
      <subject>
<![CDATA[Re: xtradb crashes on shutdown]]>      </subject>
      <content>
<![CDATA[All development of XtraDB has moved under the Percona Server project - https://launchpad.net/percona-server - If this bug can be reproduced against current Percona Server, please file this bug against percona-server (you can simply do so by using the "Also affects project" link above).

Thanks,
Stewart Smith
Director of Server Development
Percona.]]>      </content>
    </comment>
  </comments>
</launchpad-bug>
