mysqld: /sql/sql_array.h:63: Element_type& Bounds_checked_array<Element_type>::operator[](size_t) [with Element_type = Item*]: Assertion `n < m_size' failed | handle_fatal_signal in operator[] in sql/sql_array.h:63

Bug #1200850 reported by Roel Van de Paar on 2013-07-13
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to
Roel Van de Paar
Won't Fix
Roel Van de Paar

Bug Description

2013-07-13 03:40:20 24666 [Note] /ssd/Percona-Server-5.6.12-rc60.4-405-debug.Linux.x86_64/bin/mysqld: ready for connections.
Version: '5.6.12-rc60.4-debug-log' socket: '/ssd/837240/current1_3/tmp/master.sock' port: 13040 Percona Server with XtraDB (GPL), Release rc60.4, Revision 405-debug
2013-07-13 03:41:38 24666 [Note] Event Scheduler: scheduler thread started with id 46
mysqld: /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/sql_array.h:63: Element_type& Bounds_checked_array<Element_type>::operator[](size_t) [with Element_type = Item*]: Assertion `n < m_size' failed.
00:41:48 UTC - mysqld got signal 6 ;

Thread 1 (LWP 25076):
#0 0x000000340cc0c69c in pthread_kill () from /lib64/
#1 0x0000000000686bde in handle_fatal_signal (sig=6) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#2 <signal handler called>
#3 0x000000340c4328a5 in raise () from /lib64/
#4 0x000000340c434085 in abort () from /lib64/
#5 0x000000340c42ba1e in __assert_fail_base () from /lib64/
#6 0x000000340c42bae0 in __assert_fail () from /lib64/
#7 0x00000000008b11f0 in operator[] (n=<optimized out>, this=<optimized out>) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/sql_array.h:63
#8 create_distinct_group (thd=0x2979130, ref_pointer_array=..., order_list=<optimized out>, fields=..., all_fields=..., all_order_by_fields_used=0x7f5e8a3c9178) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#9 0x00000000008c1397 in JOIN::optimize (this=0x7f5e30005518) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#10 0x0000000000749279 in mysql_execute_select (free_join=true, select_lex=0x297bc08, thd=0x2979130) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#11 mysql_select (thd=0x2979130, tables=0x7f5e30004ed8, wild_num=1, fields=..., conds=0x0, order=<optimized out>, group=0x297bd08, having=0x0, select_options=2147781377, result=0x7f5e300054f0, unit=0x297b5c0, select_lex=0x297bc08) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#12 0x0000000000749dbb in handle_select (thd=0x2979130, result=0x7f5e300054f0, setup_tables_done_option=0) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#13 0x000000000071ecdd in execute_sqlcom_select (thd=0x2979130, all_tables=0x7f5e30004ed8) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#14 0x00000000007217b7 in mysql_execute_command (thd=0x2979130) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#15 0x0000000000727818 in mysql_parse (thd=0x2979130, rawbuf=0x297b4f8 "\360R7\001", length=<optimized out>, parser_state=<optimized out>) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#16 0x000000000072871f in dispatch_command (command=COM_QUERY, thd=0x2979130, packet=0x297d0c1 "/* GenTest::Transform::Distinct */ SELECT DISTINCT * FROM f /* TRANSFORM_OUTCOME_DISTINCT */ ", packet_length=93) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#17 0x0000000000729a47 in do_command (thd=0x2979130) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#18 0x00000000006ed63f in do_handle_one_connection (thd_arg=<optimized out>) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#19 0x00000000006ed727 in handle_one_connection (arg=0x2979130) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/sql/
#20 0x00000000009dd6c9 in pfs_spawn_thread (arg=0x29262c0) at /bzr/5.6_dbg/Percona-Server-5.6.12-rc60.4/storage/perfschema/
#21 0x000000340cc07851 in start_thread () from /lib64/
#22 0x000000340c4e890d in clone () from /lib64/

Roel Van de Paar (roel11) wrote :
Roel Van de Paar (roel11) wrote :
Roel Van de Paar (roel11) wrote :
Roel Van de Paar (roel11) wrote :

[roel@qaserver 837240]$ cat cmd27
ps -ef | grep 'cmdrun_27' | grep -v grep | awk '{print $2}' | xargs sudo kill -9
rm -Rf /ssd/837240/cmdrun_27
mkdir /ssd/837240/cmdrun_27
cd /ssd/randgen
bash -c "set -o pipefail; perl /ssd/randgen/ --queries=100000000 --seed=9763 --duration=300 --querytimeout=60 --reporter=Shutdown,Backtrace,QueryTimeout,ErrorLog,ErrorLogAlarm --mysqld=--log-output=none --mysqld=--sql_mode=ONLY_FULL_GROUP_BY --mysqld=--slow_query_log --mysqld=--userstat --threads=25 --mysqld=--innodb_file_per_table=1 --validator=Transformer --basedir=/ssd/Percona-Server-5.6.12-rc60.4-405-debug.Linux.x86_64 --grammar=/tmp/442350/34.yy --gendata=/ssd/randgen/conf/replication/replication_single_engine.zz --mtr-build-thread=746 --mask=19306 --vardir1=/ssd/837240/cmdrun_27 > /ssd/837240/cmdrun27.log 2>&1"

Roel Van de Paar (roel11) wrote :

Almost guaranteed upstream bug. Roel, can you please verify and report it there?

tags: added: upstream
tags: added: 56qual maybe
tags: removed: 56qual maybe

This could have been fixed in upstream 5.5.42/5.6.24 by

"The server could exit due to an optimizer failure to allocate enough memory for resolving outer references. (Bug #18782905, Bug #19892803)"

Is it possible to verify?

commit c9f7948bc47edc7ddc3b3693b9a3e4b623a97ca6
Author: Mithun C Y <email address hidden>
Date: Fri Jan 30 16:36:23 2015 +0530


    We pre-allocate the ref_pointer_array before we resolve outer
    references. This means that in some cases the
    ref_pointer_array may not be large enough to hold all
    references created. One such case is aggregate functions in
    having clause of a subquery which may add items to select list
    of outer query. So it is necessary to consider
    select_n_having_items for subqueries while allocating
    ref_pointer_array else we will get buffer overflow.

    Allocate a larger ref_pointer_array by aggregating
    select_n_having_items for subqueries.
    The fix in sql_yacc.yy is a backport from bug fix 18782905.

Launchpad Janitor (janitor) wrote :

[Expired for Percona Server 5.5 because there has been no activity for 60 days.]

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers