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

Server crash or ASAN errors in _ma_remove_table_from_trnman upon ALTER under multiple locks

    XMLWordPrintable

Details

    Description

      Setting to Minor, because only 10.2 and 10.3 appear to be affected.

      A very similar failure MDEV-21502 was fixed in the scope of MDEV-21398, but the one below is still reproducible.

      CREATE TABLE t (a INT DEFAULT 0) ENGINE=Aria;
      CREATE VIEW v AS SELECT * FROM t;
      LOCK TABLES t WRITE, v READ;
      ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE;
       
      # Cleanup
      UNLOCK TABLES;
      DROP VIEW v;
      DROP TABLE t;
      

      10.2 259e5243

      ==2656933==ERROR: AddressSanitizer: heap-use-after-free on address 0x62900004b270 at pc 0x55eede3bccd3 bp 0x7fab2fced280 sp 0x7fab2fced270
      READ of size 8 at 0x62900004b270 thread T5
          #0 0x55eede3bccd2 in _ma_remove_table_from_trnman /data/src/10.2/storage/maria/ma_state.c:611
          #1 0x55eede4afc1e in maria_extra /data/src/10.2/storage/maria/ma_extra.c:350
          #2 0x55eede3f9049 in ha_maria::extra(ha_extra_function) /data/src/10.2/storage/maria/ha_maria.cc:2619
          #3 0x55eedcf76ca1 in wait_while_table_is_used(THD*, TABLE*, ha_extra_function) /data/src/10.2/sql/sql_base.cc:1236
          #4 0x55eedd2d607d in mysql_inplace_alter_table /data/src/10.2/sql/sql_table.cc:7465
          #5 0x55eedd2e5730 in mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) /data/src/10.2/sql/sql_table.cc:9627
          #6 0x55eedd42cd2d in Sql_cmd_alter_table::execute(THD*) /data/src/10.2/sql/sql_alter.cc:333
          #7 0x55eedd0b398e in mysql_execute_command(THD*) /data/src/10.2/sql/sql_parse.cc:6021
          #8 0x55eedd0bf217 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.2/sql/sql_parse.cc:7790
          #9 0x55eedd09830e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.2/sql/sql_parse.cc:1827
          #10 0x55eedd0950cd in do_command(THD*) /data/src/10.2/sql/sql_parse.cc:1381
          #11 0x55eedd41d21a in do_handle_one_connection(CONNECT*) /data/src/10.2/sql/sql_connect.cc:1336
          #12 0x55eedd41cadd in handle_one_connection /data/src/10.2/sql/sql_connect.cc:1241
          #13 0x55eede7bb0c7 in pfs_spawn_thread /data/src/10.2/storage/perfschema/pfs.cc:1869
          #14 0x7fab3aa57608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
          #15 0x7fab3a633292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292)
       
      0x62900004b270 is located 112 bytes inside of 18420-byte region [0x62900004b200,0x62900004f9f4)
      freed by thread T5 here:
          #0 0x7fab3b0227cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf)
          #1 0x55eede8d8d40 in free_memory /data/src/10.2/mysys/safemalloc.c:279
          #2 0x55eede8d828c in sf_free /data/src/10.2/mysys/safemalloc.c:197
          #3 0x55eede8a45f8 in my_free /data/src/10.2/mysys/my_malloc.c:218
          #4 0x55eede55e0dd in maria_close /data/src/10.2/storage/maria/ma_close.c:256
          #5 0x55eede3ed7d5 in ha_maria::close() /data/src/10.2/storage/maria/ha_maria.cc:1277
          #6 0x55eedd6ed4bd in handler::ha_close() /data/src/10.2/sql/handler.cc:2657
          #7 0x55eedd367323 in closefrm(TABLE*) /data/src/10.2/sql/table.cc:3525
          #8 0x55eedd59db34 in intern_close_table /data/src/10.2/sql/table_cache.cc:222
          #9 0x55eedd59dda3 in tc_remove_table /data/src/10.2/sql/table_cache.cc:260
          #10 0x55eedd59ec6a in tc_release_table(TABLE*) /data/src/10.2/sql/table_cache.cc:461
          #11 0x55eedcf751d5 in close_thread_table(THD*, TABLE**) /data/src/10.2/sql/sql_base.cc:911
          #12 0x55eedcf73e9c in close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*) /data/src/10.2/sql/sql_base.cc:685
          #13 0x55eedd2d57be in mysql_inplace_alter_table /data/src/10.2/sql/sql_table.cc:7351
          #14 0x55eedd2e5730 in mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) /data/src/10.2/sql/sql_table.cc:9627
          #15 0x55eedd42cd2d in Sql_cmd_alter_table::execute(THD*) /data/src/10.2/sql/sql_alter.cc:333
          #16 0x55eedd0b398e in mysql_execute_command(THD*) /data/src/10.2/sql/sql_parse.cc:6021
          #17 0x55eedd0bf217 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.2/sql/sql_parse.cc:7790
          #18 0x55eedd09830e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.2/sql/sql_parse.cc:1827
          #19 0x55eedd0950cd in do_command(THD*) /data/src/10.2/sql/sql_parse.cc:1381
          #20 0x55eedd41d21a in do_handle_one_connection(CONNECT*) /data/src/10.2/sql/sql_connect.cc:1336
          #21 0x55eedd41cadd in handle_one_connection /data/src/10.2/sql/sql_connect.cc:1241
          #22 0x55eede7bb0c7 in pfs_spawn_thread /data/src/10.2/storage/perfschema/pfs.cc:1869
          #23 0x7fab3aa57608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      previously allocated by thread T5 here:
          #0 0x7fab3b022bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x55eede8d7bfe in sf_malloc /data/src/10.2/mysys/safemalloc.c:118
          #2 0x55eede8a3b87 in my_malloc /data/src/10.2/mysys/my_malloc.c:101
          #3 0x55eede87ee49 in my_multi_malloc /data/src/10.2/mysys/mulalloc.c:51
          #4 0x55eede48cf6e in maria_clone_internal /data/src/10.2/storage/maria/ma_open.c:118
          #5 0x55eede496e5a in maria_open /data/src/10.2/storage/maria/ma_open.c:1043
          #6 0x55eede3ec9a4 in ha_maria::open(char const*, int, unsigned int) /data/src/10.2/storage/maria/ha_maria.cc:1203
          #7 0x55eedd6ec666 in handler::ha_open(TABLE*, char const*, int, unsigned int) /data/src/10.2/sql/handler.cc:2592
          #8 0x55eedd366286 in open_table_from_share(THD*, TABLE_SHARE*, char const*, unsigned int, unsigned int, unsigned int, TABLE*, bool) /data/src/10.2/sql/table.cc:3422
          #9 0x55eedcf79e5d in open_table(THD*, TABLE_LIST*, Open_table_context*) /data/src/10.2/sql/sql_base.cc:1934
          #10 0x55eedcf81de2 in open_and_process_table /data/src/10.2/sql/sql_base.cc:3614
          #11 0x55eedcf841bc in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /data/src/10.2/sql/sql_base.cc:4081
          #12 0x55eedcf87d42 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /data/src/10.2/sql/sql_base.cc:4880
          #13 0x55eedcefef11 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /data/src/10.2/sql/sql_base.h:507
          #14 0x55eedd33bce3 in mysql_create_view(THD*, TABLE_LIST*, enum_view_create_mode) /data/src/10.2/sql/sql_view.cc:453
          #15 0x55eedd0b2a64 in mysql_execute_command(THD*) /data/src/10.2/sql/sql_parse.cc:5847
          #16 0x55eedd0bf217 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.2/sql/sql_parse.cc:7790
          #17 0x55eedd09830e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.2/sql/sql_parse.cc:1827
          #18 0x55eedd0950cd in do_command(THD*) /data/src/10.2/sql/sql_parse.cc:1381
          #19 0x55eedd41d21a in do_handle_one_connection(CONNECT*) /data/src/10.2/sql/sql_connect.cc:1336
          #20 0x55eedd41cadd in handle_one_connection /data/src/10.2/sql/sql_connect.cc:1241
          #21 0x55eede7bb0c7 in pfs_spawn_thread /data/src/10.2/storage/perfschema/pfs.cc:1869
          #22 0x7fab3aa57608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Thread T5 created by T0 here:
          #0 0x7fab3af4f805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805)
          #1 0x55eede7bb4b8 in spawn_thread_v1 /data/src/10.2/storage/perfschema/pfs.cc:1919
          #2 0x55eedce3a1e3 in inline_mysql_thread_create /data/src/10.2/include/mysql/psi/mysql_thread.h:1246
          #3 0x55eedce51db4 in create_thread_to_handle_connection(CONNECT*) /data/src/10.2/sql/mysqld.cc:6573
          #4 0x55eedce5254f in create_new_thread /data/src/10.2/sql/mysqld.cc:6643
          #5 0x55eedce536e1 in handle_connections_sockets() /data/src/10.2/sql/mysqld.cc:6901
          #6 0x55eedce51105 in mysqld_main(int, char**) /data/src/10.2/sql/mysqld.cc:6192
          #7 0x55eedce38a9c in main /data/src/10.2/sql/main.cc:25
          #8 0x7fab3a5380b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
       
      SUMMARY: AddressSanitizer: heap-use-after-free /data/src/10.2/storage/maria/ma_state.c:611 in _ma_remove_table_from_trnman
      Shadow bytes around the buggy address:
        0x0c52800015f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c5280001600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c5280001610: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c5280001620: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c5280001630: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      =>0x0c5280001640: fd fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd
        0x0c5280001650: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c5280001660: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c5280001670: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c5280001680: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c5280001690: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07 
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
        Shadow gap:              cc
      ==2656933==ABORTING
      210303  0:38:22 [ERROR] mysqld got signal 6 ;
      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.2.38-MariaDB-debug-log
      key_buffer_size=1048576
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=1
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 63104 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x62a000060270
      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 = 0x7fab2fcf1d90 thread_stack 0x5b000
      /lib/x86_64-linux-gnu/libasan.so.5(+0x6cd30)[0x7fab3af81d30]
      mysys/stacktrace.c:172(my_print_stacktrace)[0x55eede8b55b5]
      sql/signal_handler.cc:209(handle_fatal_signal)[0x55eedd6da82d]
      sigaction.c:0(__restore_rt)[0x7fab3aa633c0]
      /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fab3a55718b]
      /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fab3a536859]
      /lib/x86_64-linux-gnu/libasan.so.5(+0x12b6a2)[0x7fab3b0406a2]
      /lib/x86_64-linux-gnu/libasan.so.5(+0x13624c)[0x7fab3b04b24c]
      /lib/x86_64-linux-gnu/libasan.so.5(+0x1178ec)[0x7fab3b02c8ec]
      /lib/x86_64-linux-gnu/libasan.so.5(+0x117363)[0x7fab3b02c363]
      /lib/x86_64-linux-gnu/libasan.so.5(__asan_report_load8+0x3b)[0x7fab3b02d1ab]
      maria/ma_state.c:611(_ma_remove_table_from_trnman)[0x55eede3bccd3]
      maria/ma_extra.c:352(maria_extra)[0x55eede4afc1f]
      maria/ha_maria.cc:2619(ha_maria::extra(ha_extra_function))[0x55eede3f904a]
      sql/sql_base.cc:1236(wait_while_table_is_used(THD*, TABLE*, ha_extra_function))[0x55eedcf76ca2]
      sql/sql_table.cc:7465(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x55eedd2d607e]
      sql/sql_table.cc:9627(mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x55eedd2e5731]
      sql/sql_alter.cc:333(Sql_cmd_alter_table::execute(THD*))[0x55eedd42cd2e]
      sql/sql_parse.cc:6021(mysql_execute_command(THD*))[0x55eedd0b398f]
      sql/sql_parse.cc:7790(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55eedd0bf218]
      sql/sql_parse.cc:1830(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55eedd09830f]
      sql/sql_parse.cc:1381(do_command(THD*))[0x55eedd0950ce]
      sql/sql_connect.cc:1336(do_handle_one_connection(CONNECT*))[0x55eedd41d21b]
      sql/sql_connect.cc:1242(handle_one_connection)[0x55eedd41cade]
      perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55eede7bb0c8]
      nptl/pthread_create.c:478(start_thread)[0x7fab3aa57609]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7fab3a633293]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x62b000000290): ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE
       
      Connection ID (thread ID): 4
      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=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
       
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /dev/shm/var_auto_WWAB/mysqld.1/data
      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             385874               385874               processes 
      Max open files            1024                 1024                 files     
      Max locked memory         67108864             67108864             bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       385874               385874               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 %E
       
      ----------SERVER LOG END-------------
       
       
       - found 'core' (0/5)
       
      Trying 'dbx' to get a backtrace
       
      Trying 'gdb' to get a backtrace from coredump /data/bld/10.2-asan-nightly/mysql-test/var/log/bug.trnman1/mysqld.1/data/core
      Core generated by '/data/bld/10.2-asan-nightly/bin/mysqld'
      Output from gdb follows. The first stack trace is from the failing thread.
      The following stack traces are from all threads (so the failing one is
      duplicated).
      --------------------------
      [New LWP 2656940]
      [New LWP 2656935]
      [New LWP 2656934]
      [New LWP 2656933]
      [New LWP 2656936]
      [New LWP 2656937]
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
      Core was generated by `/data/bld/10.2-asan-nightly/bin/mysqld --defaults-group-suffix=.1 --defaults-fi'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      56	../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
      [Current thread is 1 (Thread 0x7fab2fcf2700 (LWP 2656940))]
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055eede8b5737 in my_write_core (sig=6) at /data/src/10.2/mysys/stacktrace.c:382
      #2  0x000055eedd6dae23 in handle_fatal_signal (sig=6) at /data/src/10.2/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00007fab3a536859 in __GI_abort () at abort.c:79
      #6  0x00007fab3b0406a2 in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #7  0x00007fab3b04b24c in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #8  0x00007fab3b02c8ec in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #9  0x00007fab3b02c363 in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #10 0x00007fab3b02d1ab in __asan_report_load8 () from /lib/x86_64-linux-gnu/libasan.so.5
      #11 0x000055eede3bccd3 in _ma_remove_table_from_trnman (info=0x6290000f0270) at /data/src/10.2/storage/maria/ma_state.c:611
      #12 0x000055eede4afc1f in maria_extra (info=0x6290000f0270, function=HA_EXTRA_PREPARE_FOR_RENAME, extra_arg=0x0) at /data/src/10.2/storage/maria/ma_extra.c:350
      #13 0x000055eede3f904a in ha_maria::extra (this=0x61c00002f910, operation=HA_EXTRA_PREPARE_FOR_RENAME) at /data/src/10.2/storage/maria/ha_maria.cc:2619
      #14 0x000055eedcf76ca2 in wait_while_table_is_used (thd=0x62a000060270, table=0x61f000041af0, function=HA_EXTRA_PREPARE_FOR_RENAME) at /data/src/10.2/sql/sql_base.cc:1236
      #15 0x000055eedd2d607e in mysql_inplace_alter_table (thd=0x62a000060270, table_list=0x62b0000003d0, table=0x61f000041af0, altered_table=0x61f0000428f0, ha_alter_info=0x7fab2fceda90, inplace_supported=HA_ALTER_INPLACE_NO_LOCK, target_mdl_request=0x7fab2fcedb20, alter_ctx=0x7fab2fcedf00) at /data/src/10.2/sql/sql_table.cc:7465
      #16 0x000055eedd2e5731 in mysql_alter_table (thd=0x62a000060270, new_db=0x62b0000009f0 "test", new_name=0x0, create_info=0x7fab2fcef1a0, table_list=0x62b0000003d0, alter_info=0x7fab2fcef0b0, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9627
      #17 0x000055eedd42cd2e in Sql_cmd_alter_table::execute (this=0x62b000000a58, thd=0x62a000060270) at /data/src/10.2/sql/sql_alter.cc:333
      #18 0x000055eedd0b398f in mysql_execute_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:6021
      #19 0x000055eedd0bf218 in mysql_parse (thd=0x62a000060270, rawbuf=0x62b000000290 "ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE", length=50, parser_state=0x7fab2fcf0c90, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7790
      #20 0x000055eedd09830f in dispatch_command (command=COM_QUERY, thd=0x62a000060270, packet=0x6290000eb271 "ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE", packet_length=50, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #21 0x000055eedd0950ce in do_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:1381
      #22 0x000055eedd41d21b in do_handle_one_connection (connect=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1336
      #23 0x000055eedd41cade in handle_one_connection (arg=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x616000009ff0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #25 0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 6 (Thread 0x7fab2fd75700 (LWP 2656937)):
      #0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55eedfdefb88 <COND_manager+40>) at ../sysdeps/nptl/futex-internal.h:183
      #1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55eedfdefaa8 <LOCK_manager+40>, cond=0x55eedfdefb60 <COND_manager>) at pthread_cond_wait.c:508
      #2  __pthread_cond_wait (cond=0x55eedfdefb60 <COND_manager>, mutex=0x55eedfdefaa8 <LOCK_manager+40>) at pthread_cond_wait.c:638
      #3  0x000055eede8c36e0 in safe_cond_wait (cond=0x55eedfdefb60 <COND_manager>, mp=0x55eedfdefa80 <LOCK_manager>, file=0x55eedea5ca80 "/data/src/10.2/include/mysql/psi/mysql_thread.h", line=1145) at /data/src/10.2/mysys/thr_mutex.c:491
      #4  0x000055eedd08cbcf in inline_mysql_cond_wait (that=0x55eedfdefb60 <COND_manager>, mutex=0x55eedfdefa80 <LOCK_manager>, src_file=0x55eedea5d220 "/data/src/10.2/sql/sql_manager.cc", src_line=102) at /data/src/10.2/include/mysql/psi/mysql_thread.h:1145
      #5  0x000055eedd08d63c in handle_manager (arg=0x0) at /data/src/10.2/sql/sql_manager.cc:102
      #6  0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x6160000087f0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #7  0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #8  0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 5 (Thread 0x7fab2fe08700 (LWP 2656936)):
      #0  0x00007fab3a558322 in __GI___sigtimedwait (set=set@entry=0x7fab2fe07d50, info=info@entry=0x7fab2fe07350, timeout=timeout@entry=0x0) at ../sysdeps/unix/sysv/linux/sigtimedwait.c:29
      #1  0x00007fab3aa62f6c in __sigwait (set=0x7fab2fe07d50, sig=0x7fab2fe07cd0) at ../sysdeps/unix/sysv/linux/sigwait.c:28
      #2  0x00007fab3af606f1 in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #3  0x000055eedce48992 in signal_hand (arg=0x0) at /data/src/10.2/sql/mysqld.cc:3557
      #4  0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x6160000072f0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #5  0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #6  0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 4 (Thread 0x7fab3a503300 (LWP 2656933)):
      #0  0x00007fab3a626aff in __GI___poll (fds=0x7ffe89845f60, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
      #1  0x00007fab3af515ba in poll () from /lib/x86_64-linux-gnu/libasan.so.5
      #2  0x000055eedce52d1b in handle_connections_sockets () at /data/src/10.2/sql/mysqld.cc:6724
      #3  0x000055eedce51106 in mysqld_main (argc=<error reading variable: Cannot access memory at address 0x3d60>, argv=<error reading variable: Cannot access memory at address 0x3d70>) at /data/src/10.2/sql/mysqld.cc:6192
      #4  0x000055eedce38a9d in main (argc=6, argv=0x7ffe89846398) at /data/src/10.2/sql/main.cc:25
       
      Thread 3 (Thread 0x7fab3300e700 (LWP 2656934)):
      #0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fab3300ddd0, clockid=<optimized out>, expected=0, futex_word=0x55eee069a028 <COND_timer+40>) at ../sysdeps/nptl/futex-internal.h:320
      #1  __pthread_cond_wait_common (abstime=0x7fab3300ddd0, clockid=<optimized out>, mutex=0x55eee0699f48 <LOCK_timer+40>, cond=0x55eee069a000 <COND_timer>) at pthread_cond_wait.c:520
      #2  __pthread_cond_timedwait (cond=0x55eee069a000 <COND_timer>, mutex=0x55eee0699f48 <LOCK_timer+40>, abstime=0x7fab3300ddd0) at pthread_cond_wait.c:656
      #3  0x000055eede8c4019 in safe_cond_timedwait (cond=0x55eee069a000 <COND_timer>, mp=0x55eee0699f20 <LOCK_timer>, abstime=0x7fab3300ddd0, file=0x55eedf1d82a0 "/data/src/10.2/include/mysql/psi/mysql_thread.h", line=1182) at /data/src/10.2/mysys/thr_mutex.c:545
      #4  0x000055eede8c6d51 in inline_mysql_cond_timedwait (that=0x55eee069a000 <COND_timer>, mutex=0x55eee0699f20 <LOCK_timer>, abstime=0x7fab3300ddd0, src_file=0x55eedf1d8340 "/data/src/10.2/mysys/thr_timer.c", src_line=292) at /data/src/10.2/include/mysql/psi/mysql_thread.h:1182
      #5  0x000055eede8c8b2e in timer_handler (arg=0x0) at /data/src/10.2/mysys/thr_timer.c:292
      #6  0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x6160000021f0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #7  0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #8  0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 2 (Thread 0x7fab3190c700 (LWP 2656935)):
      #0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fab3190bc80, clockid=<optimized out>, expected=0, futex_word=0x55eee0682c68 <COND_checkpoint+40>) at ../sysdeps/nptl/futex-internal.h:320
      #1  __pthread_cond_wait_common (abstime=0x7fab3190bc80, clockid=<optimized out>, mutex=0x55eee0682b88 <LOCK_checkpoint+40>, cond=0x55eee0682c40 <COND_checkpoint>) at pthread_cond_wait.c:520
      #2  __pthread_cond_timedwait (cond=0x55eee0682c40 <COND_checkpoint>, mutex=0x55eee0682b88 <LOCK_checkpoint+40>, abstime=0x7fab3190bc80) at pthread_cond_wait.c:656
      #3  0x000055eede8c4019 in safe_cond_timedwait (cond=0x55eee0682c40 <COND_checkpoint>, mp=0x55eee0682b60 <LOCK_checkpoint>, abstime=0x7fab3190bc80, file=0x55eedf102920 "/data/src/10.2/include/mysql/psi/mysql_thread.h", line=1182) at /data/src/10.2/mysys/thr_mutex.c:545
      #4  0x000055eede484af6 in inline_mysql_cond_timedwait (that=0x55eee0682c40 <COND_checkpoint>, mutex=0x55eee0682b60 <LOCK_checkpoint>, abstime=0x7fab3190bc80, src_file=0x55eedf1029a0 "/data/src/10.2/storage/maria/ma_servicethread.c", src_line=115) at /data/src/10.2/include/mysql/psi/mysql_thread.h:1182
      #5  0x000055eede48594c in my_service_thread_sleep (control=0x55eedfb449c0 <checkpoint_control>, sleep_time=29000000000) at /data/src/10.2/storage/maria/ma_servicethread.c:115
      #6  0x000055eede468d11 in ma_checkpoint_background (arg=0x1e) at /data/src/10.2/storage/maria/ma_checkpoint.c:709
      #7  0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x616000005af0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #8  0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #9  0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 1 (Thread 0x7fab2fcf2700 (LWP 2656940)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055eede8b5737 in my_write_core (sig=6) at /data/src/10.2/mysys/stacktrace.c:382
      #2  0x000055eedd6dae23 in handle_fatal_signal (sig=6) at /data/src/10.2/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00007fab3a536859 in __GI_abort () at abort.c:79
      #6  0x00007fab3b0406a2 in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #7  0x00007fab3b04b24c in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #8  0x00007fab3b02c8ec in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #9  0x00007fab3b02c363 in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
      #10 0x00007fab3b02d1ab in __asan_report_load8 () from /lib/x86_64-linux-gnu/libasan.so.5
      #11 0x000055eede3bccd3 in _ma_remove_table_from_trnman (info=0x6290000f0270) at /data/src/10.2/storage/maria/ma_state.c:611
      #12 0x000055eede4afc1f in maria_extra (info=0x6290000f0270, function=HA_EXTRA_PREPARE_FOR_RENAME, extra_arg=0x0) at /data/src/10.2/storage/maria/ma_extra.c:350
      #13 0x000055eede3f904a in ha_maria::extra (this=0x61c00002f910, operation=HA_EXTRA_PREPARE_FOR_RENAME) at /data/src/10.2/storage/maria/ha_maria.cc:2619
      #14 0x000055eedcf76ca2 in wait_while_table_is_used (thd=0x62a000060270, table=0x61f000041af0, function=HA_EXTRA_PREPARE_FOR_RENAME) at /data/src/10.2/sql/sql_base.cc:1236
      #15 0x000055eedd2d607e in mysql_inplace_alter_table (thd=0x62a000060270, table_list=0x62b0000003d0, table=0x61f000041af0, altered_table=0x61f0000428f0, ha_alter_info=0x7fab2fceda90, inplace_supported=HA_ALTER_INPLACE_NO_LOCK, target_mdl_request=0x7fab2fcedb20, alter_ctx=0x7fab2fcedf00) at /data/src/10.2/sql/sql_table.cc:7465
      #16 0x000055eedd2e5731 in mysql_alter_table (thd=0x62a000060270, new_db=0x62b0000009f0 "test", new_name=0x0, create_info=0x7fab2fcef1a0, table_list=0x62b0000003d0, alter_info=0x7fab2fcef0b0, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9627
      #17 0x000055eedd42cd2e in Sql_cmd_alter_table::execute (this=0x62b000000a58, thd=0x62a000060270) at /data/src/10.2/sql/sql_alter.cc:333
      #18 0x000055eedd0b398f in mysql_execute_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:6021
      #19 0x000055eedd0bf218 in mysql_parse (thd=0x62a000060270, rawbuf=0x62b000000290 "ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE", length=50, parser_state=0x7fab2fcf0c90, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7790
      #20 0x000055eedd09830f in dispatch_command (command=COM_QUERY, thd=0x62a000060270, packet=0x6290000eb271 "ALTER TABLE t ALTER a DROP DEFAULT, LOCK=EXCLUSIVE", packet_length=50, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #21 0x000055eedd0950ce in do_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:1381
      #22 0x000055eedd41d21b in do_handle_one_connection (connect=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1336
      #23 0x000055eedd41cade in handle_one_connection (arg=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x000055eede7bb0c8 in pfs_spawn_thread (arg=0x616000009ff0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #25 0x00007fab3aa57609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00007fab3a633293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Non-ASAN builds crash sporadically with a very similar stack trace.
      Reproducible on 10.2, 10.3. Couldn't reproduce on 10.4.
      The test passes if it's run with MyISAM instead of Aria.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.