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

SIGSEGV in ha_connect::create on CREATE TABLE with Mroonga wrapping the CONNECT engine

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_mroonga';
      INSTALL SONAME 'ha_connect';
      CREATE TABLE t1 (c INT KEY) ENGINE=mroonga COMMENT='ENGINE "CONNECT"';
      

      Leads to:

      CS 12.3.3 6b174bfb25be06f7efdab149183665e1a36b3dd5 (Optimized, Clang 22.1.8-20260621) Build 10/08/2026

      Core was generated by `/test/MD100826-mariadb-12.3.3-linux-x86_64-opt/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  ha_connect::create (this=0x778b0801a1d0, name=0x7f8c44261510 "./test/t1", table_arg=0x7f8c4425f5d8, create_info=0x7f8c44261aa0)at /test/12.3_opt/storage/connect/ha_connect.cc:6475
       
      [Current thread is 1 (LWP 3780389)]
      (gdb) bt
      #0  ha_connect::create (this=0x778b0801a1d0, name=0x7f8c44261510 "./test/t1", table_arg=0x7f8c4425f5d8, create_info=0x7f8c44261aa0)at /test/12.3_opt/storage/connect/ha_connect.cc:6475
      #1  0x00005d60b5564a9e in handler::ha_create (this=this@entry=0x778b0801a1d0, name=name@entry=0x7f8c44261510 "./test/t1", form=form@entry=0x7f8c4425f5d8, info_arg=info_arg@entry=0x7f8c44261aa0)at /test/12.3_opt/sql/handler.cc:6241
      #2  0x00007f8c158a2bc1 in ha_mroonga::wrapper_create (this=this@entry=0x778b096a6fe0, name=name@entry=0x7f8c44261510 "./test/t1", table=table@entry=0x7f8c4425f5d8, info=info@entry=0x7f8c44261aa0, tmp_share=tmp_share@entry=0x778b096c8570)at /test/12.3_opt/storage/mroonga/ha_mroonga.cpp:3145
      #3  0x00007f8c158a6509 in ha_mroonga::create (this=0x778b096a6fe0, name=0x7f8c44261510 "./test/t1", table=0x7f8c4425f5d8, info=0x7f8c44261aa0)at /test/12.3_opt/storage/mroonga/ha_mroonga.cpp:4266
      #4  0x00005d60b5564a9e in handler::ha_create (this=0x778b096a6fe0, name=name@entry=0x7f8c44261510 "./test/t1", form=form@entry=0x7f8c4425f5d8, info_arg=info_arg@entry=0x7f8c44261aa0)at /test/12.3_opt/sql/handler.cc:6241
      #5  0x00005d60b5565ebe in ha_create_table_from_share (thd=thd@entry=0x778b08000c70, share=share@entry=0x7f8c44260738, create_info=create_info@entry=0x7f8c44261aa0, ref_length=ref_length@entry=0x7f8c4425fa4c)at /test/12.3_opt/sql/handler.cc:6701
      #6  0x00005d60b55658a5 in ha_create_table (thd=thd@entry=0x778b08000c70, path=0x7f8c44261510 "./test/t1", db=0x778b08017cc0 "test", table_name=0x778b08017c80 "t1", create_info=0x7f8c44261aa0, frm=<optimized out>, skip_frm_file=<optimized out>)at /test/12.3_opt/sql/handler.cc:6774
      #7  0x00005d60b53961bc in create_table_impl (thd=0x778b08000c70, ddl_log_state_create=ddl_log_state_create@entry=0x7f8c44261810, ddl_log_state_rm=<optimized out>, ddl_log_state_rm@entry=0x7f8c44261830, orig_db=@0x778b08017d00: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x778b08017cc0 "test", length = 4}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, orig_table_name=@0x778b08017d10: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x778b08017c80 "t1", length = 2}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, db=@0x778b08017d00: {str = 0x778b08017cc0 "test", length = 4}, table_name=@0x778b08017d10: {str = 0x778b08017c80 "t1", length = 2}, path=@0x7f8c442614c0: {str = 0x7f8c44261510 "./test/t1", length = 9}, options={m_options = DDL_options_st::OPT_NONE}, create_info=0x7f8c44261aa0, alter_info=0x7f8c44261928, create_table_mode=0, is_trans=0x7f8c44261897, key_info=0x7f8c442614b8, key_count=0x7f8c442614ec, frm=0x7f8c442614d0)at /test/12.3_opt/sql/sql_table.cc:4987
      #8  0x00005d60b53958f4 in mysql_create_table_no_lock (thd=thd@entry=0x778b08000c70, ddl_log_state_create=ddl_log_state_create@entry=0x7f8c44261810, ddl_log_state_rm=ddl_log_state_rm@entry=0x7f8c44261830, create_info=create_info@entry=0x7f8c44261aa0, alter_info=alter_info@entry=0x7f8c44261928, is_trans=is_trans@entry=0x7f8c44261897, create_table_mode=0, table_list=0x778b08017ce0) at /test/12.3_opt/sql/sql_table.cc:5088
      #9  0x00005d60b53a71d6 in mysql_create_table (thd=thd@entry=0x778b08000c70, create_table=create_table@entry=0x778b08017ce0, create_info=create_info@entry=0x7f8c44261aa0, alter_info=alter_info@entry=0x7f8c44261928)at /test/12.3_opt/sql/sql_table.cc:5334
      #10 0x00005d60b53a623e in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x778b08000c70)at /test/12.3_opt/sql/sql_table.cc:13980
      #11 0x00005d60b52e88b0 in mysql_execute_command (thd=thd@entry=0x778b08000c70, is_called_from_prepared_stmt=false) at /test/12.3_opt/sql/sql_parse.cc:5908
      #12 0x00005d60b52e415d in mysql_parse (thd=thd@entry=0x778b08000c70, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f8c442624f0)at /test/12.3_opt/sql/sql_parse.cc:7945
      #13 0x00005d60b52e292f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x778b08000c70, packet=packet@entry=0x778b08008d81 "CREATE TABLE t1 (c INT KEY) ENGINE=mroonga COMMENT='ENGINE \"CONNECT\"'", packet_length=packet_length@entry=69, blocking=true) at /test/12.3_opt/sql/sql_parse.cc:1903
      #14 0x00005d60b52e45e0 in do_command (thd=thd@entry=0x778b08000c70, blocking=true) at /test/12.3_opt/sql/sql_parse.cc:1437
      #15 0x00005d60b540bb0d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5d60d9b7e8c0, put_in_cache=true)at /test/12.3_opt/sql/sql_connect.cc:1514
      #16 0x00005d60b540b942 in handle_one_connection (arg=arg@entry=0x5d60d9b7e8c0)at /test/12.3_opt/sql/sql_connect.cc:1426
      #17 0x00005d60b57ac643 in pfs_spawn_thread (arg=0x5d60d9b9ee60)at /test/12.3_opt/storage/perfschema/pfs.cc:2198
      #18 0x00007f8c4609cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #19 0x00007f8c46129d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      CS 12.3.3 6b174bfb25be06f7efdab149183665e1a36b3dd5 (Debug, Clang 22.1.8-20260621) Build 10/08/2026

      mariadbd: /test/12.3_dbg/storage/connect/ha_connect.cc:6474: virtual int ha_connect::create(const char *, TABLE *, HA_CREATE_INFO *): Assertion `options' failed.
      

      CS 12.3.3 6b174bfb25be06f7efdab149183665e1a36b3dd5 (Debug, Clang 22.1.8-20260621) Build 10/08/2026

      Core was generated by `/test/MD100826-mariadb-12.3.3-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3780667)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000070c8f784527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000070c8f78288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000070c8f782881b in __assert_fail_base (fmt=0x70c8f79d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x68c890ff0bb5 "options", file=file@entry=0x68c890ff0070 "/test/12.3_dbg/storage/connect/ha_connect.cc", line=line@entry=6474, function=function@entry=0x68c890ff0bbd "virtual int ha_connect::create(const char *, TABLE *, HA_CREATE_INFO *)") at ./assert/assert.c:96
      #6  0x000070c8f783b517 in __assert_fail (assertion=0x68c890ff0bb5 "options", file=0x68c890ff0070 "/test/12.3_dbg/storage/connect/ha_connect.cc", line=6474, function=0x68c890ff0bbd "virtual int ha_connect::create(const char *, TABLE *, HA_CREATE_INFO *)") at ./assert/assert.c:105
      #7  0x000068c890ed2e84 in ha_connect::create (this=0x68c7c001ccb0, name=0x70c8d101d7f0 "./test/t1", table_arg=0x70c8d101ada0, create_info=0x70c8d101df78)at /test/12.3_dbg/storage/connect/ha_connect.cc:6474
      #8  0x000056fa0f862142 in handler::ha_create (this=0x68c7c001ccb0, name=0x70c8d101d7f0 "./test/t1", form=0x70c8d101ada0, info_arg=0x70c8d101df78) at /test/12.3_dbg/sql/handler.cc:6241
      #9  0x000070c8d06dc3f8 in ha_mroonga::wrapper_create (this=0x68c7c16e1af0, name=0x70c8d101d7f0 "./test/t1", table=0x70c8d101ada0, info=0x70c8d101df78, tmp_share=0x68c7c1704220)at /test/12.3_dbg/storage/mroonga/ha_mroonga.cpp:3145
      #10 0x000070c8d06e2995 in ha_mroonga::create (this=0x68c7c16e1af0, name=0x70c8d101d7f0 "./test/t1", table=0x70c8d101ada0, info=0x70c8d101df78)at /test/12.3_dbg/storage/mroonga/ha_mroonga.cpp:4266
      #11 0x000056fa0f862142 in handler::ha_create (this=0x68c7c16e1af0, name=0x70c8d101d7f0 "./test/t1", form=0x70c8d101ada0, info_arg=0x70c8d101df78) at /test/12.3_dbg/sql/handler.cc:6241
      #12 0x000056fa0f864030 in ha_create_table_from_share (thd=0x68c7c0000d60, share=0x70c8d101c100, create_info=0x70c8d101df78, ref_length=0x70c8d101b264) at /test/12.3_dbg/sql/handler.cc:6701
      #13 0x000056fa0f8638f5 in ha_create_table (thd=0x68c7c0000d60, path=0x70c8d101d7f0 "./test/t1", db=0x68c7c001a520 "test", table_name=0x68c7c001a4e0 "t1", create_info=0x70c8d101df78, frm=0x70c8d101d780, skip_frm_file=false)at /test/12.3_dbg/sql/handler.cc:6774
      #14 0x000056fa0f55e733 in create_table_impl (thd=0x68c7c0000d60, ddl_log_state_create=0x70c8d101db58, ddl_log_state_rm=0x70c8d101db38, orig_db=@0x68c7c001a560: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x68c7c001a520 "test", length = 4}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, orig_table_name=@0x68c7c001a570: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x68c7c001a4e0 "t1", length = 2}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, db=@0x68c7c001a560: {str = 0x68c7c001a520 "test", length = 4}, table_name=@0x68c7c001a570: {str = 0x68c7c001a4e0 "t1", length = 2}, path=@0x70c8d101d768: {str = 0x70c8d101d7f0 "./test/t1", length = 9}, options={m_options = DDL_options_st::OPT_NONE}, create_info=0x70c8d101df78, alter_info=0x70c8d101de00, create_table_mode=0, is_trans=0x70c8d101db2f, key_info=0x70c8d101d7b0, key_count=0x70c8d101d7ac, frm=0x70c8d101d780)at /test/12.3_dbg/sql/sql_table.cc:4987
      #15 0x000056fa0f55d8c5 in mysql_create_table_no_lock (thd=0x68c7c0000d60, ddl_log_state_create=0x70c8d101db58, ddl_log_state_rm=0x70c8d101db38, create_info=0x70c8d101df78, alter_info=0x70c8d101de00, is_trans=0x70c8d101db2f, create_table_mode=0, table_list=0x68c7c001a540)at /test/12.3_dbg/sql/sql_table.cc:5088
      #16 0x000056fa0f57795d in mysql_create_table (thd=0x68c7c0000d60, create_table=0x68c7c001a540, create_info=0x70c8d101df78, alter_info=0x70c8d101de00) at /test/12.3_dbg/sql/sql_table.cc:5334
      #17 0x000056fa0f575fbe in Sql_cmd_create_table_like::execute (this=0x68c7c001a4a0, thd=0x68c7c0000d60)at /test/12.3_dbg/sql/sql_table.cc:13980
      #18 0x000056fa0f45ad04 in mysql_execute_command (thd=0x68c7c0000d60, is_called_from_prepared_stmt=false) at /test/12.3_dbg/sql/sql_parse.cc:5908
      #19 0x000056fa0f44be18 in mysql_parse (thd=0x68c7c0000d60, rawbuf=0x68c7c001a3b0 "CREATE TABLE t1 (c INT KEY) ENGINE=mroonga COMMENT='ENGINE \"CONNECT\"'", length=69, parser_state=0x70c8d101f9f0)at /test/12.3_dbg/sql/sql_parse.cc:7945
      #20 0x000056fa0f44956e in dispatch_command (command=COM_QUERY, thd=0x68c7c0000d60, packet=0x68c7c000b5e1 "CREATE TABLE t1 (c INT KEY) ENGINE=mroonga COMMENT='ENGINE \"CONNECT\"'", packet_length=69, blocking=true)at /test/12.3_dbg/sql/sql_parse.cc:1903
      #21 0x000056fa0f44c89a in do_command (thd=0x68c7c0000d60, blocking=true)at /test/12.3_dbg/sql/sql_parse.cc:1437
      #22 0x000056fa0f61cdee in do_handle_one_connection (connect=0x56fa4ca7ce50, put_in_cache=true) at /test/12.3_dbg/sql/sql_connect.cc:1514
      #23 0x000056fa0f61cbd1 in handle_one_connection (arg=0x56fa4cb66250)at /test/12.3_dbg/sql/sql_connect.cc:1426
      #24 0x000070c8f789cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x000070c8f7929d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  100826  0931994096b84ecc9ffc8eb3517c7e09e6e8631e  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  10.6   opt  100826  0931994096b84ecc9ffc8eb3517c7e09e6e8631e  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  10.11  dbg  100826  aba2caa893cdfa880dbb9a4f2d8e6dfaa7ed8ebe  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  10.11  opt  100826  aba2caa893cdfa880dbb9a4f2d8e6dfaa7ed8ebe  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  11.4   dbg  100826  f6418ff7b2a0ecbc158f53331735994446bed0ac  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  11.4   opt  100826  f6418ff7b2a0ecbc158f53331735994446bed0ac  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  11.8   dbg  100826  da0beac410cc761be4ee52b90fded6c7fa2f8947  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  11.8   opt  100826  da0beac410cc761be4ee52b90fded6c7fa2f8947  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  12.3   dbg  100826  6b174bfb25be06f7efdab149183665e1a36b3dd5  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  12.3   opt  100826  6b174bfb25be06f7efdab149183665e1a36b3dd5  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  13.0   dbg  100826  1a4bb1bbfde5fa17ba148cb62678902f11c66a1a  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  13.0   opt  100826  1a4bb1bbfde5fa17ba148cb62678902f11c66a1a  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  13.1   dbg  100826  a217e1000f37a429a9c1d1c308952a959276b77e  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      CS  13.1   opt  100826  a217e1000f37a429a9c1d1c308952a959276b77e  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  10.6   dbg  100826  fcecb2620f25965723d640decede7c018bcb1dcc  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  10.6   opt  100826  fcecb2620f25965723d640decede7c018bcb1dcc  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  11.4   dbg  100826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  11.4   opt  100826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  11.8   dbg  100826  4694e931d10fecf733c34f83ea2146d31b708eb3  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  11.8   opt  100826  4694e931d10fecf733c34f83ea2146d31b708eb3  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  12.3   dbg  100826  ad4d36b69e4813957c35d5e148b93a51a61c91c6  options|SIGABRT|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      ES  12.3   opt  100826  ad4d36b69e4813957c35d5e148b93a51a61c91c6  SIGSEGV|ha_connect::create|handler::ha_create|ha_mroonga::wrapper_create|ha_mroonga::create
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.25d
                0.25d

                Git Integration

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