Details

    Description

      I'm using MythTV... it consistently fails with this query;

      2020-02-01 11:56:26.486022 W  LoadFromProgram(): SQL contains LIMIT clause, caller should be updated to use limit parameter instead
      QMYSQLResult::cleanup: unable to free statement handle
      2020-02-01 11:56:28.990474 E  DB Error (LoadByTemplate):
      Query was:
      SELECT recordid, category,        (category = ?) AS catmatch,        (category = ?) AS typematch FROM record WHERE type = ? AND       (category = ? OR category = ?        OR category = 'Default') ORDER BY catmatch DESC, typematch DESC
      Bindings were:
      :CAT1="", :CAT2="", :CATTYPE1="", :CATTYPE2="", :TEMPLATE=11
      Driver error was [2/2006]:
      QMYSQL3: Unable to execute statement
      Database error was:
      MySQL server has gone away
      

      mariadb.service: Main process exited, code=killed, status=11/SEGV

      I look at the sudo journalctl -xe

      I see this consistently in one of the threads every time this problem occurs:

      Stack trace of thread 1009:
       #0  0x00005623efa724ee _Z7sortcmpPK6StringS1_PK15charset_info_st (mysqld + 0x7004ee)
       #1  0x00005623efb2fa37 _ZNK26Type_handler_string_result13Item_const_eqEPK10Item_constS2_b (mysqld + 0x7bd>
       #2  0x00005623efc136a2 _ZN4Item15eq_by_collationEPS_bPK15charset_info_st (mysqld + 0x8a16a2)
       #3  0x00005623efa199a9 _ZN9Item_cond14add_key_fieldsEP4JOINPP9KEY_FIELDPjyPP14SARGABLE_PARAM (mysqld + 0x>
       #4  0x00005623efa196ea _ZN13Item_cond_and14add_key_fieldsEP4JOINPP9KEY_FIELDPjyPP14SARGABLE_PARAM (mysqld>
       #5  0x00005623efa1a8cb n/a (mysqld + 0x6a88cb)
       #6  0x00005623efa4aeb4 _ZN4JOIN14optimize_innerEv (mysqld + 0x6d8eb4)
       #7  0x00005623efa4cef4 _ZN4JOIN8optimizeEv (mysqld + 0x6daef4)
       #8  0x00005623efa4d094 _Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select>
       #9  0x00005623efa4dbb4 _Z13handle_selectP3THDP3LEXP13select_resultm (mysqld + 0x6dbbb4)
       #10 0x00005623ef9de93c n/a (mysqld + 0x66c93c)
       #11 0x00005623ef9edf96 _Z21mysql_execute_commandP3THD (mysqld + 0x67bf96)
       #12 0x00005623efa03ce0 _ZN18Prepared_statement7executeEP6Stringb (mysqld + 0x691ce0)
       #13 0x00005623efa03e94 _ZN18Prepared_statement12execute_loopEP6StringbPhS2_ (mysqld + 0x691e94)
       #14 0x00005623efa04a7e n/a (mysqld + 0x692a7e)
       #15 0x00005623efa04b22 _Z19mysqld_stmt_executeP3THDPcj (mysqld + 0x692b22)
       #16 0x00005623ef9f221b _Z16dispatch_command19enum_server_commandP3THDPcjbb (mysqld + 0x68021b)
       #17 0x00005623ef9f5021 _Z10do_commandP3THD (mysqld + 0x683021)
       #18 0x00005623efad9296 _Z24do_handle_one_connectionP7CONNECT (mysqld + 0x767296)
       #19 0x00005623efad93d3 handle_one_connection (mysqld + 0x7673d3)
       #20 0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
       #21 0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
      

      Any idea what is going on in this stack?

      I've tried re-installing maria db... I've tried wiping the database and recreating it.

      Attachments

        1. client.cnf
          0.3 kB
        2. dump.txt
          60 kB
        3. md_m_global.txt
          18 kB
        4. md_m_index.txt
          0.8 kB
        5. md_m_table.txt
          3 kB
        6. my.cnf
          0.2 kB
        7. mysql-clients.cnf
          0.2 kB
        8. server.cnf
          1 kB

        Issue Links

          Activity

            Thanks, it's very helpful, it means we can rule out some recent changes in 10.4.12.
            Can you by any chance try the same query directly from the command-line client, without the connector (as a plain query and, if it doesn't work, as a prepared statement)?

            elenst Elena Stepanova added a comment - Thanks, it's very helpful, it means we can rule out some recent changes in 10.4.12. Can you by any chance try the same query directly from the command-line client, without the connector (as a plain query and, if it doesn't work, as a prepared statement)?

            I tried that and it didn't seem to have the same issue in the CLI

            I just downgraded to 10.3.16 and the issue is gone. So it's somewhere between 10.3.16 and 10.4.12

            I can try continuing a binary search at some point but for now i might just hang onto 10.3.16 and give debugging this a break

            tmsimont Trevor Simonton added a comment - I tried that and it didn't seem to have the same issue in the CLI I just downgraded to 10.3.16 and the issue is gone. So it's somewhere between 10.3.16 and 10.4.12 I can try continuing a binary search at some point but for now i might just hang onto 10.3.16 and give debugging this a break

            Thanks for your investigation, we'll try to reproduce it.
            As I understand, you have only one record in the table, right? Would you be able to share the contents, just in case it turns out to be important? If you don't want to make it public, you can send it by email or upload to ftp.askmonty.org/private. You can also obfuscate the parts of it which you don't want to share.

            elenst Elena Stepanova added a comment - Thanks for your investigation, we'll try to reproduce it. As I understand, you have only one record in the table, right? Would you be able to share the contents, just in case it turns out to be important? If you don't want to make it public, you can send it by email or upload to ftp.askmonty.org/private. You can also obfuscate the parts of it which you don't want to share.
            markus makela markus makela added a comment -

            In MDEV-17334 I reported a crash and at the request of elenst tested with this query. It produce the following stacktrace:

            200203 13:34:34 [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.4.12-MariaDB-1:10.4.12+maria~bionic-log
            key_buffer_size=134217728
            read_buffer_size=2097152
            max_used_connections=5
            max_threads=10002
            thread_count=12
            It is possible that mysqld could use up to 
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61830494 K  bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.
            Thread pointer: 0x7f3cdc000c08
            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 = 0x7f3d6c1c3dd8 thread_stack 0x49000
            mysqld(my_print_stacktrace+0x2e)[0x55e52067fc3e]
            mysqld(handle_fatal_signal+0x515)[0x55e5200f3cf5]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f3d75cd1890]
            mysqld(_Z19append_query_stringPK15charset_info_stP6StringPKcmb+0x61)[0x55e5201e8901]
            mysqld(_ZNK10Item_param19value_query_val_strEP3THDP6String+0xb6)[0x55e520114fc6]
            mysqld(_ZThn144_N10Item_param14append_for_logEP3THDP6String+0x7b)[0x55e5201154db]
            mysqld(+0x677377)[0x55e51fef6377]
            mysqld(_ZN18Prepared_statement14set_parametersEP6StringPhS2_+0xe1)[0x55e51fef9de1]
            mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x35)[0x55e51fefbcc5]
            mysqld(+0x67da72)[0x55e51fefca72]
            mysqld(_Z19mysqld_stmt_executeP3THDPcj+0x25)[0x55e51fefcb15]
            mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xe35)[0x55e51fee8da5]
            mysqld(_Z10do_commandP3THD+0x148)[0x55e51feeabe8]
            mysqld(_Z24do_handle_one_connectionP7CONNECT+0x25e)[0x55e51ffc6dae]
            mysqld(handle_one_connection+0x3d)[0x55e51ffc6e6d]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f3d75cc66db]
            /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f3d746e888f]
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x0): 
            Connection ID (thread ID): 13
            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
            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.
            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       127226               127226               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/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
            

            markus makela markus makela added a comment - In MDEV-17334 I reported a crash and at the request of elenst tested with this query. It produce the following stacktrace: 200203 13:34:34 [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.4.12-MariaDB-1:10.4.12+maria~bionic-log key_buffer_size=134217728 read_buffer_size=2097152 max_used_connections=5 max_threads=10002 thread_count=12 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61830494 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7f3cdc000c08 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 = 0x7f3d6c1c3dd8 thread_stack 0x49000 mysqld(my_print_stacktrace+0x2e)[0x55e52067fc3e] mysqld(handle_fatal_signal+0x515)[0x55e5200f3cf5] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f3d75cd1890] mysqld(_Z19append_query_stringPK15charset_info_stP6StringPKcmb+0x61)[0x55e5201e8901] mysqld(_ZNK10Item_param19value_query_val_strEP3THDP6String+0xb6)[0x55e520114fc6] mysqld(_ZThn144_N10Item_param14append_for_logEP3THDP6String+0x7b)[0x55e5201154db] mysqld(+0x677377)[0x55e51fef6377] mysqld(_ZN18Prepared_statement14set_parametersEP6StringPhS2_+0xe1)[0x55e51fef9de1] mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x35)[0x55e51fefbcc5] mysqld(+0x67da72)[0x55e51fefca72] mysqld(_Z19mysqld_stmt_executeP3THDPcj+0x25)[0x55e51fefcb15] mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xe35)[0x55e51fee8da5] mysqld(_Z10do_commandP3THD+0x148)[0x55e51feeabe8] mysqld(_Z24do_handle_one_connectionP7CONNECT+0x25e)[0x55e51ffc6dae] mysqld(handle_one_connection+0x3d)[0x55e51ffc6e6d] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f3d75cc66db] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f3d746e888f] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x0): Connection ID (thread ID): 13 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 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. 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 127226 127226 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/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
            elenst Elena Stepanova added a comment - - edited

            Just found out that we had a very similar report before, MDEV-20261 (also MythTV, same query).

            I've finally managed to install MythTV and make it work up to the point where it causes the crash.

            Added a test case to MDEV-20261, I suggest we continue tracking the problem there.

            elenst Elena Stepanova added a comment - - edited Just found out that we had a very similar report before, MDEV-20261 (also MythTV, same query). I've finally managed to install MythTV and make it work up to the point where it causes the crash. Added a test case to MDEV-20261 , I suggest we continue tracking the problem there.

            People

              bar Alexander Barkov
              tmsimont Trevor Simonton
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.