Bug #46495 Crash in reload_acl_and_cache on SIGHUP
Submitted: 31 Jul 2009 13:50 Modified: 7 Mar 2010 2:03
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.4,6.0 OS:Any
Assigned to: Magne Mæhre CPU Architecture:Any
Tags: regression

[31 Jul 2009 13:50] Philip Stoev
Description:
When mysql receives SIGHUP, it crashes as follows:

End safemalloc memory dump.
090731 16:46:18 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 60654 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
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...
stack_bottom = (nil) thread_stack 0x40000
/build/bzr/azalea-bugfixing/sql/mysqld(my_print_stacktrace+0x32) [0xa0e971]
/build/bzr/azalea-bugfixing/sql/mysqld(handle_segfault+0x2a6) [0x66a1ed]
/lib64/libpthread.so.0 [0x315b00f0f0]
/build/bzr/azalea-bugfixing/sql/mysqld(reload_acl_and_cache(THD*, unsigned long, TABLE_LIST*, bool*)+0x291) [0x6764a4]
/build/bzr/azalea-bugfixing/sql/mysqld(signal_hand+0x380) [0x669851]
/lib64/libpthread.so.0 [0x315b0073da]
/lib64/libc.so.6(clone+0x6d) [0x315a4e627d]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

This is a major problem and embarassement. SIGHUP is used for log rotation and is delivered to each process when its terminal closes.

How to repeat:
MTR_VERSION=1 perl mysql-test-run.pl --start-and-exit 1st
killall -HUP mysqld

killall -HUP mysqld
mysqld: no process killed

server is already dead.
[31 Jul 2009 16:19] MySQL Verification Team
I hit similar bugs already:

bug #35591 (FLUSH PRIVILEGES caused a crash)
bug #35589 (SET PASSWORD caused a crash)
bug #33982 (debug assertion and crash reloading grant tables after sighup or kill)
[19 Aug 2009 13:17] 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/81075

2868 Magne Mahre	2009-08-19
      Bug #46495  	Crash in reload_acl_and_cache on SIGHUP
      
      An assert in reload_acl_and_cache didn't account for the
      case when the function is called with a NULL thd.  A
      null thd is used whenever the function is called from the
      SIGHUP signal handler.
[20 Aug 2009 12:04] 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/81163

2871 Magne Mahre	2009-08-20
      Bug #46495        Crash in reload_acl_and_cache on SIGHUP
      
      An assert in reload_acl_and_cache didn't account for the
      case when the function is called with a NULL thd.  A
      null thd is used whenever the function is called from the
      SIGHUP signal handler.
[20 Aug 2009 12:08] Magne Mæhre
Pushed to mysql-next-bugfixing  (5.4.4)
[24 Aug 2009 13:53] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090824135126-2rngffvth14a8bpj) (version source revid:magne.mahre@sun.com-20090820120337-u4dqbuwjblukyy71) (merge vers: 5.4.4-alpha) (pib:11)
[26 Aug 2009 2:12] Paul DuBois
Noted in 5.4.4 changelog.

The server could crash attempting to flush privileges after receipt 
of a SIGHUP signal.
[10 Dec 2009 9:30] 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/93459

3022 Magne Mahre	2009-12-10
      Bug #46495        Crash in reload_acl_and_cache on SIGHUP
            
      An assert in reload_acl_and_cache didn't account for the
      case when the function is called with a NULL thd.  A
      null thd is used whenever the function is called from the
      SIGHUP signal handler.
      
      Backported from 6.0-codebase  (revid: 2617.69.35)
[10 Dec 2009 9:32] 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/93460

3020 Magne Mahre	2009-12-10
      Bug #46495        Crash in reload_acl_and_cache on SIGHUP
            
      An assert in reload_acl_and_cache didn't account for the
      case when the function is called with a NULL thd.  A
      null thd is used whenever the function is called from the
      SIGHUP signal handler.
      
      Backported from 6.0-codebase  (revid: 2617.69.35)
[16 Feb 2010 16:47] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100216101445-2ofzkh48aq2e0e8o) (version source revid:kostja@sun.com-20091211154405-c9yhiewr9o5d20rq) (merge vers: 6.0.14-alpha) (pib:16)
[16 Feb 2010 16:56] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100216101208-33qkfwdr0tep3pf2) (version source revid:magne.mahre@sun.com-20091210093223-luri8232h0drca6z) (pib:16)
[17 Feb 2010 0:52] Paul DuBois
Noted in 6.0.14 changelog.

Setting report to Need Merge pending push of Celosia into release tree.
[6 Mar 2010 10:57] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@mysql.com-20100216221947-luyhph0txl2c5tc8) (merge vers: 5.5.99-m3) (pib:16)
[7 Mar 2010 2:03] Paul DuBois
Noted in 5.5.3 changelog.