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

Extending an InnoDB data file unnecessarily allocates a large memory buffer on Windows

    Details

      Description

      Debug version of 10.2 server has assertion failure while importing 'employees' database(https://github.com/datacharmer/test_db). Server is build using current 10.2 branch. ("current" means commit 7ca1e2abad42a7436e6b668b4568d6fadc2ca165 here)

      2016-12-09 23:37:00 16112 [Note] InnoDB: Buffer pool(s) load completed at 161209 23:37:00
      2016-12-09 23:46:00 0x4624  InnoDB: Assertion failure in thread 17956 in file ut0byte.ic line 89
      InnoDB: Failing assertion: ptr
      

      Occurs in ut_align called from fil_write_zeros. The callstack:

      > mysqld.exe!my_sigabrt_handler(int sig) Line 477 C
        [External Code]
        mysqld.exe!ut_dbg_assertion_failed(const char * expr, const char * file, unsigned long line) Line 68  C++
        mysqld.exe!ut_align(const void * ptr, unsigned long align_no) Line 89 C++
        mysqld.exe!fil_write_zeros(const fil_node_t * node, unsigned long page_size, unsigned __int64 start, unsigned long len, bool read_only_mode) Line 4891  C++
        mysqld.exe!fil_space_extend(fil_space_t * space, unsigned long size) Line 5067  C++
        mysqld.exe!fsp_try_extend_data_file(fil_space_t * space, unsigned char * header, mtr_t * mtr, unsigned long * n_pages_added) Line 1581  C++
        mysqld.exe!fsp_reserve_free_extents(unsigned long * n_reserved, unsigned long space_id, unsigned long n_ext, fsp_reserve_t alloc_type, mtr_t * mtr, unsigned long n_pages) Line 3506  C++
        mysqld.exe!btr_cur_pessimistic_insert(unsigned long flags, btr_cur_t * cursor, unsigned long * * offsets, mem_block_info_t * * heap, dtuple_t * entry, unsigned char * * rec, big_rec_t * * big_rec, unsigned long
      n_ext, que_thr_t * thr, mtr_t * mtr) Line 3501 C++
        mysqld.exe!row_ins_clust_index_entry_low(unsigned long flags, unsigned long mode, dict_index_t * index, unsigned long n_uniq, dtuple_t * entry, unsigned long n_ext, que_thr_t * thr, bool dup_chk_only) Line 2651
       C++
        mysqld.exe!row_ins_clust_index_entry(dict_index_t * index, dtuple_t * entry, que_thr_t * thr, unsigned long n_ext, bool dup_chk_only) Line 3386 C++
        mysqld.exe!row_ins_index_entry(dict_index_t * index, dtuple_t * entry, que_thr_t * thr) Line 3490 C++
        mysqld.exe!row_ins_index_entry_step(ins_node_t * node, que_thr_t * thr) Line 3640 C++
        mysqld.exe!row_ins(ins_node_t * node, que_thr_t * thr) Line 3782  C++
        mysqld.exe!row_ins_step(que_thr_t * thr) Line 3967  C++
        mysqld.exe!row_insert_for_mysql_using_ins_graph(const unsigned char * mysql_rec, row_prebuilt_t * prebuilt) Line 1784 C++
        mysqld.exe!row_insert_for_mysql(const unsigned char * mysql_rec, row_prebuilt_t * prebuilt) Line 1915 C++
        mysqld.exe!ha_innobase::write_row(unsigned char * record) Line 9094 C++
        mysqld.exe!handler::ha_write_row(unsigned char * buf) Line 5924 C++
        mysqld.exe!write_record(THD * thd, TABLE * table, st_copy_info * info) Line 1883  C++
        mysqld.exe!mysql_insert(THD * thd, TABLE_LIST * table_list, List<Item> & fields, List<List<Item> > & values_list, List<Item> & update_fields, List<Item> & update_values, enum_duplicates duplic, bool ignore) Line
       1003  C++
        mysqld.exe!mysql_execute_command(THD * thd) Line 4328 C++
        mysqld.exe!mysql_parse(THD * thd, char * rawbuf, unsigned int length, Parser_state * parser_state, bool is_com_multi, bool is_next_command) Line 7799 C++
        mysqld.exe!dispatch_command(enum_server_command command, THD * thd, char * packet, unsigned int packet_length, bool is_com_multi, bool is_next_command) Line 1808 C++
        mysqld.exe!do_command(THD * thd) Line 1368  C++
        mysqld.exe!threadpool_process_request(THD * thd) Line 319 C++
        mysqld.exe!tp_callback(TP_connection * c) Line 158  C++
        mysqld.exe!tp_callback(_TP_CALLBACK_INSTANCE * instance, void * context) Line 377 C++
        mysqld.exe!work_callback(_TP_CALLBACK_INSTANCE * instance, void * context, _TP_WORK * work) Line 451  C++
        [External Code]
        [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
      

      After that, mysqld cannot recover, and crashes on start in memcpy because of writing to/reading from NULL pointer. The "after" dump is for that case, but there is not much useful info in it. At least there is no meaningful backtrace. And again, RelWithDebInfo version can start on the same config.

        Attachments

        1. error.log
          70 kB
          Lawrin Novitsky
        2. mysqld_after_noheap.dmp
          91 kB
          Lawrin Novitsky
        3. mysqld_noheap.dmp
          113 kB
          Lawrin Novitsky
        4. mysqld_pdb.7z
          7.40 MB
          Lawrin Novitsky
        5. mysqld.7z
          5.15 MB
          Lawrin Novitsky

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                Lawrin Lawrin Novitsky
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: