[MDEV-32872] mysqld got signal 11 Created: 2023-11-24  Updated: 2023-12-20  Resolved: 2023-11-24

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.6.10, 10.7, 11.3.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Uwe Käckenmeister Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: crash, innodb
Environment:

debian 11(dockerized)


Issue Links:
Duplicate
duplicates MDEV-29681 Server crashes when optimizing SQL wi... Stalled

 Description   

Following Queries crashes the Server:

CREATE TEMPORARY TABLE TableA (A INT AUTO_INCREMENT, B INT, PRIMARY KEY (A));
CREATE TEMPORARY TABLE TableB (A VARCHAR(100), B INT);
 
(
    SELECT
        TableA.A AS AA, TableB.A AS BA
    FROM TableA
        LEFT JOIN TableB ON TableB.B = TableA.B
    GROUP BY TableA.A, TableB.A
    ORDER BY CAST(CAST(TableB.A AS DECIMAL) AS UNSIGNED)
)
ORDER BY CAST(CAST(BA AS DECIMAL) AS UNSIGNED)

Server-Output:

[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 https://mariadb.com/kb/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.6.10-MariaDB-1:10.6.10+maria~ubu2004-log
key_buffer_size=134217728
read_buffer_size=2097152
max_used_connections=22
max_threads=302
thread_count=22
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1994400 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7f8bcf207718
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 = 0x7f8bdc0a5558 thread_stack 0x49000
Printing to addr2line failed
mysqld(my_print_stacktrace+0x32)[0x55a3c860ccf2]
mysqld(handle_fatal_signal+0x485)[0x55a3c80cc475]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7f8c7757f420]
mysqld(+0x625278)[0x55a3c7d11278]
mysqld(_ZN4JOIN8optimizeEv+0xc3)[0x55a3c7f02c83]
mysqld(_Z12mysql_selectP3THDP10TABLE_LISTR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xb7)[0x55a3c7f02d57]
mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x157)[0x55a3c7f03567]
mysqld(+0x7a59b1)[0x55a3c7e919b1]
mysqld(_Z21mysql_execute_commandP3THDb+0x44d1)[0x55a3c7e9fe11]
mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e7)[0x55a3c7e8c577]
mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x10b5)[0x55a3c7e988b5]
mysqld(_Z10do_commandP3THDb+0x13e)[0x55a3c7e9ab0e]
mysqld(_Z24do_handle_one_connectionP7CONNECTb+0x3b7)[0x55a3c7fac5a7]
mysqld(handle_one_connection+0x5d)[0x55a3c7fac8fd]
mysqld(+0xc27036)[0x55a3c8313036]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609)[0x7f8c77573609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f8c7715f133]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f8bcf23f1b0): (
    SELECT
        TableA.A AS AA, TableB.A AS BA
    FROM TableA
        LEFT JOIN TableB ON TableB.B = TableA.B
    GROUP BY TableA.A, TableB.A
    ORDER BY CAST(CAST(TableB.A AS DECIMAL) AS UNSIGNED)
)
ORDER BY CAST(CAST(BA AS DECIMAL) AS UNSIGNED)
 
Connection ID (thread ID): 2684
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /var/lib/mysql
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        unlimited            unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             1048576              1048576              processes 
Max open files            1048576              1048576              files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       128548               128548               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: core

This seems to be reproducible in all versions. Also in the current HEAD version



 Comments   
Comment by Alice Sherepa [ 2023-11-24 ]

Thanks! This is the same bug as MDEV-29681, I will add the test case there

Generated at Thu Feb 08 10:34:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.