[MDEV-21629] MythTV query causes MariaDB crash Created: 2020-02-01  Updated: 2020-08-11  Resolved: 2020-07-20

Status: Closed
Project: MariaDB Server
Component/s: Data types, Prepared Statements
Affects Version/s: 10.4.12
Fix Version/s: 10.5.4, 10.4.14

Type: Bug Priority: Critical
Reporter: Trevor Simonton Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: crash, mythtv
Environment:

Arch Linux


Attachments: File client.cnf     Text File dump.txt     Text File md_m_global.txt     Text File md_m_index.txt     Text File md_m_table.txt     File my.cnf     File mysql-clients.cnf     File server.cnf    
Issue Links:
Duplicate
duplicates MDEV-20261 NULL passed to String::eq, SEGV, serv... Closed
Relates
relates to MDEV-23220 MythTV SELECT request causes Mariadb ... Closed
relates to MDEV-22050 OR + incorrect bound null causes segf... Closed

 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.



 Comments   
Comment by Elena Stepanova [ 2020-02-01 ]

Could you please provide the stack trace of all threads? I assume you have it. If you don't, then the one that crashes.

Comment by Trevor Simonton [ 2020-02-01 ]

I've included the stack of the crashed thread... all the other threads are just waiting *pthread_cond_wait, **__poll* or *syscall* etc...

   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)
   Stack trace of thread 886:
                                                    #0  0x00007fa0850dcc45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xfc45)
                                                    #1  0x00005623efe1196a n/a (mysqld + 0xa9f96a)
                                                    #2  0x00005623efe8a5ae n/a (mysqld + 0xb185ae)
                                                    #3  0x00005623efe8fc14 n/a (mysqld + 0xb1dc14)
                                                    #4  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #5  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 972:
                                                    #0  0x00007fa0848a19ef __poll (libc.so.6 + 0xf49ef)
                                                    #1  0x00005623f012fe68 vio_io_wait (mysqld + 0xdbde68)
                                                    #2  0x00005623f012ffdd vio_socket_io_wait (mysqld + 0xdbdfdd)
                                                    #3  0x00005623f01300c5 vio_read (mysqld + 0xdbe0c5)
                                                    #4  0x00005623efd01aa3 n/a (mysqld + 0x98faa3)
                                                    #5  0x00005623efd02a81 my_net_read_packet_reallen (mysqld + 0x990a81)
                                                    #6  0x00005623efd02b7c my_net_read_packet (mysqld + 0x990b7c)
                                                    #7  0x00005623ef9f4f63 _Z10do_commandP3THD (mysqld + 0x682f63)
                                                    #8  0x00005623efad9296 _Z24do_handle_one_connectionP7CONNECT (mysqld + 0x767296)
                                                    #9  0x00005623efad93d3 handle_one_connection (mysqld + 0x7673d3)
                                                    #10 0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #11 0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
  Stack trace of thread 890:
                                                    #0  0x00007fa0850e0d65 __nanosleep (libpthread.so.0 + 0x13d65)
                                                    #1  0x00005623efe11e4d n/a (mysqld + 0xa9fe4d)
                                                    #2  0x00005623efef5f8b n/a (mysqld + 0xb83f8b)
                                                    #3  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #4  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
 Stack trace of thread 867:
                                                    #0  0x00007fa0848a6e9d syscall (libc.so.6 + 0xf9e9d)
                                                    #1  0x00007fa085146187 n/a (libaio.so.1 + 0x1187)
                                                    #2  0x00005623efe0dae0 n/a (mysqld + 0xa9bae0)
                                                    #3  0x00005623efe0dfd1 n/a (mysqld + 0xa9bfd1)
                                                    #4  0x00005623efe105d3 n/a (mysqld + 0xa9e5d3)
                                                    #5  0x00005623eff56f68 n/a (mysqld + 0xbe4f68)
                                                    #6  0x00005623efe90561 n/a (mysqld + 0xb1e561)
                                                    #7  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #8  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                            Stack trace of thread 996:
                                                    #0  0x00007fa0848a19ef __poll (libc.so.6 + 0xf49ef)
                                                    #1  0x00005623f012fe68 vio_io_wait (mysqld + 0xdbde68)
                                                    #2  0x00005623f012ffdd vio_socket_io_wait (mysqld + 0xdbdfdd)
                                                    #3  0x00005623f01300c5 vio_read (mysqld + 0xdbe0c5)
                                                    #4  0x00005623efd01aa3 n/a (mysqld + 0x98faa3)
                                                    #5  0x00005623efd02a81 my_net_read_packet_reallen (mysqld + 0x990a81)
                                                    #6  0x00005623efd02b7c my_net_read_packet (mysqld + 0x990b7c)
                                                    #7  0x00005623ef9f4f63 _Z10do_commandP3THD (mysqld + 0x682f63)
                                                    #8  0x00005623efad9296 _Z24do_handle_one_connectionP7CONNECT (mysqld + 0x767296)
                                                    #9  0x00005623efad93d3 handle_one_connection (mysqld + 0x7673d3)
                                                    #10 0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #11 0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 893:
                                                    #0  0x00007fa0847e9d12 __sigtimedwait (libc.so.6 + 0x3cd12)
                                                    #1  0x00005623ef92be2d signal_hand (mysqld + 0x5b9e2d)
                                                    #2  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #3  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 869:
                                                    #0  0x00007fa0848a6e9d syscall (libc.so.6 + 0xf9e9d)
                                                    #1  0x00007fa085146187 n/a (libaio.so.1 + 0x1187)
                                                    #2  0x00005623efe0dae0 n/a (mysqld + 0xa9bae0)
                                                    #3  0x00005623efe0dfd1 n/a (mysqld + 0xa9bfd1)
                                                    #4  0x00005623efe105d3 n/a (mysqld + 0xa9e5d3)
                                                    #5  0x00005623eff56f68 n/a (mysqld + 0xbe4f68)
                                                    #6  0x00005623efe90561 n/a (mysqld + 0xb1e561)
                                                    #7  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #8  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 870:
                                                    #0  0x00007fa0848a6e9d syscall (libc.so.6 + 0xf9e9d)
                                                    #1  0x00007fa085146187 n/a (libaio.so.1 + 0x1187)
                                                    #2  0x00005623efe0dae0 n/a (mysqld + 0xa9bae0)
                                                    #3  0x00005623efe0dfd1 n/a (mysqld + 0xa9bfd1)
                                                    #4  0x00005623efe105d3 n/a (mysqld + 0xa9e5d3)
                                                    #5  0x00005623eff56f68 n/a (mysqld + 0xbe4f68)
                                                    #6  0x00005623efe90561 n/a (mysqld + 0xb1e561)
                                                    #7  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #8  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 883:
                                                    #0  0x00007fa0850dcf7a pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xff7a)
                                                    #1  0x00005623efe11862 n/a (mysqld + 0xa9f862)
                                                    #2  0x00005623efe11a01 n/a (mysqld + 0xa9fa01)
                                                    #3  0x00005623efec49d8 n/a (mysqld + 0xb529d8)
                                                    #4  0x00005623eff943b0 n/a (mysqld + 0xc223b0)
                                                    #5  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #6  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 866:
                                                    #0  0x00007fa0850dcf7a pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xff7a)
                                                    #1  0x00005623effed9a2 n/a (mysqld + 0xc7b9a2)
                                                    #2  0x00005623effe6abb n/a (mysqld + 0xc74abb)
                                                    #3  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #4  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 884:
                                                    #0  0x00007fa0850e0d65 __nanosleep (libpthread.so.0 + 0x13d65)
                                                    #1  0x00005623efe11e4d n/a (mysqld + 0xa9fe4d)
                                                    #2  0x00005623efe8eafb n/a (mysqld + 0xb1cafb)
                                                    #3  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #4  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 868:
                                                    #0  0x00007fa0848a6e9d syscall (libc.so.6 + 0xf9e9d)
                                                    #1  0x00007fa085146187 n/a (libaio.so.1 + 0x1187)
                                                    #2  0x00005623efe0dae0 n/a (mysqld + 0xa9bae0)
                                                    #3  0x00005623efe0dfd1 n/a (mysqld + 0xa9bfd1)
                                                    #4  0x00005623efe105d3 n/a (mysqld + 0xa9e5d3)
                                                    #5  0x00005623eff56f68 n/a (mysqld + 0xbe4f68)
                                                    #6  0x00005623efe90561 n/a (mysqld + 0xb1e561)
                                                    #7  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #8  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
                                                    Stack trace of thread 868:
                                                    #0  0x00007fa0848a6e9d syscall (libc.so.6 + 0xf9e9d)
                                                    #1  0x00007fa085146187 n/a (libaio.so.1 + 0x1187)
                                                    #2  0x00005623efe0dae0 n/a (mysqld + 0xa9bae0)
                                                    #3  0x00005623efe0dfd1 n/a (mysqld + 0xa9bfd1)
                                                    #4  0x00005623efe105d3 n/a (mysqld + 0xa9e5d3)
                                                    #5  0x00005623eff56f68 n/a (mysqld + 0xbe4f68)
                                                    #6  0x00005623efe90561 n/a (mysqld + 0xb1e561)
                                                    #7  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #8  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 935:
                                                    #0  0x00007fa0848a19ef __poll (libc.so.6 + 0xf49ef)
                                                    #1  0x00005623f012fe68 vio_io_wait (mysqld + 0xdbde68)
                                                    #2  0x00005623f012ffdd vio_socket_io_wait (mysqld + 0xdbdfdd)
                                                    #3  0x00005623f01300c5 vio_read (mysqld + 0xdbe0c5)
                                                    #4  0x00005623efd01aa3 n/a (mysqld + 0x98faa3)
                                                    #5  0x00005623efd02a81 my_net_read_packet_reallen (mysqld + 0x990a81)
                                                    #6  0x00005623efd02b7c my_net_read_packet (mysqld + 0x990b7c)
                                                    #7  0x00005623ef9f4f63 _Z10do_commandP3THD (mysqld + 0x682f63)
                                                    #8  0x00005623efad9296 _Z24do_handle_one_connectionP7CONNECT (mysqld + 0x767296)
                                                    #9  0x00005623efad93d3 handle_one_connection (mysqld + 0x7673d3)
                                                    #10 0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #11 0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 863:
                                                    #0  0x00007fa0848a19ef __poll (libc.so.6 + 0xf49ef)
                                                    #1  0x00005623ef93538c _Z26handle_connections_socketsv (mysqld + 0x5c338c)
                                                    #2  0x00005623ef93636e _Z11mysqld_mainiPPc (mysqld + 0x5c436e)
                                                    #3  0x00007fa0847d4153 __libc_start_main (libc.so.6 + 0x27153)
                                                    #4  0x00005623ef929c2e _start (mysqld + 0x5b7c2e)
                                                    Stack trace of thread 863:
                                                    #0  0x00007fa0848a19ef __poll (libc.so.6 + 0xf49ef)
                                                    #1  0x00005623ef93538c _Z26handle_connections_socketsv (mysqld + 0x5c338c)
                                                    #2  0x00005623ef93636e _Z11mysqld_mainiPPc (mysqld + 0x5c436e)
                                                    #3  0x00007fa0847d4153 __libc_start_main (libc.so.6 + 0x27153)
                                                    #4  0x00005623ef929c2e _start (mysqld + 0x5b7c2e)
 
                                                    Stack trace of thread 885:
                                                    #0  0x00007fa0850dcc45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xfc45)
                                                    #1  0x00005623efe1196a n/a (mysqld + 0xa9f96a)
                                                    #2  0x00005623efe8a5ae n/a (mysqld + 0xb185ae)
                                                    #3  0x00005623efe8f386 n/a (mysqld + 0xb1d386)
                                                    #4  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #5  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)
 
                                                    Stack trace of thread 887:
                                                    #0  0x00007fa0850dcc45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xfc45)
                                                    #1  0x00005623efe1196a n/a (mysqld + 0xa9f96a)
                                                    #2  0x00005623efe8a5ae n/a (mysqld + 0xb185ae)
                                                    #3  0x00005623efe8fc14 n/a (mysqld + 0xb1dc14)
                                                    #4  0x00007fa0850d64cf start_thread (libpthread.so.0 + 0x94cf)
                                                    #5  0x00007fa0848ac2d3 __clone (libc.so.6 + 0xff2d3)

