Bug #16157 InnoDB crashes when main location settings are empty
Submitted: 3 Jan 2006 17:45 Modified: 2 Feb 2006 18:59
Reporter: Matthew Lord
Status: Closed
Category:Server: InnoDB Severity:S2 (Serious)
Version:5.0.x/4.1.XX OS:Linux (Linux/Windows)
Assigned to: Bugs System Target Version:

[3 Jan 2006 17:45] Matthew Lord
Description:
When the main innodb location settings are set to "" or blank the innodb engine crashes
mysqld upon starting up.

How to repeat:
Copy attached my.cnf file to /tmp/.
cd /usr/local/mysql
./bin/mysqld --defaults-file=/tmp/my.cnf
[3 Jan 2006 17:50] Matthew Lord
Test config

Attachment: my.cnf (application/octet-stream, text), 105 bytes.

[3 Jan 2006 17:59] Miguel Solorzano
C:\mysql\bin>mysqld-nt --standalone --console
InnoDB: The first specified data file ibdata1 did not exist:
InnoDB: a new database to be created!
060103 14:55:26  InnoDB: Setting file ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
060103 14:55:26 [ERROR] mysqld-nt: Got signal 11. Aborting!

060103 14:55:26 [ERROR] Aborting

060103 14:55:26 [Note] mysqld-nt: Shutdown complete
[3 Jan 2006 22:27] Heikki Tuuri
Hi!

I am assigning this to Osku. The reason for the crash was that the syntax checking of the
innodb_log_group_home_dir string was incomplete. A similar bug was in the syntax checking
of innodb_data_file_path.

This little bug should only be fixed in 5.0, not in 4.1. Below I have posted a patch over
5.0.16. Osku should test this with different my.cnf combinations.

Thank you,

Heikki

heikki@127:~/mysql-5.0.16/innobase/srv$ diff -bu srv0start.c srv0startfixed.c
--- srv0start.c 2006-01-03 23:23:20.956588352 +0200
+++ srv0startfixed.c    2006-01-03 23:21:50.975267592 +0200
@@ -233,6 +233,13 @@
                }
        }

+       if (i == 0) {
+               /* If innodb_data_file_path was defined in my.cnf, it must
+               contain at least one data file definition */
+
+               return(FALSE);
+       }
+
        *data_file_names = (char**)ut_malloc(i * sizeof(void*));
        *data_file_sizes = (ulint*)ut_malloc(i * sizeof(ulint));
        *data_file_is_raw_partition = (ulint*)ut_malloc(i * sizeof(ulint));
@@ -379,6 +386,13 @@
                }
        }

+       if (i != 1) {
+               /* If innodb_log_group_home_dir was defined in my.cnf, it must
+               contain exactly one path definition under current MySQL */
+
+               return(FALSE);
+       }
+
        *log_group_home_dirs = (char**) ut_malloc(i * sizeof(void*));

        /* Then store the actual values to our array */
[31 Jan 2006 19:58] Alexander Ivanov
Fixed in 5.0.19.
Patch: http://lists.mysql.com/commits/1958.
[2 Feb 2006 18:59] Mike Hillyer
Documented in 5.0.19 changelog:

  <listitem>
        <para>
          Setting InnoDB path settings to an empty string caused InnoDB
          storage engine to crash upon server startup. (Bug #16157)
        </para>
      </listitem>