Bug #53283 set global max_connections lower cause a crash at high concurrency/connections
Submitted: 29 Apr 2010 8:15 Modified: 28 Dec 2014 14:34
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Options Severity:S1 (Critical)
Version:5.1.37 OS:Any
Assigned to: CPU Architecture:Any

[29 Apr 2010 8:15] Shane Bester
Description:
changing the global max_connections can cause a crash due to memory corruption.
example stack trace:

mysqld(handle_segfault+0x322)[0x5deb82]
/lib64/tls/libpthread.so.0[0x2a95678790]
/lib64/tls/libc.so.6(gsignal+0x3d)[0x2a95c8932d]
/lib64/tls/libc.so.6(abort+0xfe)[0x2a95c8ab2e]
/lib64/tls/libc.so.6[0x2a95cbe701]
/lib64/tls/libc.so.6[0x2a95cc6443]
/lib64/tls/libc.so.6(__libc_realloc+0x137)[0x2a95cc7437]
mysqld:my_realloc
mysqld:resize_queue
mysqld:resize_thr_alarm
mysqld:set_var::update(THD*)
mysqld:sql_set_variables(THD*, List<set_var_base>*)
mysqld:mysql_execute_command(THD*)
mysqld:mysql_parse
mysqld:dispatch_command
mysqld:do_command(THD*)
mysqld:handle_one_connection

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x135ec570 = SET GLOBAL max_connections = 100

How to repeat:
will make a testcase later.
[8 May 2010 18:22] Valeriy Kravchuk
Any ideas for a repeatable test case are welcomed.
[29 May 2010 13:24] MySQL Verification Team
just noting that if anybody who hit this crash had been reading and playing with methods described in http://www.mysqlperformanceblog.com/2010/03/23/too-many-connections-no-problem/ then you're on your own!
[29 May 2010 14:40] MySQL Verification Team
Suspicious comment in signal_hand()

  /*
    Setup alarm handler
    This should actually be '+ max_number_of_slaves' instead of +10,
    but the +10 should be quite safe.
  */
  init_thr_alarm(thread_scheduler.max_threads +
		 global_system_variables.max_insert_delayed_threads + 10);
[8 Jun 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[28 Dec 2014 14:34] MySQL Verification Team
I've never seen this crash again in the last 4 years, so assuming the issue is no longer relevant on modern versions of 5.6