@aboettger-tuhh opened this Issue on February 26th 2021
210226 15:49:51 [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.
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
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.
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
Server version: 10.5.9-MariaDB-1:10.5.9+maria~focal-log
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=2
max_threads=153
thread_count=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467864 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
Thread pointer: 0x7f0104000c58
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 = 0x7f0144c81d58 thread_stack 0x49000
mysqld(my_print_stacktrace+0x32)[0x5556d6cc0af2]
Printing to addr2line failed
mysqld(handle_fatal_signal+0x485)[0x5556d67166f5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f015ac793c0]
mysqld(+0x5fecae)[0x5556d63a9cae]
mysqld(+0xab2333)[0x5556d685d333]
mysqld(+0xab20c3)[0x5556d685d0c3]
mysqld(+0xab2333)[0x5556d685d333]
mysqld(+0xab20c3)[0x5556d685d0c3]
mysqld(+0xab2333)[0x5556d685d333]
mysqld(+0xab2c7f)[0x5556d685dc7f]
mysqld(+0xab34c5)[0x5556d685e4c5]
mysqld(_ZN13Item_cond_and11get_mm_treeEP15RANGE_OPT_PARAMPP4Item+0x92)[0x5556d685e8e2]
mysqld(_ZN10SQL_SELECT17test_quick_selectEP3THD6BitmapILj64EEyybbbb+0xf56)[0x5556d6865266]
mysqld(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_orderybPySA_+0xa6d)[0x5556d65c841d]
mysqld(_Z21mysql_execute_commandP3THD+0x3d1f)[0x5556d650d42f]
mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x1ef)[0x5556d64faa9f]
mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x134f)[0x5556d650665f]
mysqld(_Z10do_commandP3THD+0x117)[0x5556d6508a37]
mysqld(_Z24do_handle_one_connectionP7CONNECTb+0x411)[0x5556d660e341]
mysqld(handle_one_connection+0x5d)[0x5556d660e7bd]
mysqld(+0xbc1c66)[0x5556d696cc66]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x9609)[0x7f015ac6d609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f015a85c293]
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f0104010480): UPDATE piwik_archive_numeric_2020_12 SET value = 4 WHERE name LIKE 'done%'<a href='/015'>#015</a>
AND idsite IN (1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28)<a href='/015'>#015</a>
AND ((period = 5 AND ((date1 <= '2020-12-01' AND '2020-12-01' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-01' AND '2020-12-31' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-02' AND '2020-12-02' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-03' AND '2020-12-03' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-04' AND '2020-12-04' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-05' AND '2020-12-05' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-06' AND '2020-12-06' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-07' AND '2020-12-07' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-07' AND '2020-12-13' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-08' AND '2020-12-08' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-09' AND '2020-12-09' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-10' AND '2020-12-10' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-11' AND '2020-12-11' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-12' AND '2020-12-12' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-13' AND '2020-12-13' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-14' AND '2020-12-14' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-14' AND '2020-12-20' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-15' AND '2020-12-15' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-16' AND '2020-12-16' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-17' AND '2020-12-17' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-18' AND '2020-12-18' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-19' AND '2020-12-19' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-20' AND '2020-12-20' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-21' AND '2020-12-21' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-21' AND '2020-12-27' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-22' AND '2020-12-22' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-23' AND '2020-12-23' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-24' AND '2020-12-24' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-25' AND '2020-12-25' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-26' AND '2020-12-26' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-27' AND '2020-12-27' <= date2))) OR (period =5 AND ((date1 <= '2020-12-28' AND '2020-12-28' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-28' AND '2021-01-03' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-29' AND '2020-12-29' <=date2))) OR (period = 5 AND ((date1 <= '2020-12-30' AND '2020-12-30' <= date2))) OR (period = 5 AND ((date1 <= '2020-12-31' AND '2020-12-31' <= date2))))

