Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11241

Certain combining marks cause MariaDB to crash when doing Full-Text searches

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.1.18, 5.5, 10.0, 10.1, 10.2
    • Fix Version/s: 5.5.54, 10.0.29, 10.1.20
    • Component/s: Full-text Search
    • Labels:
      None
    • Environment:
      CentOS 7 x64
      Windows 7 x64

      Description

      I've noted that MariaDB in my production server randomly gets killed, and when I checked the error logs, I saw that it was related to the following query:

      SELECT t1.id FROM replies as t1 WHERE MATCH(t1.body) AGAINST ('ciao' IN BOOLEAN MODE);
      

      I checked the whole table and narrowed the cause to the following:

      C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,̠̬͚ ̺T͇̲h͈̱e ̬̜D̖o̦̖͔̗͖̩̘c̣̼t̝͉̫̮̗o͉̫̭r̙͎̗.͓̪̥

      How to reproduce

      set names 'utf8mb4';
       
      CREATE TABLE IF NOT EXISTS `replies_test` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `body` text NOT NULL,
        PRIMARY KEY (`id`),
        FULLTEXT KEY `repliesText` (`body`)
      ) ENGINE=MyISAM  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
       
      insert into `replies_test` VALUES (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,̠̬͚ ̺T͇̲h͈̱e ̬̜D̖o̦̖͔̗͖̩̘c̣̼t̝͉̫̮̗o͉̫̭r̙͎̗.͓̪̥');
       
      SELECT t1.id FROM replies_test as t1 WHERE MATCH(t1.body) AGAINST ('ciao' IN BOOLEAN MODE);
      

      Backtrace

      161105 11:38:07 [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.1.18-MariaDB
      key_buffer_size=268435456
      read_buffer_size=131072
      max_used_connections=10
      max_threads=182
      thread_count=10
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 661893 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x0x7f77cbf8c008
      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 = 0x7f77fcbbd130 thread_stack 0x48400
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7f77fd76da6e]
      /usr/sbin/mysqld(handle_fatal_signal+0x2d5)[0x7f77fd2938d5]
      /lib64/libpthread.so.0(+0xf100)[0x7f77fc8ae100]
      /usr/sbin/mysqld(+0xa520da)[0x7f77fd7310da]
      /usr/sbin/mysqld(+0xa0b49c)[0x7f77fd6ea49c]
      /usr/sbin/mysqld(+0x474765)[0x7f77fd153765]
      mysys/stacktrace.c:268(my_print_stacktrace)[0x7f77fd148a99]
      myisam/ft_boolean_search.c:842(ft_boolean_read_next)[0x7f77fd1579ad]
      sql/sql_class.h:5418(handler::ha_ft_read(unsigned char*))[0x7f77fd169adc]
      sql/sql_select.cc:2506(JOIN::exec())[0x7f77fd16bad4]
      sql/sql_select.cc:3440(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x7f77fd168172]
      sql/sql_select.cc:384(handle_select(THD*, LEX*, select_result*, unsigned long))[0x7f77fd168c55]
      sql/sql_parse.cc:5896(execute_sqlcom_select)[0x7f77fd107c71]
      sql/sql_parse.cc:2961(mysql_execute_command(THD*))[0x7f77fd113faf]
      sql/sql_parse.cc:7319(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x7f77fd117952]
      sql/sql_parse.cc:1487(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x7f77fd11ae2b]
      sql/sql_parse.cc:1110(do_command(THD*))[0x7f77fd11b6a9]
      sql/sql_connect.cc:1350(do_handle_one_connection(THD*))[0x7f77fd1e219a]
      sql/sql_connect.cc:1264(handle_one_connection)[0x7f77fd1e2370]
      /lib64/libpthread.so.0(+0x7dc5)[0x7f77fc8a6dc5]
      /lib64/libc.so.6(clone+0x6d)[0x7f77facc7ced]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f77cb756020): SELECT t1.id FROM tinychan_replies as t1 WHERE MATCH(t1.body) AGAINST ('ciao' IN BOOLEAN MODE)
      Connection ID (thread ID): 13
      Status: NOT_KILLED
      

      Same result on both CentOS and Windows 7, but this only occurs in MyISAM & Aria tables, not InnoDB.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                Joseph Joseph A.
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: