Bug #62311 | segfault in mysqld during early SIGHUP handling | ||
---|---|---|---|
Submitted: | 31 Aug 2011 17:20 | Modified: | 9 Feb 2012 5:01 |
Reporter: | Volodymyr Lukiianyk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Errors | Severity: | S3 (Non-critical) |
Version: | 5.1.55, 5.1.61 | OS: | Linux (ALT Linux based) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Contribution |
[31 Aug 2011 17:20]
Volodymyr Lukiianyk
[11 Jan 2012 15:59]
Valeriy Kravchuk
Thank you for the problem report and patch contributed. Verified by code review.
[11 Jan 2012 16:41]
MySQL Verification Team
is this rare condition repeatable on mysql 5.5 or 5.6 ? I'm asking, due to the similar nature of http://bugs.mysql.com/bug.php?id=47703
[11 Jan 2012 16:41]
MySQL Verification Team
and related http://bugs.mysql.com/bug.php?id=48536
[9 Feb 2012 5:01]
Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at http://dev.mysql.com/doc/en/installing-source.html
[9 Feb 2012 5:02]
Jon Stephens
Fixed in 5.6. Documented as follows in the 5.6.5 changelog: If during server startup a signal such as SIGHUP was caught prior to full server initialization, the server could crash. This was due to a race condition between the signal handler thread and the main thread performing server initialization. To prevent this from happening, signal processing is now suspended until full initialization of all server components has been completed successfully. Closed.
[17 May 2013 4:44]
Laurynas Biveinis
5.6$ bzr log -r 3402.50.94 ------------------------------------------------------------ revno: 3402.50.94 committer: Dmitry Shulga <Dmitry.Shulga@oracle.com> branch nick: mysql-trunk-bug13608371 timestamp: Mon 2012-01-30 11:34:32 +0600 message: This patch fixes bug#13608371 (formerly known as bug 62311): segfault in mysqld during early SIGHUP handling. If during server start up some signals like SIGHUP are caught before full server initialization has been done then server may crash. The reason for this bug is that there was a race condition between signal handler thread and main thread that was doing server initialization. For example, if SIGHUP signal was delivered to server and caught by signal handler thread before server had completed initialization of Event_scheduler then server crashed when try to access to uninitialized event_scheduler instance during signal handling. To avoid such race condition we suspend signal processing before full initialization of all server components has been completed successfully. It's achieved by waiting for on COND_server_started conditional variable until a flag mysqld_server_started is true. Moreover superfluous call of pthread_sigmask() to set thread signal mask was removed since all signal have been already blocked during execution of my_init_signal(). Also call of mysql_cond_broadcast(&COND_thread_count) at signal_hand() was moved under protection of mutex LOCK_thread_count to provide deterministic schedule behaviour.
[7 Nov 2013 16:09]
Raghavendra Prabhu
Is this fix going to be backported to 5.5 or older (since this was reported for 5.1). The fix seems to be only in 5.6 tree.