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

key buffer overrun

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Pending Release
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 8.0
    • Fix Version/s: 8.0.NEXT
    • Component/s: MyRocks
    • Labels:

      Description

      The following test(a part of rocksdb.rocksdb test)

      --source include/have_rocksdb.inc
      --source ../include/have_write_committed.inc
      
      --echo #
      --echo # Fix assertion failure (attempt to overrun the key buffer) for prefix indexes
      --echo #
      
      create table t1 (
        pk int primary key,
        col1 varchar(100),
        key (col1(10))
      ) engine=rocksdb;
      
      insert into t1 values (1, repeat('0123456789', 9));
      
      drop table t1;
      

      fails with the following stack trace on 8.0.12:

      Thread 1 (Thread 0x7f0da89f4700 (LWP 28658)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
      #1  0x00000000041521b5 in my_write_core (sig=6) at ./mysys/stacktrace.cc:278
      #2  0x00000000030a7d76 in handle_fatal_signal (sig=6) at ./sql/signal_handler.cc:249
      #3  <signal handler called>
      #4  0x00007f0db418d428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #5  0x00007f0db418f02a in __GI_abort () at abort.c:89
      #6  0x00007f0db4185bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7f0d459b41f8 "is_storage_available(tuple - packed_tuple, pack_info->m_max_image_len)", file=file@entry=0x7f0d459b3d70 "./storage/rocksdb/rdb_datadic.cc", line=line@entry=1015, function=function@entry=0x7f0d459b72c0 <myrocks::Rdb_key_def::pack_field(Field*, myrocks::Rdb_field_packing*, unsigned char*, unsigned char*, unsigned char*, myrocks::Rdb_string_writer*, unsigned int*) const::__PRETTY_FUNCTION__> "uchar* myrocks::Rdb_key_def::pack_field(Field*, myrocks::Rdb_field_packing*, uchar*, uchar*, uchar*, myrocks::Rdb_string_writer*, uint*) const") at assert.c:92
      #7  0x00007f0db4185c82 in __GI___assert_fail (assertion=0x7f0d459b41f8 "is_storage_available(tuple - packed_tuple, pack_info->m_max_image_len)", file=0x7f0d459b3d70 "./storage/rocksdb/rdb_datadic.cc", line=1015, function=0x7f0d459b72c0 <myrocks::Rdb_key_def::pack_field(Field*, myrocks::Rdb_field_packing*, unsigned char*, unsigned char*, unsigned char*, myrocks::Rdb_string_writer*, unsigned int*) const::__PRETTY_FUNCTION__> "uchar* myrocks::Rdb_key_def::pack_field(Field*, myrocks::Rdb_field_packing*, uchar*, uchar*, uchar*, myrocks::Rdb_string_writer*, uint*) const") at assert.c:101
      #8  0x00007f0d4531c625 in myrocks::Rdb_key_def::pack_field (this=0x7f0cf40275d0, field=0x7f0cf411ea48, pack_info=0x7f0cf4027b30, tuple=0x7f0cf41110c4 "", packed_tuple=0x7f0cf4110ff0 "", pack_buffer=0x7f0cf40e2be0 "\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\f\177", unpack_info=0x7f0cf40f3288, n_null_fields=0x0) at ./storage/rocksdb/rdb_datadic.cc:1014
      #9  0x00007f0d4531ceea in myrocks::Rdb_key_def::pack_record (this=0x7f0cf40275d0, tbl=0x7f0cf4119fd0, pack_buffer=0x7f0cf40e2be0 "\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\034=\034>\034?\034@\034A\034B\034C\034D\034E\034F\f\177", record=0x7f0cf411e6f8 "\376\001", packed_tuple=0x7f0cf4110ff0 "", unpack_info=0x7f0cf40f3288, should_store_row_debug_checksums=@0x7f0da89f191f: false, hidden_pk_id=@0x7f0da89f1aa0: 0, n_key_parts=2, n_null_fields=0x0, ttl_pk_offset=0x0, ttl_bytes=0x7f0cf40f3308 "") at ./storage/rocksdb/rdb_datadic.cc:1174
      #10 0x00007f0d452b50cf in myrocks::ha_rocksdb::update_sk (this=0x7f0cf40f1ba8, table_arg=0x7f0cf4119fd0, kd=..., row_info=..., bulk_load_sk=false) at ./storage/rocksdb/ha_rocksdb.cc:8891
      #11 0x00007f0d452b55b3 in myrocks::ha_rocksdb::update_indexes (this=0x7f0cf40f1ba8, row_info=..., pk_changed=@0x7f0da89f1a1b: false) at ./storage/rocksdb/ha_rocksdb.cc:8976
      #12 0x00007f0d452b5811 in myrocks::ha_rocksdb::update_write_row (this=0x7f0cf40f1ba8, old_data=0x0, new_data=0x7f0cf411e6f8 "\376\001", skip_unique_check=false) at ./storage/rocksdb/ha_rocksdb.cc:9037
      #13 0x00007f0d452b3874 in myrocks::ha_rocksdb::write_row (this=0x7f0cf40f1ba8, buf=0x7f0cf411e6f8 "\376\001") at ./storage/rocksdb/ha_rocksdb.cc:8428
      #14 0x0000000002b86e16 in handler::ha_write_row (this=0x7f0cf40f1ba8, buf=0x7f0cf411e6f8 "\376\001") at ./sql/handler.cc:7530
      #15 0x0000000002ea4159 in write_record (thd=0x7f0cf4000be0, table=0x7f0cf4119fd0, info=0x7f0da89f1e30, update=0x7f0da89f1eb0) at ./sql/sql_insert.cc:1832
      #16 0x0000000002ea07b9 in Sql_cmd_insert_values::execute_inner (this=0x7f0cf411c1c0, thd=0x7f0cf4000be0) at ./sql/sql_insert.cc:611
      #17 0x0000000002f58dfe in Sql_cmd_dml::execute (this=0x7f0cf411c1c0, thd=0x7f0cf4000be0) at ./sql/sql_select.cc:554
      #18 0x0000000002ef61bf in mysql_execute_command (thd=0x7f0cf4000be0, first_level=true) at ./sql/sql_parse.cc:3228
      #19 0x0000000002efbc2a in mysql_parse (thd=0x7f0cf4000be0, parser_state=0x7f0da89f3390) at ./sql/sql_parse.cc:4925
      #20 0x0000000002ef173e in dispatch_command (thd=0x7f0cf4000be0, com_data=0x7f0da89f3cf0, command=COM_QUERY) at ./sql/sql_parse.cc:1607
      #21 0x0000000002eefff7 in do_command (thd=0x7f0cf4000be0) at ./sql/sql_parse.cc:1232
      #22 0x00000000030952bb in handle_connection (arg=0x842cbb0) at ./sql/conn_handler/connection_handler_per_thread.cc:308
      #23 0x000000000482f4be in pfs_spawn_thread (arg=0x85b7920) at ./storage/perfschema/pfs.cc:2836
      #24 0x00007f0db5c906ba in start_thread (arg=0x7f0da89f4700) at pthread_create.c:333
      #25 0x00007f0db425f41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

        Attachments

          Activity

            People

            • Assignee:
              george.lorch George Lorch
              Reporter:
              vladislav.lesin Vladislav Lesin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 30 minutes
                3h 30m