Connection ID (thread ID): 72
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
Feb 26 16:49:51 fizban docker/matomo_u03980ef286m_db_1[1965]:
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             unlimited            unlimited            processes
Max open files            1048576              1048576              files
Max locked memory         67108864             67108864             bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       63984                63984                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: |/usr/share/apport/apport %p %s %c %d %P %E

Your Environment

  • Matomo Version: 4.2.0
  • PHP Version: 7.4.15
  • Server Operating System: Docker Images
  • Additionally installed plugins:
  • Browser:
  • Operating System: mariadb:10, ubuntu:20.04
@davidmehren commented on February 28th 2021

I can confirm the regular segfault after upgrading to 4.2 today.
For me it is this query:

Details ``` UPDATE matomo_archive_numeric_2020_12 SET value = 4 WHERE name LIKE 'done%' AND idsite IN ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19 ) AND ( ( period = 5 AND (( date1 <= '2020-12-01' AND '2020-12-01' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-01' AND '2020-12-31' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-02' AND '2020-12-02' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-03' AND '2020-12-03' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-04' AND '2020-12-04' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-05' AND '2020-12-05' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-06' AND '2020-12-06' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-07' AND '2020-12-07' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-07' AND '2020-12-13' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-08' AND '2020-12-08' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-09' AND '2020-12-09' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-10' AND '2020-12-10' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-11' AND '2020-12-11' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-12' AND '2020-12-12' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-13' AND '2020-12-13' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-14' AND '2020-12-14' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-14' AND '2020-12-20' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-15' AND '2020-12-15' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-16' AND '2020-12-16' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-17' AND '2020-12-17' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-18' AND '2020-12-18' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-19' AND '2020-12-19' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-20' AND '2020-12-20' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-21' AND '2020-12-21' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-21' AND '2020-12-27' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-22' AND '2020-12-22' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-23' AND '2020-12-23' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-24' AND '2020-12-24' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-25' AND '2020-12-25' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-26' AND '2020-12-26' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-27' AND '2020-12-27' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-28' AND '2020-12-28' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-28' AND '2021-01-03' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-29' AND '2020-12-29' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-30' AND '2020-12-30' <= date2 )) ) OR ( period = 5 AND (( date1 <= '2020-12-31' AND '2020-12-31' <= date2 )) ) ) ```

When running MariaDB in valgrind I get:

==60887== Memcheck, a memory error detector                                                                                                                                               ==60887== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==60887== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info                                                                                                              ==60887== Command: mariadbd                                                                                                                                                               
==60887==
2021-02-28 21:41:50 0 [Note] mariadbd (mysqld 10.5.9-MariaDB-1:10.5.9+maria~focal-log) starting as process 60887 ...
2021-02-28 21:41:50 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 66075)2021-02-28 21:41:50 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 500 (was 500)  table_cache: 247 (was 4096)                                                         
==60887== Thread 36:
==60887== Invalid read of size 4
==60887==    at 0x706CAE: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .cold] (opt_range.cc:9816)
==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBA0C2: key_and (opt_range.cc:9857)           
==60887==    by 0xBBA0C2: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) (opt_range.cc:9809)
==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBA0C2: key_and (opt_range.cc:9857)                       
==60887==    by 0xBBA0C2: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) (opt_range.cc:9809)
==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBAC7E: key_and (opt_range.cc:9855)
==60887==    by 0xBBAC7E: key_and_with_limit (opt_range.cc:10065)    
==60887==    by 0xBBAC7E: and_range_trees(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, SEL_TREE*) (opt_range.cc:9151)
==60887==    by 0xBBB4C4: tree_and (opt_range.cc:9263)                     
==60887==    by 0xBBB4C4: tree_and(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*) (opt_range.cc:9236)
==60887==    by 0xBBB8E1: Item_cond_and::get_mm_tree(RANGE_OPT_PARAM*, Item**) (opt_range.cc:8315)
==60887==    by 0xBC2265: SQL_SELECT::test_quick_select(THD*, Bitmap<64u>, unsigned long long, unsigned long long, bool, bool, bool, bool) (opt_range.cc:2880)
==60887==    by 0x92541C: check_quick (opt_range.h:1716)
==60887==    by 0x92541C: mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, Item*, unsigned int, st_order*, unsigned long long, bool, unsigned long long*, unsigned long long*) (sq
l_update.cc:573)                             
==60887==    by 0x86A42E: mysql_execute_command(THD*) (sql_parse.cc:4440)
==60887==  Address 0x68 is not stack'd, malloc'd or (recently) free'd
==60887==  ==60887==  ==60887== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==60887==    at 0x4D8AF08: pthread_kill (pthread_kill.c:57)
==60887==    by 0xA7370F: handle_fatal_signal (signal_handler.cc:330)
==60887==    by 0x4D8E3BF: ??? (in /lib/x86_64-linux-gnu/libpthread-2.31.so)==60887==    by 0x706CAD: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .cold] (opt_range.cc:9815)==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBA0C2: key_and (opt_range.cc:9857)==60887==    by 0xBBA0C2: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) (opt_range.cc:9809)
==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBA0C2: key_and (opt_range.cc:9857)==60887==    by 0xBBA0C2: and_all_keys(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) (opt_range.cc:9809)==60887==    by 0xBBA332: key_and(RANGE_OPT_PARAM*, SEL_ARG*, SEL_ARG*, unsigned int) [clone .part.0] (opt_range.cc:9875)
==60887==    by 0xBBAC7E: key_and (opt_range.cc:9855)==60887==    by 0xBBAC7E: key_and_with_limit (opt_range.cc:10065)
==60887==    by 0xBBAC7E: and_range_trees(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, SEL_TREE*) (opt_range.cc:9151)
==60887==    by 0xBBB4C4: tree_and (opt_range.cc:9263)
==60887==    by 0xBBB4C4: tree_and(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*) (opt_range.cc:9236)==60887==    by 0xBBB8E1: Item_cond_and::get_mm_tree(RANGE_OPT_PARAM*, Item**) (opt_range.cc:8315)
==60887==    
==60887== HEAP SUMMARY:
==60887==     in use at exit: 248,705,750 bytes in 216,544 blocks
==60887==   total heap usage: 1,368,150 allocs, 1,151,606 frees, 15,934,294,508 bytes allocated
==60887==   
==60887== LEAK SUMMARY:
==60887==    definitely lost: 0 bytes in 0 blocks
==60887==    indirectly lost: 0 bytes in 0 blocks
==60887==      possibly lost: 88,081,800 bytes in 216,205 blocks
==60887==    still reachable: 160,623,950 bytes in 339 blocks
==60887==                       of which reachable via heuristic:
==60887==                         newarray           : 296 bytes in 1 blocks
==60887==         suppressed: 0 bytes in 0 blocks
==60887== Rerun with --leak-check=full to see details of leaked memory
==60887== 
==60887== For lists of detected and suppressed errors, rerun with: -s
==60887== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==60887== could not unlink /tmp/vgdb-pipe-from-vgdb-to-60887-by-root-on-???
==60887== could not unlink /tmp/vgdb-pipe-to-vgdb-from-60887-by-root-on-???
==60887== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-60887-by-root-on-???
Segmentation fault

This looks like a MariaDB bug to me, so I'm going to have a look at their bugtracker.

@davidmehren commented on February 28th 2021

This seems to be https://jira.mariadb.org/browse/MDEV-24953

As mentioned there, setting optimizer_max_sel_arg_weight to a value less than 16000 works around the crash. I set it to 15000 and can confirm the query mentioned above now works.

@Findus23 commented on February 28th 2021 Member

I guess this confirms that this is an issue outside of Matomo.

Many thanks for collecting that info for anyone stumbing across this issue.

This Issue was closed on February 28th 2021
Powered by GitHub Issue Mirror