From: Chaithra Gopalareddy Date: February 17 2012 7:08am Subject: bzr push into mysql-trunk branch (chaithra.gopalareddy:3916 to 3917) List-Archive: http://lists.mysql.com/commits/142933 Message-Id: <201202170708.q1H78ril014347@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3917 Chaithra Gopalareddy 2012-02-17 [merge] Null merge from 5.5 to 5.6 3916 Rohit Kalhans 2012-02-17 BUG#11766817: CRASH ON MYSQLD STARTUP WHEN USING LOG-BIN (STRMAKE ISSUE?) BUG#12929941: SEGFAULT IN STRMAKE/CONVERT_DIRNAME WHEN USING --RELAY-LOG=SLAVE-RELAY-BIN Problem Description: The global variable 'char *mysql_real_data_home_ptr' is declared and initialized to the address of the global buffer char mysql_real_data_home[] in mysqld.cc. Then, the constructor for Sys_datadir overwrites mysql_real_data_home_ptr with NULL. In the case when value datadir is not given in both command-line as well as in cnf file and the default path (/data) needs to be used, the mysql_real_data_home_ptr is not made to point to mysql_real_data_home and still has NULL value. After WL#5465, we use mysql_real_data_home_ptr when it still holds NULL as no cli or cnf file arguments were given. In particular, rpl_make_log_name passes mysql_real_data_home_ptr to fn_format. This caused a coredump because fn_format did not expect NULL. The following combinations caused the core dump 1.unspecified but existing empty default data dir and --log-bin 2.unspecified but existing empty default data dir and --relay-log= Solution: We solve this problem by making mysql_real_data_home_ptr to point to the mysql_real_data_home if it is null before passing it to fn_format function because by this time we know that mysql_real_data_home is correctly initialized and holds the final value of datadir path. We have also added asserts in fn_format() to check if the dir is null. @ mysql-test/suite/binlog/t/binlog_server_start_options.test added file to check startup error when no value of datadir has been given. @ mysys/mf_format.c Assert that the dir passed to this function is not null. @ sql/mysqld.cc Make mysql_real_data_home_ptr point to mysql_real_data_home if mysql_real_data_home_ptr is null before passing it to the fn_format(). added: mysql-test/suite/binlog/r/binlog_server_start_options.result mysql-test/suite/binlog/t/binlog_server_start_options.test modified: mysys/mf_format.c sql/mysqld.cc No bundle (reason: useless for push emails).