Crash with flush query cache in MySQL-4.1

Crash with flush query cache in MySQL-4.1

am 01.01.2003 13:34:07 von Jocelyn Fournier

Hi,

How-to-repeat :

mysql> flush query cache;
Query OK, 0 rows affected (0.01 sec)

mysql> flush query cache;
ERROR 2013: Lost connection to MySQL server during query

mysql> flush query cache;
Query OK, 0 rows affected (0.00 sec)

mysql> flush query cache;
Query OK, 0 rows affected (0.01 sec)

mysql> show status LIKE "Qcache%";
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_queries_in_cache | 724 |
| Qcache_inserts | 1241 |
| Qcache_hits | 2572 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 30 |
| Qcache_free_memory | 32275096 |
| Qcache_free_blocks | 15 |
| Qcache_total_blocks | 1540 |
+-------------------------+----------+
8 rows in set (0.00 sec)

mysql> flush query cache;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80a9a91 handle_segfault + 481
0x8296fd8 pthread_sighandler + 176
0x813a520 Query_cache::move_by_type(char**, Query_cache_block**, unsigned
long*, Query_cache_block*) + 1376
0x8139f21 Query_cache::pack_cache() + 97
0x8137bda Query_cache::pack(unsigned long, unsigned) + 26
0x80bcd89 reload_acl_and_cache(THD*, unsigned long, st_table_list*) + 537
0x80ba2f4 mysql_execute_command(THD*) + 14196
0x80bba68 mysql_parse(THD*, char*, unsigned) + 248
0x80b5a8a dispatch_command(enum_server_command, THD*, char*, unsigned) + 842
0x80b5726 do_command(THD*) + 118
0x80b500e handle_one_connection + 910
0x82949fa pthread_start_thread + 218
0x82c8d1a thread_start + 4

Note in sql_cache.h I have
#define QUERY_CACHE_MIN_RESULT_DATA_SIZE 2500
instead of
#define QUERY_CACHE_MIN_RESULT_DATA_SIZE 1024*4

In my my.cnf :

set-variable = query_cache_size=32M

I even succeeded in locking the server (missing mutex ?) :

mysql> show status LIKE "Qcache%";
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_queries_in_cache | 1057 |
| Qcache_inserts | 2576 |
| Qcache_hits | 4898 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 60 |
| Qcache_free_memory | 32056208 |
| Qcache_free_blocks | 9 |
| Qcache_total_blocks | 2221 |
+-------------------------+----------+
8 rows in set (0.00 sec)

mysql> flush query cache;


A show processlist showed a lot of NULL state process:

