[MDEV-7182] server crash while testing optimizer_use_condition_selectivity=5 Created: 2014-11-24  Updated: 2014-11-25  Due: 2014-12-10  Resolved: 2014-11-25

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0.14
Fix Version/s: 10.0.15

Type: Bug Priority: Major
Reporter: roberto spadim Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-6808 MariaDB 10.0.13 crash with optimizer_... Closed

 Description   

using original (downloaded some hours ago) mariadb-10.0.14 (glibc < 2.14 binary package)

running

# ldd --version
ldd (GNU libc) 2.8

141124  0:31:37 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see http://kb.askmonty.org/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
 
Server version: 10.0.14-MariaDB-log
key_buffer_size=5242880000
read_buffer_size=6291456
max_used_connections=51
max_threads=92
thread_count=10
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 6252379 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x0x7f775cd68008
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x406f70a0 thread_stack 0x48000
mysys/stacktrace.c:247(my_print_stacktrace)[0xbbcdbe]
sql/signal_handler.cc:153(handle_fatal_signal)[0x71a83c]
/lib/libpthread.so.0[0x7f78c071f8f0]
sql/sql_select.cc:7228(table_multi_eq_cond_selectivity)[0x5bd42c]
sql/sql_select.cc:7719(best_extension_by_limited_search)[0x5ddf62]
sql/sql_select.cc:6901(greedy_search)[0x5df62b]
sql/sql_select.cc:4022(make_join_statistics)[0x5e5de3]
sql/sql_select.cc:1338(JOIN::optimize_inner())[0x5e6c5a]
sql/sql_select.cc:1036(JOIN::optimize())[0x5e9bf2]
sql/sql_select.cc:372(handle_select(THD*, LEX*, select_result*, unsigned long))[0x5ed99d]
sql/sql_parse.cc:5270(execute_sqlcom_select)[0x5902a0]
sql/sql_parse.cc:2552(mysql_execute_command(THD*))[0x595cc7]
sql/sql_parse.cc:6415(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x59d0aa]
sql/sql_parse.cc:6415(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x59d0aa]
sql/sql_parse.cc:1309(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x59ee57]
sql/sql_parse.cc:1004(do_command(THD*))[0x59f568]
sql/sql_connect.cc:1379(do_handle_one_connection(THD*))[0x668074]
sql/sql_connect.cc:1295(handle_one_connection)[0x6681b2]
/lib/libpthread.so.0[0x7f78c0717fe7]
/lib/libc.so.6(clone+0x6d)[0x7f78bf6b82bd]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f775fdfb020): is an invalid pointer
Connection ID (thread ID): 3979
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
141124 00:31:39 mysqld_safe Number of processes running now: 0
141124 00:31:39 mysqld_safe mysqld restarted


query:

SELECT SQL_NO_CACHE SQL_SMALL_RESULT  
b.valor_un_produto+(b.valor_un_pg-b.valor_un),b.data_hora FROM spamov_itens AS b,spamov AS a 
WHERE 
b.unidade_id=a.unidade_id AND b.lote_tipo=a.lote_tipo AND b.lote_spa=a.lote_spa AND 
a.unidade_id=1001 AND a.lote_tipo='v' AND b.item_id=67 AND b.item_id_red=969 AND 
a.cliente_tipo='j' AND a.cliente_id=23283 ORDER BY a.lote_spa DESC LIMIT 1



 Comments   
Comment by roberto spadim [ 2014-11-24 ]

the same occurs to
set @@optimizer_use_condition_selectivity >= 2;
only set @@optimizer_use_condition_selectivity=1; works...
that's a consistent server crash

Comment by roberto spadim [ 2014-11-24 ]

same occurs if i remove SQL_NO_CACHE (and/or) SQL_SMALL_RESULT

Comment by roberto spadim [ 2014-11-24 ]

even EXPLAIN don't work

Comment by roberto spadim [ 2014-11-24 ]

reading sql_select.cc is something near:

          for (uint j= 0; j < keyparts && adjust_sel; j++)
	  {
            if (j > 0)
              keyuse+= ref_keyuse_steps[j-1];  
            Item *ref_item= keyuse->val;
	    if (ref_item->real_item()->type() == Item::FIELD_ITEM) <<--- here?!
	    {
              Item_field *field_item= (Item_field *) (ref_item->real_item());
              if (item_equal->contains(field_item->field))
                adjust_sel= FALSE;              
	    }
          }

Comment by Elena Stepanova [ 2014-11-24 ]

Hi Roberto,

Please either provide the table structures, and preferably the data, or try the current 10.0 tree. There was a similar bug which was fixed in 10.0.15 (soon to be released): MDEV-6808

Comment by roberto spadim [ 2014-11-24 ]

the table have more than 12gb
should be interesting updating with this patch
whereis the current development code of 10.0.15? at bzr?

Comment by Elena Stepanova [ 2014-11-24 ]

Yes, you can try the top of bzr tree, or pick up binary or source packages here: http://hasky.askmonty.org/archive/pack/10.0/build-6865/

Comment by roberto spadim [ 2014-11-24 ]

what package is the brinary tgz with glibc<2.14?
http://hasky.askmonty.org/archive/pack/10.0/build-6865/kvm-bintar-quantal-amd64/

Comment by Elena Stepanova [ 2014-11-24 ]

http://hasky.askmonty.org/archive/pack/10.0/build-6865/kvm-bintar-centos5-amd64/

Comment by roberto spadim [ 2014-11-24 ]

ok i will download, and check when i can upgrade and test at production maybe at 20:00, not it's 13:06 here

50kb/s, very slow internet... any news i comment again

Comment by Elena Stepanova [ 2014-11-24 ]

No rush, it won't make to 10.0.15 anyway, and there is a month or so till 10.0.16.

Comment by roberto spadim [ 2014-11-25 ]

database upgraded, i iwll start testing

Comment by roberto spadim [ 2014-11-25 ]

no crash i think it's nice to close this bug as duplicated

Comment by Elena Stepanova [ 2014-11-25 ]

Thanks for checking. Closing as fixed in 10.0.15, apparently by the fix for MDEV-6808.

Generated at Thu Feb 08 07:17:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.