Percona-Server-5.5.27-rel28.0/sql/field.cc:3721: virtual longlong Field_long::val_int(): Assertion `table->in_use == _current_thd()' failed | sig 6 in Field_long::val_int

Bug #1045231 reported by Roel Van de Paar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Won't Fix
Undecided
Unassigned
5.5
New
High
Roel Van de Paar
5.6
New
Undecided
Roel Van de Paar
5.7
New
High
Roel Van de Paar

Bug Description

(gdb) bt
#0 0x00000033c380c60c in pthread_kill () from /lib64/libpthread.so.0
#1 0x00000000007db5f8 in my_write_core (sig=6) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/mysys/stacktrace.c:433
#2 0x00000000006b16d0 in handle_fatal_signal (sig=6) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/signal_handler.cc:249
#3 <signal handler called>
#4 0x00000033c3435925 in raise () from /lib64/libc.so.6
#5 0x00000033c34370d8 in abort () from /lib64/libc.so.6
#6 0x00000033c342e6a2 in __assert_fail_base () from /lib64/libc.so.6
#7 0x00000033c342e752 in __assert_fail () from /lib64/libc.so.6
#8 0x000000000069abf7 in Field_long::val_int (this=0x7f84140ac690) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/field.cc:3721
#9 0x00000000008476bc in ha_innobase::write_row (this=0x7f8414103cc0, record=<optimized out>) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/storage/innobase/handler/ha_innodb.cc:5937
#10 0x00000000006ba02a in handler::ha_write_row (this=0x7f8414103cc0, buf=0x7f84140ac5d0 "") at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/handler.cc:5334
#11 0x0000000000a27905 in ha_partition::write_row (this=0x7f8414132ea0, buf=<optimized out>) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/ha_partition.cc:3358
#12 0x00000000006ba02a in handler::ha_write_row (this=0x7f8414132ea0, buf=0x7f84140ac5d0 "") at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/handler.cc:5334
#13 0x00000000006087a0 in copy_data_between_tables (error_if_not_empty=false, keys_onoff=(unknown: 134960480), deleted=<synthetic pointer>, copied=<synthetic pointer>, order=0x0, order_num=0, ignore=false, create=..., to=0x7f841401eec0, from=0x7f84080b5560) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_table.cc:7363
#14 mysql_alter_table (thd=<optimized out>, new_db=<optimized out>, new_name=0x7f841403f750 "E", create_info=0x7f84340c6230, table_list=0x7f8414131b10, alter_info=0x7f84340c6170, order_num=0, order=0x0, ignore=false) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_table.cc:6667
#15 0x00000000007b9dad in Alter_table_statement::execute (this=<optimized out>, thd=0x32d7120) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_alter.cc:106
#16 0x000000000059f730 in mysql_execute_command (thd=thd@entry=0x32d7120) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_parse.cc:4582
#17 0x00000000005a0ace in mysql_parse (thd=thd@entry=0x32d7120, rawbuf=<optimized out>, length=47, parser_state=parser_state@entry=0x7f84340c7760) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_parse.cc:5811
#18 0x00000000005a15a8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x32d7120, packet=packet@entry=0x32dab91 "ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5", packet_length=packet_length@entry=47) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_parse.cc:1061
#19 0x00000000005a2b5e in do_command (thd=0x32d7120) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_parse.cc:788
#20 0x000000000064c4bc in do_handle_one_connection (thd_arg=thd_arg@entry=0x32d7120) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_connect.cc:1484
#21 0x000000000064c5b2 in handle_one_connection (arg=0x32d7120) at /percona-server/5.5.copy/Percona-Server-5.5.27-rel28.0/sql/sql_connect.cc:1391
#22 0x00000033c3807d14 in start_thread () from /lib64/libpthread.so.0
#23 0x00000033c34f167d in clone () from /lib64/libc.so.6

Testcase:

$ cd /randgen
$ ./runall.pl --queries=100000000 --seed=random --duration=3600 --reporter=Shutdown,Backtrace,Deadlock,ErrorLog --threads=80 --basedir=/percona-server/Percona-Server-5.5.27-rel28.0-294.Linux.x86_64 --grammar=/randgen/conf/runtime/information_schema.yy --mask=46021 --vardir1=/ssd/bug1/

Tags: qa
Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :

Asserts on: PS 5.5.27-rel28.0-294 built as debug
Does not assert on: MySQL 5.5.27 built as debug

Increasing the number of threads of the original (much larger) testcase made the server go OOM in minutes. Will see if I can add a simplified version of that testcase here also.

summary: - mysqld: /percona-server/5.5.copy/Percona-
- Server-5.5.27-rel28.0/sql/field.cc:3721: virtual longlong
+ Percona-Server-5.5.27-rel28.0/sql/field.cc:3721: virtual longlong
Field_long::val_int(): Assertion `table->in_use == _current_thd()'
failed | sig 6 in Field_long::val_int
Revision history for this message
Roel Van de Paar (roel11) wrote :

Testcase listed in this bug now produces bug 1202252 - thereby potentially making this bug in 5.6...

Revision history for this message
Roel Van de Paar (roel11) wrote :

s/making/masking/

Revision history for this message
Roel Van de Paar (roel11) wrote :

Testing latest 5.5 (debug) with testcase and it still crashes;

mysqld: /bzr/5.5_dbg/Percona-Server-5.5.32-rel31.0/sql/field.cc:3721: virtual longlong Field_long::val_int(): Assertion `table->in_use == _current_thd()' failed
05:16:59 UTC - mysqld got signal 6 ;

(Optimized cannot be tested; # 2013-08-24T15:22:19 Query: SHOW PROCEDURE CODE n failed: 1289 The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working -> ends RQG)

Revision history for this message
Roel Van de Paar (roel11) wrote :

Upstream still does not crash in latest 5.5, though a bit more testing may be good.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Depends on the I_S.TEMP_TABLE query presence and needs retesting with the current 5.5-QA and (shortly updated) 5.6-QA trees.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Per comment #7, as lots of bugs have been fixed in I_S temp tables, this need re-verification.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-583

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.