+-----+---------+-----------+------------+----------------+- -----+----------
----------+------------------------------------------------- ----------------
-------------------------------------+
| Id | User | Host | db | Command | Time | State
| Info
|
+-----+---------+-----------+------------+----------------+- -----+----------
----------+------------------------------------------------- ----------------
-------------------------------------+
| 12 | DELAYED | localhost | Hardwarefr | Delayed_insert | 56 | Waiting
for INSERT |
|
| 13 | DELAYED | localhost | Hardwarefr | Delayed_insert | 56 | Waiting
for INSERT |
|
| 63 | DELAYED | localhost | Hardwarefr | Delayed_insert | 35 | Waiting
for INSERT |
|
| 64 | DELAYED | localhost | Hardwarefr | Delayed_insert | 35 | Waiting
for INSERT |
|
| 113 | root | localhost | NULL | Query | 24 | NULL
| flush query cache
|
| 163 | mysql | localhost | Hardwarefr | Query | 31 | query end
| SELECT IF(nom IS NULL,0,nom),forumadmin.forum FROM online,forumadmin LEFT
JOIN forumcathardwarefr ON |
| 165 | mysql | localhost | Hardwarefr | Query | 31 | update
| INSERT INTO threadhardwarefr12
(numeropost,icone,contenu,pseudo,date,signature,ip,realip) VALUES (74 |
| 166 | mysql | localhost | Hardwarefr | Query | 31 | NULL
| SELECT PostMax1,PostMax2,freemodo,positionPub,LOWER(forum),up FROM
forumadmin WHERE defaut=1 |
| 167 | mysql | localhost | Hardwarefr | Query | 31 | NULL
| SELECT admin,nb_inscrit,PostMax2,da,LOWER(forum),positionPub,up,son dage
FROM forumadmin WHERE defaut |
| 168 | mysql | localhost | Hardwarefr | Query | 31 | NULL
| SELECT
LOWER(forum),PostMax2,freemodo,HTML,positionPub,up,maxsignat ure,maxsmilies,n
bdrap FROM foruma |
| 169 | mysql | localhost | Hardwarefr | Query | 30 | NULL
| SELECT admin,nb_inscrit,PostMax2,da,LOWER(forum),positionPub,up,son dage
FROM forumadmin WHERE defaut |
| 170 | mysql | localhost | Hardwarefr | Query | 30 | NULL
| SELECT admin,nb_inscrit,PostMax2,da,LOWER(forum),positionPub,up,son dage
FROM forumadmin WHERE defaut |

| 311 | mysql | localhost | Hardwarefr | Query | 0 | NULL
| SELECT
LOWER(forum),PostMax2,freemodo,HTML,positionPub,up,maxsignat ure,maxsmilies,n
bdrap FROM foruma |
| 312 | mysql | localhost | Hardwarefr | Query | 0 | NULL
| SELECT PostMax2,da,PostMax1,freemodo,nbr_sondage,LOWER(forum),nbdra p FROM
forumadmin WHERE defaut=1 |
+-----+---------+-----------+------------+----------------+- -----+----------
----------+------------------------------------------------- ----------------
-------------------------------------+
154 rows in set (0.00 sec)

Regards,
Jocelyn


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13386@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with flush query cache in MySQL-4.1

am 01.01.2003 15:20:22 von Sanja Byelkin

Hi!

On Wed, Jan 01, 2003 at 01:34:07PM +0100, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> mysql> flush query cache;
> Query OK, 0 rows affected (0.01 sec)
>
> mysql> flush query cache;
> ERROR 2013: Lost connection to MySQL server during query
>
> mysql> flush query cache;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> flush query cache;
> Query OK, 0 rows affected (0.01 sec)
>
> mysql> show status LIKE "Qcache%";
> +-------------------------+----------+
> | Variable_name | Value |
> +-------------------------+----------+
> | Qcache_queries_in_cache | 724 |
> | Qcache_inserts | 1241 |
> | Qcache_hits | 2572 |
> | Qcache_lowmem_prunes | 0 |
> | Qcache_not_cached | 30 |
> | Qcache_free_memory | 32275096 |
> | Qcache_free_blocks | 15 |
> | Qcache_total_blocks | 1540 |
> +-------------------------+----------+
> 8 rows in set (0.00 sec)
>
> mysql> flush query cache;
> ERROR 2013: Lost connection to MySQL server during query

Thank you for bug report!
As I can, it is not repeatable, but I will try to investigate it.

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13388@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with flush query cache in MySQL-4.1

am 09.01.2003 15:46:15 von Jocelyn Fournier

Hi,

I changed

#define QUERY_CACHE_MIN_RESULT_DATA_SIZE 2500
back to
#define QUERY_CACHE_MIN_RESULT_DATA_SIZE 1024*4

It seems much more difficult to crash mysql issuing 'flush query cache'
command, but I finally succeed (but the crash happend this time *after* the
flush query cache seems to have succeeded).

I got the following stack trace :

0x80a9f91 handle_segfault + 481
0x829bad8 pthread_sighandler + 176
0x827c880 calc_hashnr + 32
0x827c10a hash_delete + 74
0x8139721 Query_cache::free_query(Query_cache_block*) + 33
0x8138944 Query_cache::invalidate(THD*, st_table_list*, char) + 244
0x80eb94b mysql_update(THD*, st_table_list*, List&, List&,
Item*, st_order*, unsigned long, enum_duplicates) + 3147
0x80b81a0 mysql_execute_command(THD*) + 3600
0x80bc3c8 mysql_parse(THD*, char*, unsigned) + 248
0x80b6283 dispatch_command(enum_server_command, THD*, char*, unsigned) + 867
0x80b5ed2 do_command(THD*) + 130
0x80b578e handle_one_connection + 910
0x82994fa pthread_start_thread + 218
0x82cd81a thread_start + 4

I also once again succeeded in locking the server using flush query cache
(NULL state process).

Unfortunately compiling in debug mode is too slow in production so I'm not
able to get the server crash (if I have more time I could try to enable
DBUG_PRINT for query_cache stuff only).

Regards,
Jocelyn

> Hi!
>
> On Wed, Jan 01, 2003 at 01:34:07PM +0100, Jocelyn Fournier wrote:
> > Hi,
> >
> > How-to-repeat :
> >
> > mysql> flush query cache;
> > Query OK, 0 rows affected (0.01 sec)
> >
> > mysql> flush query cache;
> > ERROR 2013: Lost connection to MySQL server during query
> >
> > mysql> flush query cache;
> > Query OK, 0 rows affected (0.00 sec)
> >
> > mysql> flush query cache;
> > Query OK, 0 rows affected (0.01 sec)
> >
> > mysql> show status LIKE "Qcache%";
> > +-------------------------+----------+
> > | Variable_name | Value |
> > +-------------------------+----------+
> > | Qcache_queries_in_cache | 724 |
> > | Qcache_inserts | 1241 |
> > | Qcache_hits | 2572 |
> > | Qcache_lowmem_prunes | 0 |
> > | Qcache_not_cached | 30 |
> > | Qcache_free_memory | 32275096 |
> > | Qcache_free_blocks | 15 |
> > | Qcache_total_blocks | 1540 |
> > +-------------------------+----------+
> > 8 rows in set (0.00 sec)
> >
> > mysql> flush query cache;
> > ERROR 2013: Lost connection to MySQL server during query
>
> Thank you for bug report!
> As I can, it is not repeatable, but I will try to investigate it.
>
> --
> For technical support contracts, visit https://order.mysql.com/
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
> /_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
> <___/ www.mysql.com
>
>
>


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13433@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with flush query cache in MySQL-4.1

am 09.01.2003 16:38:07 von Sanja Byelkin

On Thu, Jan 09, 2003 at 02:46:15PM -0000, Jocelyn Fournier wrote:
> Hi,
>
> I changed
>
> #define QUERY_CACHE_MIN_RESULT_DATA_SIZE 2500
> back to
> #define QUERY_CACHE_MIN_RESULT_DATA_SIZE 1024*4
>
> It seems much more difficult to crash mysql issuing 'flush query cache'
> command, but I finally succeed (but the crash happend this time *after* the
> flush query cache seems to have succeeded).

Thank you. I thin it will be helpful for bug hunting.

[skip]

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13434@lists.mysql.com
To unsubscribe, e-mail