Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.2
-
None
-
ubuntu 12.04 (64bit) , 10.0.2-MariaDB-debug
Description
When using thread pool and execute 'select sleep(10);', the server crashed.
[How to repeat]
In the my.cnf, set thread_pool_handling=pool-of-threads
Then connect to the server:
MariaDB [(none)]> select sleep(10000);
Then the server crashed with the information below:
mysqld: /home/loushuai/src/mariadb/10.0/sql/threadpool_unix.cc:1283: void tp_wait_begin(THD*, int): Assertion `!connection->waiting' failed.
Program received signal SIGABRT, Aborted.
[Reason]
repeat to enter the tp_wait_begin() in
longlong Item_func_sleep::val_int() function in file sql/item_func.cc
[How to fix]
see the patch in attachment.
Reproducible for sleeps longer than 5 seconds
(Interruptible_wait::wait() periodically checks if connection is alive, and assertion is triggered in such a check, in vio_is_connected(), in vio_io_wait() with timeout 0.
sql/threadpool_unix.cc:1271(tp_wait_begin(THD*, int))[0x7aeb56]
sql/sql_class.cc:4159(thd_wait_begin)[0x5e82f6]
sql/scheduler.cc:68(scheduler_wait_net_begin)[0x728ecd]
vio/viosocket.c:967(vio_io_wait)[0xd80b7c]
vio/viosocket.c:1194(vio_is_connected)[0xd80e63]
sql/sql_class.h:2796(THD::is_connected())[0x5ed3ba]
sql/item_func.cc:3884(Interruptible_wait::wait(st_mysql_cond*, st_mysql_mutex*))[0x84f9d4]
sql/item_func.cc:4398(Item_func_sleep::val_int())[0x850df5]
sql/item.cc:6379(Item::send(Protocol*, String*))[0x806c44]
sql/protocol.cc:900(Protocol::send_result_set_row(List<Item>*))[0x57ef41]
sql/sql_class.cc:2416(select_send::send_data(List<Item>&))[0x5e2e2c]