Bug #19440 GRANT SELECT ON db.table crashes mysqld
Submitted: 30 Apr 2006 5:14 Modified: 7 Jun 2006 13:06
Reporter: Sam Henderson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:mysql-max-5.0.20-linux-i686-glibc23 OS:Linux (Debian 3.1 2.4.27-3-686-smp)
Assigned to: Assigned Account CPU Architecture:Any

[30 Apr 2006 5:14] Sam Henderson
Description:
I am running the command 

grant select on mpa2.cdetails to geoip@'192.168.14.%';

in the MySQL client and it crashed mysqld every time and generates this error.

ERROR 2013 (HY000): Lost connection to MySQL server during query

This is generated in the log file every time that query is run.

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=16777216
read_buffer_size=131072
max_used_connections=5
max_connections=1024
threads_connected=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 2244600 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x430077b0
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=0xbe5fe4a8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x8198b78
0x40039825
0x8409246
0x8215ea1
0x81af51b
0x81b41fe
0x81ab79a
0x81ab2c5
0x81aa7cd
0x40033e51
0x401be8aa
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8bb2180 = grant select on mpa2.cdetails to geoip@'192.168.14.%'
thd->thread_id=236
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.

This is what I get when I run resolve_stack_dump

/usr/local/mysql/bin/resolve_stack_dump -s /tmp/mysqld.sym -n mysqld.stack
0x8198b78 handle_segfault + 356
0x40039825 _end + 933272021
0x8409246 my_hash_insert + 306
0x8215ea1 _Z17mysql_table_grantP3THDP13st_table_listR4ListI11st_lex_userERS3_I10LEX_COLUMNEmb + 1349
0x81af51b _Z21mysql_execute_commandP3THD + 10491
0x81b41fe _Z11mysql_parseP3THDPcj + 306
0x81ab79a _Z16dispatch_command19enum_server_commandP3THDPcj + 1178
0x81ab2c5 _Z10do_commandP3THD + 129
0x81aa7cd handle_one_connection + 621
0x40033e51 _end + 933249025
0x401be8aa _end + 934865498

I have run CHECK TABLE on everything in mysql database and on mpa2.cdetails and everything is OK.

One of the times mysqld shut down, it corrupted mysql.user and I had to run REPAIR TABLE and it changed from 14 to 15 rows.

Please help me track down what is going wrong.

How to repeat:
Run the command:

grant select on mpa2.cdetails to geoip@'192.168.14.%';

also tried

grant select on mpa2.cdetails to geoip@'192.168.14.99';

grant select on mpa2.cdetails to geoip@'192.168.14.0/255.255.255.0';

All generate the error message, with the same errors to the log file

ERROR 2013 (HY000): Lost connection to MySQL server during query
[30 Apr 2006 5:41] MySQL Verification Team
Thank you for the bug report. I was unable to repeat on current
source server on Suse linux 10.

mysql> create database mpa2;
Query OK, 1 row affected (0.00 sec)

mysql> use mpa2
Database changed
mysql> create table cdetails (id int);
Query OK, 0 rows affected (0.01 sec)

mysql> grant select on mpa2.cdetails to geoip@'192.168.14.%';
Query OK, 0 rows affected (0.00 sec)

mysql> grant select on mpa2.cdetails to geoip@'192.168.14.99';
Query OK, 0 rows affected (0.00 sec)

mysql> grant select on mpa2.cdetails to geoip@'192.168.14.0/255.255.255.0';
Query OK, 0 rows affected (0.00 sec)

mysql> select version();
+--------------+
| version()    |
+--------------+
| 5.0.22-debug | 
+--------------+
1 row in set (0.00 sec)

It is your installation from an upgrade over a prior version than 5.0?

Thanks in advance.
[30 Apr 2006 8:50] Sam Henderson
Yes, it was upgrade -> 3.23 -> 4.0. -> 4.1 -> 5

What do you think is possibly wrong?

Thanks for the quick response!

server:~$ cd /usr/local/mysql/bin
server:/usr/local/mysql/bin$ ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 108099 to server version: 5.0.20-max-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant select on mpa2.cdetails to
'geoip'@'192.168.14.0/255.255.255.0';
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
[30 Apr 2006 13:22] MySQL Verification Team
Thank you for the feedback. Please read carefully the below Manual's
chapters:

http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html
http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html

Thanks in advance.
[30 May 2006 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".
[7 Jun 2006 13:06] Hartmut Holzgraefe
duplicate of bug #16470