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

Segmentation fault with TokuDB and optimising locked table

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.6.x, 5.7.x, Not 8.0.x
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None

      Description

      I'm able to reproduce this on both debug and release builds for 5.6.45-86.1

      sql:

      USE test;
      CREATE TABLE t2(id INT,id1 INT,KEY(id1)) ENGINE=TokuDB;
      create table t3(n int);
      lock table t2 write,t3 read;
      SET SESSION AUTOCOMMIT=0;
      OPTIMIZE TABLE t2;
      

      results in:

      mysql> USE test;
      Database changed
      mysql> CREATE TABLE t2(id INT,id1 INT,KEY(id1)) ENGINE=TokuDB;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> create table t3(n int);
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> lock table t2 write,t3 read;
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> SET SESSION AUTOCOMMIT=0;
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> OPTIMIZE TABLE t2;
      +---------+----------+----------+-------------------------------------------------------------------+
      | Table   | Op       | Msg_type | Msg_text                                                          |
      +---------+----------+----------+-------------------------------------------------------------------+
      | test.t2 | optimize | note     | Table does not support optimize, doing recreate + analyze instead |
      | test.t2 | optimize | error    | Lock wait timeout exceeded; try restarting transaction            |
      | test.t2 | optimize | status   | Operation failed                                                  |
      +---------+----------+----------+-------------------------------------------------------------------+
      3 rows in set, 1 warning (4.00 sec)
      

      error log from the opt/release build:

      2019-08-13 07:53:14 12987 [Note] /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld: ready for connections.
      Version: '5.6.45-86.1'  socket: '/dev/shm/1565692075/socket.sock'  port: 31555  MySQL Community Server (GPL)
      11:53:55 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.
      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.
      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=153
      thread_count=1
      connection_count=1
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 69062 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      
      Thread pointer: 0x7efc6b339000
      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 = 7efca3631d08 thread_stack 0x40000
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(my_print_stacktrace+0x2c)[0x8ea42c]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(handle_fatal_signal+0x48a)[0x66ec4a]
      /lib64/libpthread.so.0(+0xf5d0)[0x7efca30445d0]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(_ZN18Locked_tables_list20unlock_locked_tablesEP3THD+0x3f)[0x69e1af]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(_ZN3THD7cleanupEv+0x40)[0x6bc7c0]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(_ZN3THD17release_resourcesEv+0x1e8)[0x6bcbf8]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(_Z29one_thread_per_connection_endP3THDb+0x1c)[0x5ac0ec]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(_Z24do_handle_one_connectionP3THD+0xe6)[0x6c0526]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(handle_one_connection+0x40)[0x6c0670]
      /sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-opt/bin/mysqld(pfs_spawn_thread+0x146)[0x921576]
      /lib64/libpthread.so.0(+0x7dd5)[0x7efca303cdd5]
      /lib64/libc.so.6(clone+0x6d)[0x7efca120c02d]
      
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0): Connection ID (thread ID): 1
      Status: KILL_CONNECTION
      

      gdb from the debug build:

      Core was generated by `/sdc/PS070819-percona-server-5.6.45-86.1-linux-x86_64-debug/bin/mysqld --no-def'.
      Program terminated with signal 11, Segmentation fault.
      #0  0x00007f25014b89d1 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  0x00007f25014b89d1 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x0000000000ad6cf7 in my_write_core (sig=11) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/mysys/stacktrace.c:424
      #2  0x0000000000747a52 in handle_fatal_signal (sig=11) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/signal_handler.cc:236
      #3  <signal handler called>
      #4  0x000000000078aa2e in Locked_tables_list::unlock_locked_tables (this=0x7f24d63b7070, thd=0x7f24d63b5000) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/sql_base.cc:3538
      #5  0x00000000007af894 in THD::cleanup (this=0x7f24d63b5000) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/sql_class.cc:1716
      #6  0x00000000007afb59 in THD::release_resources (this=0x7f24d63b5000) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/sql_class.cc:1793
      #7  0x000000000063ac4c in one_thread_per_connection_end (thd=0x7f24d63b5000, block_pthread=true) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/mysqld.cc:3040
      #8  0x00000000007bf3d3 in do_handle_one_connection (thd_arg=0x7f24d6352000) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/sql_connect.cc:1602
      #9  0x00000000007bf01f in handle_one_connection (arg=0x7f24d6352000) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/sql/sql_connect.cc:1492
      #10 0x0000000000b1a7d9 in pfs_spawn_thread (arg=0x7f24d6341d40) at /home/hrvoje/sdc/release-5.6.45-86.1_dbg/storage/perfschema/pfs.cc:1861
      #11 0x00007f25014b3dd5 in start_thread (arg=0x7f2501aa9700) at pthread_create.c:307
      #12 0x00007f24ff68302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      (gdb) quit
      

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hrvoje.matijakovic Hrvoje Matijakovic
              • 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 - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 30 minutes
                  30m