Bug #31604 server crash when setting slow_query_log_file/global general_log_file variable
Submitted: 15 Oct 2007 11:58 Modified: 20 Dec 2007 0:31
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Logging Severity:S1 (Critical)
Version:5.1.23 OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any
Tags: crash, general_log_file, slow_query_log_file

[15 Oct 2007 11:58] Shane Bester
Description:
thd: 0x8dc07f0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x41fd1ec4, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x820147b handle_segfault + 541
0x84d6e23 dirname_length + 11
0x84d6eac dirname_part + 115
0x84d83a1 unpack_filename + 111
0x821d9b2 sys_check_log_path(THD*, set_var*) + 64
0x821ad73 sys_var_str::check(THD*, set_var*) + 45
0x821f635 set_var::check(THD*) + 397
0x821f3b5 sql_set_variables(THD*, List<set_var_base>*) + 103
0x8211916 mysql_execute_command(THD*) + 13446
0x82178b0 mysql_parse(THD*, char const*, unsigned int, char const**) + 372
0x820cf60 dispatch_command(enum_server_command, THD*, char*, unsigned int) + 2354
0x820c622 do_command(THD*) + 600
0x820b01d handle_one_connection + 255
0x40038aa7 _end + 931809239
0x4017ec2e _end + 933144926

How to repeat:
set global general_log_file = substr('a',1);
[15 Oct 2007 12:03] MySQL Verification Team
same problem with:

set global slow_query_log_file = substr('a',1);
[16 Oct 2007 12:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35645

ChangeSet@1.2583, 2007-10-16 17:19:07+05:00, ramil@mysql.com +3 -0
  Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
  
  Problem: we don't evaluate given expression checking values of the
  slow_query_log_file/general_log_file, don't check it for NULL.
  
  Fix: evaluate the expression, check result returned.
[7 Dec 2007 23:07] Bugs System
Pushed into 6.0.5-alpha
[7 Dec 2007 23:08] Bugs System
Pushed into 5.1.23-rc
[20 Dec 2007 0:31] Paul DuBois
Noted in 5.1.23, 6.0.5 changelogs.

Setting the general_log_file or slow_query_log_file system variable
to certain values could cause a server crash.
[18 Mar 2008 12:53] Valeriy Kravchuk
Bug #35371 was marked as a duplicate of this one.