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

Server crashes when creating a fulltext index with simple_parser plugin.

Details

    Description

      --source include/have_innodb.inc
       
      INSTALL PLUGIN simple_parser SONAME 'mypluglib';
      CREATE TABLE t (title CHAR,body TEXT) ENGINE=INNODB;
      INSERT INTO t VALUES ('a','xyz xyz');
      ALTER TABLE t ADD FULLTEXT INDEX (title,body) WITH PARSER simple_parser;
      

      Leads to:

      CS 11.8.0 4c956fa15be059e35f8ed0de85dc72d5827cee4d (Debug)

      mariadbd: /test/11.8_dbg/storage/innobase/fts/fts0fts.cc:1217: void fts_cache_node_add_positions(fts_cache_t*, fts_node_t*, doc_id_t, ib_vector_t*): Assertion `last_pos == 0 || pos > last_pos' failed.
      

      CS 11.8.0 4c956fa15be059e35f8ed0de85dc72d5827cee4d (Debug)

      Core was generated by `/test/MD270125-mariadb-11.8.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x152b5d9f4700 (LWP 1299928))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000152b82578859 in __GI_abort () at abort.c:79
      #2  0x0000152b82578729 in __assert_fail_base (fmt=0x152b8270e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x555b86830228 "last_pos == 0 || pos > last_pos", file=0x555b8682f970 "/test/11.8_dbg/storage/innobase/fts/fts0fts.cc", line=1217, function=<optimized out>) at assert.c:92
      #3  0x0000152b82589fd6 in __GI___assert_fail (assertion=assertion@entry=0x555b86830228 "last_pos == 0 || pos > last_pos", file=file@entry=0x555b8682f970 "/test/11.8_dbg/storage/innobase/fts/fts0fts.cc", line=line@entry=1217, function=function@entry=0x555b86830160 "void fts_cache_node_add_positions(fts_cache_t*, fts_node_t*, doc_id_t, ib_vector_t*)") at assert.c:101
      #4  0x0000555b8628cc8c in fts_cache_node_add_positions (cache=cache@entry=0x0, node=node@entry=0x152b50023ca0, doc_id=2, positions=positions@entry=0x152b50023d80) at /test/11.8_dbg/storage/innobase/fts/fts0fts.cc:1217
      #5  0x0000555b860683a8 in row_fts_insert_tuple (ins_ctx=ins_ctx@entry=0x152b5d9f3750, word=word@entry=0x152b5d9f3730, positions=positions@entry=0x152b50023d80, in_doc_id=in_doc_id@entry=0x152b5d9f3710, dtuple=dtuple@entry=0x0) at /test/11.8_dbg/storage/innobase/row/row0ftsort.cc:1250
      #6  0x0000555b86069f84 in row_fts_merge_insert (index=<optimized out>, table=<optimized out>, psort_info=<optimized out>, id=<optimized out>) at /test/11.8_dbg/storage/innobase/row/row0ftsort.cc:1702
      #7  0x0000555b8606bb29 in fts_parallel_merge (arg=0x152b2f4b7140) at /test/11.8_dbg/storage/innobase/row/row0ftsort.cc:1091
      #8  0x0000555b862e609f in tpool::task::execute (this=0x152b2f6a1e10) at /test/11.8_dbg/tpool/task.cc:37
      #9  0x0000555b862e4495 in tpool::thread_pool_generic::worker_main (this=0x555b884b4080, thread_var=0x555b884b4350) at /test/11.8_dbg/tpool/tpool_generic.cc:574
      #10 0x0000555b862e50f5 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__t=<optimized out>, __f=<optimized out>) at /usr/include/c++/9/bits/invoke.h:89
      #11 std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
      #12 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
      #13 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
      #14 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=<optimized out>) at /usr/include/c++/9/thread:195
      #15 0x0000152b8298ade4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #16 0x0000152b82aa4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #17 0x0000152b82675133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 11.8.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.28 (dbg), 10.5.28 (opt), 10.6.21 (dbg), 10.6.21 (opt), 10.11.11 (dbg), 10.11.11 (opt), 11.7.2 (dbg), 11.7.2 (opt), 11.8.0 (opt)

      Attachments

        Activity

          Given that this is specific to the major version 11.8 and the only InnoDB changes between 11.7 are my MDEV-35049 and MDEV-35312, I think that I must check this.

          marko Marko Mäkelä added a comment - Given that this is specific to the major version 11.8 and the only InnoDB changes between 11.7 are my MDEV-35049 and MDEV-35312 , I think that I must check this.

          I can reproduce this before any 11.8 specific InnoDB changes.

          11.8 5e8714b7b207dd95b4460cbdef337fe795139938

          Version: '11.8.0-MariaDB-debug-log'  socket: '/dev/shm/11/mysql-test/var/tmp/mysqld.1.sock'  port: 19000  Source distribution
          2025-01-29  6:27:34 4 [Warning] Plugin 'simple_parser' is of maturity level experimental while the server is alpha
          mariadbd: …/fts0fts.cc:1217: void fts_cache_node_add_positions(fts_cache_t *, fts_node_t *, doc_id_t, ib_vector_t *): Assertion `last_pos == 0 || pos > last_pos' failed.
          

          Contrary to the description, I can reproduce this on 11.7, 11.4, 10.11, 10.6 and 10.5 (47908d3f7762d334803045c2d66501daefd3bd9e) as well.

          marko Marko Mäkelä added a comment - I can reproduce this before any 11.8 specific InnoDB changes. 11.8 5e8714b7b207dd95b4460cbdef337fe795139938 Version: '11.8.0-MariaDB-debug-log' socket: '/dev/shm/11/mysql-test/var/tmp/mysqld.1.sock' port: 19000 Source distribution 2025-01-29 6:27:34 4 [Warning] Plugin 'simple_parser' is of maturity level experimental while the server is alpha mariadbd: …/fts0fts.cc:1217: void fts_cache_node_add_positions(fts_cache_t *, fts_node_t *, doc_id_t, ib_vector_t *): Assertion `last_pos == 0 || pos > last_pos' failed. Contrary to the description, I can reproduce this on 11.7, 11.4, 10.11, 10.6 and 10.5 (47908d3f7762d334803045c2d66501daefd3bd9e) as well.

          marko Thank you for confirming issue on lower versions. simple_parser plugin installation failed on lower versions due to plugin_maturity default value gamma, which is why QA bug verification script did not detect the issue on lower versions.

          ramesh Ramesh Sivaraman added a comment - marko Thank you for confirming issue on lower versions. simple_parser plugin installation failed on lower versions due to plugin_maturity default value gamma, which is why QA bug verification script did not detect the issue on lower versions.

          People

            thiru Thirunarayanan Balathandayuthapani
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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