Comment by Trevor Simonton [ 2020-02-01 ]

sorry this is just a subset of the stacks... i will try to get the full dump a little later but need to walk away from now

Comment by Elena Stepanova [ 2020-02-01 ]

There is no indication of a crash in the thread that you provided the stack trace for.
How do you collect the stack traces so that you only get a part, but not all? Is it from a coredump?

Comment by Trevor Simonton [ 2020-02-01 ]

It’s from a core dump. I was copy pasting out of terminal and had to leave the machine. I’ll regenerate it and save to file when I’m back

Sent from my iPhone

Comment by Trevor Simonton [ 2020-02-01 ]

dump.txt

ok I uploaded the full dump. the crash does come from the thread i have on the original description

Feb 01 11:56:26 hamsandwich mysqld[863]: stack_bottom = 0x7fa05a1615b8 thread_stack 0x49000
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(my_print_stacktrace+0x2a)[0x5623f00dd65a]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(handle_fatal_signal+0x578)[0x5623efbf16e8]
Feb 01 11:56:26 hamsandwich mysqld[863]: sigaction.c:0(__restore_rt)[0x7fa0850e1930]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z7sortcmpPK6StringS1_PK15charset_info_st+0xe)[0x5623efa724ee]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZNK26Type_handler_string_result13Item_const_eqEPK10Item_constS2_b+0xc7)[0x5623efb2fa37]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN4Item15eq_by_collationEPS_bPK15charset_info_st+0x62)[0x5623efc136a2]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN9Item_cond14add_key_fieldsEP4JOINPP9KEY_FIELDPjyPP14SARGABLE_PARAM+0x279)[0x5623efa199a9]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN13Item_cond_and14add_key_fieldsEP4JOINPP9KEY_FIELDPjyPP14SARGABLE_PARAM+0x4a)[0x5623efa196ea]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(+0x6a88cb)[0x5623efa1a8cb]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN4JOIN14optimize_innerEv+0x1e24)[0x5623efa4aeb4]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN4JOIN8optimizeEv+0x94)[0x5623efa4cef4]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xe4)[0x5623efa4d094]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x154)[0x5623efa4dbb4]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(+0x66c93c)[0x5623ef9de93c]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z21mysql_execute_commandP3THD+0x7866)[0x5623ef9edf96]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN18Prepared_statement7executeEP6Stringb+0x400)[0x5623efa03ce0]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x84)[0x5623efa03e94]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(+0x692a7e)[0x5623efa04a7e]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z19mysqld_stmt_executeP3THDPcj+0x22)[0x5623efa04b22]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xc7b)[0x5623ef9f221b]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z10do_commandP3THD+0x151)[0x5623ef9f5021]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1c6)[0x5623efad9296]
Feb 01 11:56:26 hamsandwich mysqld[863]: /usr/bin/mysqld(handle_one_connection+0x33)[0x5623efad93d3]
Feb 01 11:56:26 hamsandwich mysqld[863]: pthread_create.c:0(start_thread)[0x7fa0850d64cf]

Comment by Elena Stepanova [ 2020-02-01 ]

Thank you.
Could you please also paste or attach your config file(s) or the output of SHOW GLOBAL VARIABLES, and the output of

SHOW CREATE TABLE record;
SHOW INDEX IN record;

If the connector in use has its own settings which override global server options and you know what they are, those might would be good to know too.

Has it only started happening with upgrade to 10.4.12, or is it the first version that you use with MythTV?

Comment by Trevor Simonton [ 2020-02-01 ]

md_m_global.txt md_m_index.txt md_m_table.txt

client.cnf my.cnf mysql-clients.cnf server.cnf

AFAIK there's no custom settings in the connector.

Both MythTV and MariaDB are fresh installs. I have not used either on this machine.

Comment by Trevor Simonton [ 2020-02-01 ]

same issue in 10.4.11-MariaDB

will try other versions as well

Comment by Elena Stepanova [ 2020-02-01 ]

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)?

Comment by Trevor Simonton [ 2020-02-01 ]

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

Comment by Elena Stepanova [ 2020-02-01 ]

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.

Comment by markus makela [ 2020-02-03 ]

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

Comment by Elena Stepanova [ 2020-02-05 ]

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.

Generated at Thu Feb 08 09:08:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.