Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-5460

Dropping a trigger from a TokuDB table that contains non-ascii characters could lead to a crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Not 5.7, 8.0.15-5
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:

      Description

      gdb:

      Program terminated with signal 11, Segmentation fault.
      #0  0x00007fbdb48099d1 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
      (gdb) bt
      +bt
      #0  0x00007fbdb48099d1 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x0000000004486a7d in my_write_core (sig=11) at /sdc/release-8.0.15-5_dbg/mysys/stacktrace.cc:278
      #2  0x000000000342f82b in handle_fatal_signal (sig=11) at /sdc/release-8.0.15-5_dbg/sql/signal_handler.cc:252
      #3  <signal handler called>
      #4  0x00000000031ba259 in destroy<Table_trigger_dispatcher> (ptr=0x7fbd0f4ba590) at /sdc/release-8.0.15-5_dbg/include/my_alloc.h:382
      #5  0x000000000319fa6a in intern_close_table (table=0x7fbd0f4a1020) at /sdc/release-8.0.15-5_dbg/sql/sql_base.cc:1099
      #6  0x00000000033c61ee in Table_cache_manager::free_table (this=0x6de9d80 <table_cache_manager>, thd=0x7fbd0f41a000, remove_type=TDC_RT_REMOVE_ALL, share=0x7fbd0f457928) at /sdc/release-8.0.15-5_dbg/sql/table_cache.cc:312
      #7  0x00000000031b3541 in <lambda(std::unordered_map<std::basic_string<char>, std::unique_ptr<TABLE_SHARE, Table_share_deleter>, std::hash<std::basic_string<char> >, std::equal_to<std::basic_string<char> >, Malloc_allocator<std::pair<const std::basic_string<char>, std::unique_ptr<TABLE_SHARE, Table_share_deleter> > > >::iterator)>::operator()(std::unordered_map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::unique_ptr<TABLE_SHARE, Table_share_deleter>, std::hash<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Malloc_allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::unique_ptr<TABLE_SHARE, Table_share_deleter> > > >::iterator) const (__closure=0x7fbdb11ab8e0, it=...) at /sdc/release-8.0.15-5_dbg/sql/sql_base.cc:9708
      #8  0x00000000031b37d6 in tdc_remove_table (thd=0x7fbd0f41a000, remove_type=TDC_RT_REMOVE_ALL, db=0x7fbd0f4660c0 "test", table_name=0x7fbd0f4659e0 "t1", has_lock=false) at /sdc/release-8.0.15-5_dbg/sql/sql_base.cc:9720
      #9  0x0000000003308ace in drop_base_table (thd=0x7fbd0f41a000, drop_ctx=..., table=0x7fbd0f465b20, atomic=false, post_ddl_htons=0x0, fk_invalidator=0x0, safe_to_release_mdl=0x7fbdb11ad410) at /sdc/release-8.0.15-5_dbg/sql/sql_table.cc:2711
      #10 0x000000000330979c in mysql_rm_table_no_locks (thd=0x7fbd0f41a000, tables=0x7fbd0f465b20, if_exists=false, drop_temporary=false, drop_database=false, dropped_non_atomic_flag=0x7fbdb11ad40f, post_ddl_htons=0x7fbdb11ad330, fk_invalidator=0x7fbdb11ad360, safe_to_release_mdl=0x7fbdb11ad410) at /sdc/release-8.0.15-5_dbg/sql/sql_table.cc:2971
      #11 0x0000000003305ecd in mysql_rm_table (thd=0x7fbd0f41a000, tables=0x7fbd0f465b20, if_exists=false, drop_temporary=false) at /sdc/release-8.0.15-5_dbg/sql/sql_table.cc:1486
      #12 0x000000000326e391 in mysql_execute_command (thd=0x7fbd0f41a000, first_level=true) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:3544
      #13 0x0000000003273d99 in mysql_parse (thd=0x7fbd0f41a000, parser_state=0x7fbdb11aea30, update_userstat=false, force_primary_storage_engine=false) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:5334
      #14 0x000000000326946e in dispatch_command (thd=0x7fbd0f41a000, com_data=0x7fbdb11afb80, command=COM_QUERY) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:1761
      #15 0x000000000326794c in do_command (thd=0x7fbd0f41a000) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:1292
      #16 0x000000000341afec in handle_connection (arg=0x7fbd0e4924a0) at /sdc/release-8.0.15-5_dbg/sql/conn_handler/connection_handler_per_thread.cc:311
      #17 0x0000000004570614 in pfs_spawn_thread (arg=0x7fbd0e4b9320) at /sdc/release-8.0.15-5_dbg/storage/perfschema/pfs.cc:2836
      #18 0x00007fbdb4804dd5 in start_thread (arg=0x7fbdb11b0700) at pthread_create.c:307
      #19 0x00007fbdb29d4ead in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      SQL:

      CREATE DATABASE test;
      USE test;
      CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET=ujis ENGINE=InnoDB;
      create TABLE t1(c1 blob,primary key(c1(768))) engine=TokuDB;
      insert INTO t1 values(repeat('ांग्लादे',1200));
      create trigger trg2 after update on t1 for each row set @b:="Fired";
      DELETE FROM t1 ORDER BY(@@GLOBAL.INIT_CONNECT)ASC LIMIT 10;
      drop table t1,t4;
      

      I'm able to reproduce on both debug and release for 8.0.15-5:

      Server version: 8.0.15-5 Percona Server (GPL), Release 5, Revision f8a9e99
      
      mysql> CREATE DATABASE test;
      Query OK, 1 row affected (0.01 sec)
      
      mysql> USE test;
      Database changed
      mysql> CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET=ujis ENGINE=InnoDB;
      Query OK, 0 rows affected (0.03 sec)
      
      mysql> create TABLE t1(c1 blob,primary key(c1(768))) engine=TokuDB;
      Query OK, 0 rows affected (0.03 sec)
      
      mysql> insert INTO t1 values(repeat('ांग्लादे',1200));
      Query OK, 1 row affected (0.01 sec)
      
      mysql> create trigger trg2 after update on t1 for each row set @b:="Fired";
      Query OK, 0 rows affected (0.04 sec)
      
      mysql> DELETE FROM t1 ORDER BY(@@GLOBAL.INIT_CONNECT)ASC LIMIT 10;
      ERROR 1064 (42000): देांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादेांग्लादे
      mysql> drop table t1,t4;
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      error_log output:

      2019-03-06T19:50:40.827185Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.15-5'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Percona Server (GPL), Release 5, Revision f8a9e99.
      2019-03-06T19:50:40.917922Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/lib/mysql/mysqlx.sock' bind-address: '::' port: 33060
      19:53:07 UTC - 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.
      Attempting to collect some information that could help diagnose the problem.
      As this is a crash and something is definitely wrong, the information
      collection process might fail.
      Please help us make Percona Server better by reporting any
      bugs at https://bugs.percona.com/
      
      key_buffer_size=8388608
      read_buffer_size=131072
      max_used_connections=1
      max_threads=151
      thread_count=2
      connection_count=1
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67949 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      
      Thread pointer: 0x7f539e86d000
      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 = 7f53d4cc9c20 thread_stack 0x46000
      /usr/sbin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x2e) [0x1cb922e]
      /usr/sbin/mysqld(handle_fatal_signal+0x413) [0xfc6733]
      /lib64/libpthread.so.0(+0xf7e0) [0x7f53d82b17e0]
      /usr/sbin/mysqld(intern_close_table(TABLE*)+0x25) [0xe273a5]
      /usr/sbin/mysqld(Table_cache_manager::free_table(THD*, enum_tdc_remove_table_type, TABLE_SHARE*)+0x11f) [0xf86cbf]
      /usr/sbin/mysqld(tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)+0x133) [0xe32923]
      /usr/sbin/mysqld() [0xf1f843]
      /usr/sbin/mysqld(mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool*, std::set<handlerton*, std::less<handlerton*>, std::allocator<handlerton*> >*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*, std::allocator<MDL_ticket*> >*)+0x1601) [0xf23731]
      /usr/sbin/mysqld(mysql_rm_table(THD*, TABLE_LIST*, bool, bool)+0x364) [0xf24e34]
      /usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0x2778) [0xe9ff08]
      /usr/sbin/mysqld(mysql_parse(THD*, Parser_state*, bool, bool)+0x3df) [0xea24bf]
      /usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x2fa6) [0xea58e6]
      /usr/sbin/mysqld(do_command(THD*)+0x1f9) [0xea6429]
      /usr/sbin/mysqld() [0xfb7f98]
      /usr/sbin/mysqld() [0x1d604bf]
      /lib64/libpthread.so.0(+0x7aa1) [0x7f53d82a9aa1]
      /lib64/libc.so.6(clone+0x6d) [0x7f53d6158c4d]
      
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (7f539ef9e028): is an invalid pointer
      Connection ID (thread ID): 12
      Status: NOT_KILLED
      
      You may download the Percona Server operations manual by visiting
      http://www.percona.com/software/percona-server/. You may find information
      in the manual which will help you identify the cause of the crash.
      

      Using InnoDB instead of TokuDB table doesn't result in crash.

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  hrvoje.matijakovic Hrvoje Matijakovic
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 hour
                    1h