------------------------------------------- http://bugs.mysql.com/bug.php?id=60682 (deadlock from thd_security_context) ------------------------------------------- Repeated on Windows with my.ini: ------------------------------------------- [mysqld] skip-grant-tables skip-name-resolve sync-frm=0 sync-binlog=0 innodb_flush_log_at_trx_commit=0 innodb_support_xa=0 core-file console flush_time=0 innodb_file_per_table innodb_lock_wait_timeout=1 #innodb_file_format=barracuda shared-memory=1 ------------------------------------------- Testcase statements on my app: gypsy --queryfile=mc.sql --threads=10 --duration=900 --shuffle-queries=1 > nul i|1|set global innodb_flush_log_at_trx_commit=0 i|1|set global sync_frm=0 i|1|drop table if exists t1,t2,t3 i|1|create table t1(a int)engine=innodb n|1..10|show engine innodb status n|1|select id from information_schema.processlist where id<>connection_id() and info like 'select%' order by rand() limit 1 into @a; n|1|kill @a; n|1|start transaction| n|1..10|select * from t2 n|1|rename table t1 to t2 n|1|drop table if exists t2 n|1|create table if not exists t1(a int)engine=innodb ------------------------------------------- Unmodified 5.1.57: I:\mysql\5.1\5.1.57\mysql-5.1.57-win32\bin>mysqld --console 110608 12:02:00 [Note] Plugin 'FEDERATED' is disabled. 110608 12:02:01 InnoDB: Initializing buffer pool, size = 8.0M 110608 12:02:01 InnoDB: Completed initialization of buffer pool 110608 12:02:01 InnoDB: Started; log sequence number 0 280282170 110608 12:02:01 [Note] mysqld: ready for connections. Version: '5.1.57-community' socket: '' port: 3306 MySQL Community Server (GPL) ------------------------------------------- Thread stacks: Thread 4792: ------------ Waits for LOCK_open. Thread 5196 owns LOCK_open. ntdll.dll!_ZwWaitForSingleObject@12() + 0x15 bytes ntdll.dll!_RtlpWaitOnCriticalSection@8() + 0xbf bytes ntdll.dll!_RtlEnterCriticalSection@4() + 0x93a2 bytes > mysqld.exe!open_table(THD * thd=0x030de330, TABLE_LIST * table_list=0x04e71ff8, st_mem_root * mem_root=0x052ae58c, bool * refresh=0x052ae5b0, unsigned int flags=0x00000000) Line 2737 C++ mysqld.exe!open_tables(THD * thd=0x030de300, TABLE_LIST * * start=0x052ae5d4, unsigned int * counter=0x052ae5c8, unsigned int flags=0x00000000) Line 4623 + 0x16 bytes C++ mysqld.exe!open_and_lock_tables_derived(THD * thd=0x030de330, TABLE_LIST * tables=0x04e71ff8, bool derived=true) Line 5041 + 0x16 bytes C++ mysqld.exe!execute_sqlcom_select(THD * thd=0x00000000, TABLE_LIST * all_tables=0x00000000) Line 5137 + 0x9 bytes C++ mysqld.exe!mysql_execute_command(THD * thd=0x030de330) Line 2307 + 0xb bytes C++ mysqld.exe!mysql_parse(THD * thd=0x030de330, char * rawbuf=0x04e71ec0, unsigned int length=0x00000010, const char * * found_semicolon=0x052af804) Line 6093 C++ mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x030de330, char * packet=0x04dcf019, unsigned int packet_length=0x00000010) Line 1277 C++ mysqld.exe!do_command(THD * thd=0x00000003) Line 893 C++ mysqld.exe!handle_one_connection(void * arg=0x030de330) Line 1296 + 0xa bytes C++ mysqld.exe!pthread_start(void * param=0x030d2ff0) Line 85 + 0x3 bytes C mysqld.exe!_callthreadstart() Line 293 + 0x6 bytes C Thread 5196: ------------ ntdll.dll!_LdrpCopyUnicodeString@8() + 0x1b bytes kernel32.dll!string "InternetClearAllPerSiteCookieDec"...() - 0x23cdc bytes kernel32.dll!string "InternetCrackUrlW"() - 0x27062 bytes > mysqld.exe!os_event_wait_low(os_event_struct * event=0x0255d0f8, __int64 reset_sig_count=0) Line 391 C mysqld.exe!sync_array_wait_event(sync_array_struct * arr=0x024dd7a8, unsigned long index=0) Line 450 C mysqld.exe!mutex_spin_wait(mutex_struct * mutex=0x02dd0180, const char * file_name=0x0078b334, unsigned long line=363) Line 594 + 0x14 bytes C mysqld.exe!mutex_enter_func(mutex_struct * mutex=0x02dd0180, const char * file_name=0x0078b334, unsigned long line=363) Line 259 + 0x10 bytes C mysqld.exe!trx_free_for_mysql(trx_struct * trx=0x02de8c80) Line 365 C mysqld.exe!ha_innobase::create(const char * name=0x0608e7bc, st_table * form=0x0608dc5c, st_ha_create_information * create_info=0x0608ea78) Line 5814 + 0x6 bytes C++ mysqld.exe!handler::ha_create(const char * name=0x0608e7bc, st_table * form=0x0608dc5c, st_ha_create_information * info=0x0608ea78) Line 3421 + 0x1b bytes C++ mysqld.exe!ha_create_table(THD * thd=0x04e28a88, const char * path=0x0608e7bc, const char * db=0x04e331e0, const char * table_name=0x04e32fe0, st_ha_create_information * create_info=0x0608ea78, bool update_create_info=false) Line 3629 C++ mysqld.exe!rea_create_table(THD * thd=0x04e28a88, const char * path=0x0608e7bc, const char * db=0x04e331e0, const char * table_name=0x04e32fe0, st_ha_create_information * create_info=0x0608ea78, List & create_fields={...}, unsigned int keys=0, st_key * key_info=0x04e33438, handler * file=0x04e332d8) Line 424 + 0x2d bytes C++ mysqld.exe!mysql_create_table_no_lock(THD * thd=0x04e28a88, const char * db=0x04e331e0, const char * table_name=0x04e32fe0, st_ha_create_information * create_info=0x0608ea78, Alter_info * alter_info=0x0608ec80, bool internal_tmp_table=false, unsigned int select_field_count=0) Line 3991 + 0x43 bytes C++ mysqld.exe!mysql_create_table(THD * thd=0x04e28a88, const char * db=0x04e331e0, const char * table_name=0x04e32fe0, st_ha_create_information * create_info=0x0608ea78, Alter_info * alter_info=0x0608ec80, bool internal_tmp_table=false, unsigned int select_field_count=0) Line 4086 + 0x18 bytes C++ mysqld.exe!mysql_execute_command(THD * thd=0x04e28a88) Line 2820 + 0x1b bytes C++ mysqld.exe!mysql_parse(THD * thd=0x04e28a88, char * rawbuf=0x04e32f28, unsigned int length=49, const char * * found_semicolon=0x0608f804) Line 6093 C++ mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x04e28a88, char * packet=0x04e3ef11, unsigned int packet_length=49) Line 1277 C++ mysqld.exe!do_command(THD * thd=0x00000003) Line 893 C++ mysqld.exe!handle_one_connection(void * arg=0x04e28a88) Line 1296 + 0xa bytes C++ mysqld.exe!pthread_start(void * param=0x04df8f60) Line 85 + 0x3 bytes C mysqld.exe!_callthreadstart() Line 293 + 0x6 bytes C Thread 2344: -------------- Waits for thd->LOCK_thd_data. Thread 5032 owns thd->LOCK_thd_data ntdll.dll!_LdrpCopyUnicodeString@8() + 0x1b bytes ntdll.dll!LoadOle32Export() - 0x26b51 bytes ntdll.dll!PropertyLengthAsVariant() - 0x26dd2 bytes > mysqld.exe!thd_security_context(THD * thd=0x04df2dd0, char * buffer=0x04d6e070, unsigned int length=1024, unsigned int max_query_len=600) Line 414 C++ mysqld.exe!innobase_mysql_print_thd(_iobuf * f=0x008b98b0, void * input_thd=0x04df2dd0, unsigned int max_query_len=600) Line 821 + 0x28 bytes C++ mysqld.exe!trx_print(_iobuf * f=0x008b98b0, trx_struct * trx=0x02de3c80, unsigned long max_query_len=600) Line 1763 + 0xc bytes C mysqld.exe!lock_print_info_all_transactions(_iobuf * file=0x008b98b0) Line 4315 + 0xc bytes C mysqld.exe!srv_printf_innodb_monitor(_iobuf * file=0x008b98b0, unsigned long nowait=0, unsigned long * trx_start=0x04d6e9cc, unsigned long * trx_end=0x04d6e9c8) Line 1725 C mysqld.exe!innodb_show_status(handlerton * hton=0x005b2cf4, THD * thd=0x04de3030, bool (THD *, const char *, unsigned int, const char *, unsigned int, const char *, unsigned int)* stat_print=0x00482b20) Line 7599 C++ mysqld.exe!innobase_show_status(handlerton * hton=0x024dd600, THD * thd=0x04de3030, bool (THD *, const char *, unsigned int, const char *, unsigned int, const char *, unsigned int)* stat_print=0x00482b20, ha_stat_type stat_type=HA_ENGINE_STATUS) Line 7759 + 0xf bytes C++ mysqld.exe!ha_show_status(THD * thd=0x04de3030, handlerton * db_type=0x024dd600, ha_stat_type stat=HA_ENGINE_STATUS) Line 4466 + 0x15 bytes C++ mysqld.exe!mysql_execute_command(THD * thd=0x04de3030) Line 2526 + 0xf bytes C++ mysqld.exe!mysql_parse(THD * thd=0x04de3030, char * rawbuf=0x04e129e8, unsigned int length=25, const char * * found_semicolon=0x04d6f804) Line 6093 C++ mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x04de3030, char * packet=0x030c1b31, unsigned int packet_length=25) Line 1277 C++ mysqld.exe!do_command(THD * thd=0x00000003) Line 893 C++ mysqld.exe!handle_one_connection(void * arg=0x04de3030) Line 1296 + 0xa bytes C++ mysqld.exe!pthread_start(void * param=0x030d4b38) Line 85 + 0x3 bytes C mysqld.exe!_callthreadstart() Line 293 + 0x6 bytes C Thread 5032: -------------- ntdll.dll!_LdrpCopyUnicodeString@8() + 0x1b bytes ntdll.dll!LoadOle32Export() - 0x26b51 bytes ntdll.dll!PropertyLengthAsVariant() - 0x26dd2 bytes > mysqld.exe!THD::awake(THD::killed_state state_to_set=KILL_CONNECTION) Line 1159 C++ mysqld.exe!kill_one_thread(THD * thd=0x04e38f40, unsigned long id=283, bool only_kill_query=false) Line 7157 C++ mysqld.exe!sql_kill(THD * thd=0x04e38f40, unsigned long id=283, bool only_kill_query=false) Line 7177 + 0x16 bytes C++ mysqld.exe!mysql_execute_command(THD * thd=0x04e38f40) Line 4126 + 0x20 bytes C++ mysqld.exe!mysql_parse(THD * thd=0x04e38f40, char * rawbuf=0x04dec018, unsigned int length=7, const char * * found_semicolon=0x0566f804) Line 6093 C++ mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x04e38f40, char * packet=0x04e24a79, unsigned int packet_length=8) Line 1277 C++ mysqld.exe!do_command(THD * thd=0x00000003) Line 893 C++ mysqld.exe!handle_one_connection(void * arg=0x04e38f40) Line 1296 + 0xa bytes C++ mysqld.exe!pthread_start(void * param=0x04dfac30) Line 85 + 0x3 bytes C mysqld.exe!_callthreadstart() Line 293 + 0x6 bytes C