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

Segfault in ALTER TABLE

    XMLWordPrintable

Details

    Description

      The attached sql scripts (generated from alembic migrations) which worked fine in previous versions (and the latest 10.5.x) of MariaDB server cause a segfault in 10.4.13.

      Environment:

      OS Debian buster
      Kernel 5.4.0-42, 4.15.0-109
      HW Intel 64-bit, with docker 19.03.12 under Ubuntu 20.04 or 18.04
      MariaDB 10.4.13

      Error message:

      200804  5:05:51 [ERROR] mysqld got signal 11 ;
       ...
      We think the query pointer is invalid, but we will try to print it anyway. 
      Query: ALTER TABLE albums ADD CONSTRAINT albums_fk1 FOREIGN KEY(list_id) REFERENCES lists (id)
      

      My.cnf

      [mysqld]
      #
      # * Basic Settings
      #
      basedir		    = /usr
      tmpdir	            = /tmp
      skip-external-locking
      character_set_server    = utf8
      ignore_db_dirs          = lost+found
       
      #
      # * Fine Tuning
      #
      ft_min_word_len         = 3
      join_buffer_size        = 131072
      key_buffer_size         = 16M
      max_allowed_packet      = 256M
      #max_connections        = 100
      max_heap_table_size     = 16M
      query_cache_type        = OFF
      query_cache_size        = 0
      read_buffer_size        = 131072
      read_rnd_buffer_size    = 262144
      table_open_cache        = 4096
      thread_stack            = 192K
      thread_cache_size       = 8
      #thread_concurrency     = 12
      tmp_table_size          = 16M
       
      interactive_timeout     = 28800
      net_read_timeout        = 30
      net_write_timeout       = 60
      wait_timeout            = 3600
       
      #
      # * Slow query log
      #
      slow_query_log_file     = /var/log/mysql/mysql-slow.log
      slow_query_log          = 1
      long_query_time         = 4
      #log_queries_not_using_indexes
       
      #
      # * InnoDB
      #
      innodb_data_file_path        = ibdata1:10M:autoextend
      innodb_buffer_pool_instances = 1
      innodb_buffer_pool_size      = 1024M
      innodb_log_file_size         = 32M
      

      Additional info:
      The Dockerfile I use to test and verify this is at: instantlinux/mariadb-galera Dockerfile
      An image built (from the stock debian binary package) that exhibits this problem under Docker is published to instantlinux/mariadb-galera:10.4.13 on dockerhub.

      To reproduce, CREATE DATABASE, then run the first.sql and crash_it.sql files.

      Full dump of error:

      200804  5:05:51 [ERROR] 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.
       
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      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.
       
      Server version: 10.4.13-MariaDB-1:10.4.13+maria~buster-log
      key_buffer_size=16777216
      read_buffer_size=131072
      max_used_connections=3
      max_threads=153
      thread_count=18
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 353068 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f6934000e78
      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 = 0x7f69e40ccdd8 thread_stack 0x30000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x5627800f18de]
      /usr/sbin/mysqld(handle_fatal_signal+0x54d)[0x56277fbe9c4d]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7f6a16239730]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f6934010270): is an invalid pointer
      Connection ID (thread ID): 160
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
       
      We think the query pointer is invalid, but we will try to print it anyway. 
      Query: ALTER TABLE albums ADD CONSTRAINT albums_fk1 FOREIGN KEY(list_id) REFERENCES lists (id)
       
      Writing a core file...
      Working directory at /var/lib/mysql
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units     
      Max cpu time              unlimited            unlimited            seconds   
      Max file size             unlimited            unlimited            bytes     
      Max data size             unlimited            unlimited            bytes     
      Max stack size            8388608              unlimited            bytes     
      Max core file size        unlimited            unlimited            bytes     
      Max resident set          unlimited            unlimited            bytes     
      Max processes             unlimited            unlimited            processes 
      Max open files            1048576              1048576              files     
      Max locked memory         65536                65536                bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       127370               127370               signals   
      Max msgqueue size         819200               819200               bytes     
      Max nice priority         0                    0                    
      Max realtime priority     0                    0                    
      Max realtime timeout      unlimited            unlimited            us        
      Core pattern: |/usr/share/apport/apport %p %s %c %d %P ...
      

      Attachments

        1. crash_it.sql
          0.8 kB
        2. first.sql
          14 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              instantlinux Rich Braun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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