Bug #90344 MySQL 8.0 crashes after setting log_bin and relay_log to the same value
Submitted: 9 Apr 2018 5:07 Modified: 9 Apr 2018 6:17
Reporter: Hanzhi W Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any

[9 Apr 2018 5:07] Hanzhi W
Description:
MySQL server will crash after passing command line argument --log-bin the same value as --relay-log.

How to repeat:
After initialization, start MySQL server 8.0 in command line as:
mysqld.exe --log-bin=same_base_file_name --relay-log=same_base_file_name

Then, MySQL server will crash.

This can also be verified by mysql-test:
Test Suite: binlog
Test Case:  binlog_same_basename_relaylog

Suggested fix:
This should be a bug in source code where LogErr missing argument for ER_RPL_CANT_HAVE_SAME_BASENAME ErrMsg.

git diff
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7cf5556e496..46db456376c 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4858,7 +4858,7 @@ static int init_server_components()
     */
     LogErr(ERROR_LEVEL, ER_RPL_CANT_HAVE_SAME_BASENAME,
            log_bin_basename, "--log-bin",
-           default_binlogfile_name_from_hostname,
+           default_binlogfile_name_from_hostname, default_binlogfile_name_from_hostname,
            "--relay-log", default_relaylogfile_name);
     unireg_abort(MYSQLD_ABORT_EXIT);
   }

With the above code change, the issue is fixed.
[9 Apr 2018 6:17] MySQL Verification Team
Hello Hanzhi W,

Thank you for the report.
This is duplicate of Bug #90252, please see Bug #90252.

##
2018-04-09T06:09:38.249831Z 0 [System] [MY-010116] /export/umesh/server/binaries/Trunk/mysql-8.0.4/bin/mysqld (mysqld 8.0.4-rc-log) starting as process 1667 ...
2018-04-09T06:09:38.254486Z 0 [ERROR] [MY-010911] Cannot have same base name '/export/umesh/server/binaries/Trunk/mysql-8.0.4/90344/same_base_file_name' for both binary and relay logs. Pl/AUI▒▒L▒⾟*') options to ensure they do not conflict.n option is not used, default '--relay-log' if --log-bin option is used without argument) and hod03-relay-bin (default 'H▒L▒
2018-04-09T06:09:38.254514Z 0 [ERROR] [MY-010119] Aborting
2018-04-09T06:09:38.254557Z 0 [Note] [MY-010120] Binlog end

Thanks,
Umesh