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

Assertion `block_size <= 0xFFFFFFFFL' or `block_size <= 0xFFFFFFFFUL' failed in calculate_block_sizes

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.1(EOL), 11.2(EOL), 11.4, 11.5(EOL), 11.6(EOL)
    • 10.11, 11.4
    • Server

    Description

      Somewhat similar to MDEV-26459, however this bug reproduces in 10.11+ only.

      SET max_heap_table_size=1125899906842624;
      SET use_stat_tables=preferably;
      CREATE TABLE t (b INT);
      ANALYZE TABLE t;
      

      Leads to:

      11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug)

      mariadbd: /test/11.2_dbg/mysys/my_alloc.c:104: calculate_block_sizes: Assertion `block_size <= 0xFFFFFFFFL' failed.
      

      11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug)

      Core was generated by `/test/MD200724-mariadb-11.2.5-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      warning: 44	./nptl/pthread_kill.c: No such file or directory
      [Current thread is 1 (LWP 1720368)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000015018844526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00001501884288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000015018842881b in __assert_fail_base (fmt=0x1501885d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5588adbea1cd "block_size <= 0xFFFFFFFFL", file=file@entry=0x5588adb77990 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x5588add57bc0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:94
      #6  0x000015018843b507 in __assert_fail (assertion=assertion@entry=0x5588adbea1cd "block_size <= 0xFFFFFFFFL", file=file@entry=0x5588adb77990 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x5588add57bc0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:103
      #7  0x00005588ad7c38ec in calculate_block_sizes (mem_root=mem_root@entry=0x1501280148b0, block_size=70368744177648, pre_alloc_size=pre_alloc_size@entry=0x150187f1c2e8)at /test/11.2_dbg/mysys/my_alloc.c:104
      #8  0x00005588ad7c3963 in init_alloc_root (key=0, mem_root=mem_root@entry=0x1501280148b0, block_size=<optimized out>, pre_alloc_size=<optimized out>, pre_alloc_size@entry=0, my_flags=my_flags@entry=65536) at /test/11.2_dbg/mysys/my_alloc.c:163
      #9  0x00005588ad7d8e29 in init_tree (tree=0x150128014678, default_alloc_size=<optimized out>, memory_limit=<optimized out>, size=<optimized out>, compare=<optimized out>, free_element=<optimized out>, custom_arg=0x150128026d18, my_flags=65536)at /test/11.2_dbg/mysys/tree.c:131
      #10 0x00005588ace18f14 in Unique::Unique (this=this@entry=0x1501280144c0, comp_func=<optimized out>, comp_func_fixed_arg=comp_func_fixed_arg@entry=0x150128026d18, size_arg=<optimized out>, max_in_memory_size_arg=max_in_memory_size_arg@entry=1125899906842624, min_dupl_count_arg=min_dupl_count_arg@entry=1)at /test/11.2_dbg/sql/uniques.cc:93
      #11 0x00005588acd95162 in Count_distinct_field::Count_distinct_field (max_heap_table_size=1125899906842624, field=0x150128026d18, this=0x150128014490) at /test/11.2_dbg/sql/sql_statistics.cc:1793
      #12 Column_statistics_collected::init (table_field=0x150128026d18, thd=0x150128000d58, this=0x150128014158)at /test/11.2_dbg/sql/sql_statistics.cc:2452
      #13 collect_statistics_for_table (thd=thd@entry=0x150128000d58, table=table@entry=0x150128026898)at /test/11.2_dbg/sql/sql_statistics.cc:2787
      #14 0x00005588ace5454d in mysql_admin_table (thd=thd@entry=0x150128000d58, tables=tables@entry=0x1501280136f8, check_opt=check_opt@entry=0x1501280065d0, operator_name=operator_name@entry=0x5588ae273ff0 <msg_analyze>, lock_type=lock_type@entry=TL_READ_NO_INSERT, org_open_for_modify=org_open_for_modify@entry=true, repair_table_use_frm=<optimized out>, extra_open_options=<optimized out>, prepare_func=<optimized out>, operator_func=<optimized out>, view_operator_func=<optimized out>, is_cmd_replicated=<optimized out>)at /test/11.2_dbg/sql/sql_admin.cc:1066
      #15 0x00005588ace56321 in Sql_cmd_analyze_table::execute (this=<optimized out>, thd=0x150128000d58)at /test/11.2_dbg/sql/sql_admin.cc:1562
      #16 0x00005588accd4db3 in mysql_execute_command (thd=thd@entry=0x150128000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:5876
      #17 0x00005588accd6753 in mysql_parse (thd=thd@entry=0x150128000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150187f1d290)at /test/11.2_dbg/sql/sql_parse.cc:7920
      #18 0x00005588accd8ada in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150128000d58, packet=packet@entry=0x15012800b309 "", packet_length=packet_length@entry=15, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:247
      #19 0x00005588accdadff in do_command (thd=0x150128000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407
      #20 0x00005588ace41e61 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5588af782cd8, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439
      #21 0x00005588ace42156 in handle_one_connection (arg=arg@entry=0x5588af782cd8)at /test/11.2_dbg/sql/sql_connect.cc:1341
      #22 0x00005588ad293192 in pfs_spawn_thread (arg=0x5588af751e28)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201
      #23 0x000015018849ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #24 0x0000150188529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Or, with 0xFFFFFFFFUL instead of 0xFFFFFFFFL in 11.5+:

      11.5.2 2f4b0ba328420980c23562da20ab0caa9d69b845 (Debug)

      mariadbd: /test/11.5_dbg/mysys/my_alloc.c:104: calculate_block_sizes: Assertion `block_size <= 0xFFFFFFFFUL' failed.
      

      11.5.2 2f4b0ba328420980c23562da20ab0caa9d69b845 (Debug)

      Core was generated by `/test/MD200724-mariadb-11.5.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      warning: 44	./nptl/pthread_kill.c: No such file or directory
      [Current thread is 1 (LWP 1720751)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000151ea244526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000151ea24288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000151ea242881b in __assert_fail_base (fmt=0x151ea25d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55a2aa7c2dda "block_size <= 0xFFFFFFFFUL", file=file@entry=0x55a2aa7504a8 "/test/11.5_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55a2aa9330e0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:94
      #6  0x0000151ea243b507 in __assert_fail (assertion=assertion@entry=0x55a2aa7c2dda "block_size <= 0xFFFFFFFFUL", file=file@entry=0x55a2aa7504a8 "/test/11.5_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55a2aa9330e0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:103
      #7  0x000055a2aa38ed7c in calculate_block_sizes (mem_root=mem_root@entry=0x151e4001bc40, block_size=70368744177648, pre_alloc_size=pre_alloc_size@entry=0x151ea0b67218)at /test/11.5_dbg/mysys/my_alloc.c:104
      #8  0x000055a2aa38edf3 in init_alloc_root (key=0, mem_root=mem_root@entry=0x151e4001bc40, block_size=<optimized out>, pre_alloc_size=<optimized out>, pre_alloc_size@entry=0, my_flags=my_flags@entry=65536) at /test/11.5_dbg/mysys/my_alloc.c:163
      #9  0x000055a2aa3a39dd in init_tree (tree=0x151e4001ba08, default_alloc_size=<optimized out>, memory_limit=<optimized out>, size=<optimized out>, compare=<optimized out>, free_element=<optimized out>, custom_arg=0x151e4002a1c8, my_flags=65536)at /test/11.5_dbg/mysys/tree.c:131
      #10 0x000055a2a99d172e in Unique::Unique (this=this@entry=0x151e4001b840, comp_func=<optimized out>, comp_func_fixed_arg=comp_func_fixed_arg@entry=0x151e4002a1c8, size_arg=<optimized out>, max_in_memory_size_arg=max_in_memory_size_arg@entry=1125899906842624, min_dupl_count_arg=min_dupl_count_arg@entry=1)at /test/11.5_dbg/sql/uniques.cc:93
      #11 0x000055a2a994b97e in Count_distinct_field::Count_distinct_field (max_heap_table_size=1125899906842624, field=0x151e4002a1c8, this=0x151e4001b810) at /test/11.5_dbg/sql/sql_statistics.cc:1796
      #12 Column_statistics_collected::init (table_field=0x151e4002a1c8, thd=0x151e40000d58, this=0x151e4001b4d8)at /test/11.5_dbg/sql/sql_statistics.cc:2455
      #13 collect_statistics_for_table (thd=thd@entry=0x151e40000d58, table=table@entry=0x151e40029d48)at /test/11.5_dbg/sql/sql_statistics.cc:2790
      #14 0x000055a2a9a0ea88 in mysql_admin_table (thd=thd@entry=0x151e40000d58, tables=tables@entry=0x151e4001aa78, check_opt=check_opt@entry=0x151e40006578, operator_name=operator_name@entry=0x55a2aae53990 <msg_analyze>, lock_type=lock_type@entry=TL_READ_NO_INSERT, org_open_for_modify=org_open_for_modify@entry=true, no_errors_from_open=<optimized out>, extra_open_options=<optimized out>, prepare_func=<optimized out>, operator_func=<optimized out>, view_operator_func=<optimized out>, is_cmd_replicated=<optimized out>)at /test/11.5_dbg/sql/sql_admin.cc:1088
      #15 0x000055a2a9a10a57 in Sql_cmd_analyze_table::execute (this=<optimized out>, thd=0x151e40000d58)at /test/11.5_dbg/sql/sql_admin.cc:1615
      #16 0x000055a2a9886749 in mysql_execute_command (thd=thd@entry=0x151e40000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.5_dbg/sql/sql_parse.cc:5842
      #17 0x000055a2a9887945 in mysql_parse (thd=thd@entry=0x151e40000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151ea0b68290)at /test/11.5_dbg/sql/sql_parse.cc:7867
      #18 0x000055a2a9889ccc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151e40000d58, packet=packet@entry=0x151e4000b329 "", packet_length=packet_length@entry=15, blocking=blocking@entry=true)at /test/11.5_dbg/sql/sql_class.h:255
      #19 0x000055a2a988c0f4 in do_command (thd=0x151e40000d58, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1405
      #20 0x000055a2a99fbaed in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a2adb266b8, put_in_cache=put_in_cache@entry=true)at /test/11.5_dbg/sql/sql_connect.cc:1447
      #21 0x000055a2a99fbde2 in handle_one_connection (arg=arg@entry=0x55a2adb266b8)at /test/11.5_dbg/sql/sql_connect.cc:1349
      #22 0x000055a2a9e5ae7e in pfs_spawn_thread (arg=0x55a2ada765f8)at /test/11.5_dbg/storage/perfschema/pfs.cc:2201
      #23 0x0000151ea249ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #24 0x0000151ea2529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug confirmed present in:
      MariaDB: 10.11.9 (dbg), 11.1.6 (dbg), 11.2.5 (dbg), 11.4.3 (dbg), 11.5.2 (dbg), 11.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.26 (dbg), 10.5.26 (opt), 10.6.19 (dbg), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (opt), 11.2.5 (opt), 11.4.3 (opt), 11.5.2 (opt), 11.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt)

      Attachments

        Issue Links

          Activity

            Slightly different stack with

            SET SESSION bulk_insert_buffer_size=100000000000000;
            CREATE TABLE t (c INT, KEY(c)) ENGINE=MyISAM;
            INSERT INTO t SELECT 0;
            INSERT INTO t SELECT 0;
            

            Leads to

            11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

            mariadbd: /test/11.2_dbg/mysys/my_alloc.c:104: calculate_block_sizes: Assertion `block_size <= 0xFFFFFFFFL' failed.
            

            11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

            Core was generated by `/test/MD130824-mariadb-11.2.6-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
            Program terminated with signal SIGABRT, Aborted.
            Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
             
            warning: 44	./nptl/pthread_kill.c: No such file or directory
            [Current thread is 1 (LWP 2798535)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3  0x0000149fc2e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4  0x0000149fc2e288ff in __GI_abort () at ./stdlib/abort.c:79
            #5  0x0000149fc2e2881b in __assert_fail_base (fmt=0x149fc2fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55aaaeba2743 "block_size <= 0xFFFFFFFFL", file=file@entry=0x55aaaeb2fc10 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55aaaed0fbe0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:94
            #6  0x0000149fc2e3b507 in __assert_fail (assertion=assertion@entry=0x55aaaeba2743 "block_size <= 0xFFFFFFFFL", file=file@entry=0x55aaaeb2fc10 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55aaaed0fbe0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:103
            #7  0x000055aaae7799f9 in calculate_block_sizes (mem_root=mem_root@entry=0x55aab0821ee0, block_size=1598837211136, pre_alloc_size=pre_alloc_size@entry=0x149fc0767848)at /test/11.2_dbg/mysys/my_alloc.c:104
            #8  0x000055aaae779a70 in init_alloc_root (key=0, mem_root=mem_root@entry=0x55aab0821ee0, block_size=<optimized out>, pre_alloc_size=<optimized out>, pre_alloc_size@entry=0, my_flags=my_flags@entry=0) at /test/11.2_dbg/mysys/my_alloc.c:163
            #9  0x000055aaae78ef44 in init_tree (tree=0x55aab0821ca8, default_alloc_size=<optimized out>, memory_limit=<optimized out>, size=size@entry=0, compare=compare@entry=0x55aaae75338d <keys_compare>, free_element=free_element@entry=0x55aaae7544d9 <keys_free>, custom_arg=0x55aab0821f40, my_flags=0) at /test/11.2_dbg/mysys/tree.c:131
            #10 0x000055aaae7548a8 in mi_init_bulk_insert (info=0x149f64023a78, cache_size=145348837209, rows=<optimized out>)at /test/11.2_dbg/storage/myisam/mi_write.c:1020
            #11 0x000055aaae7234e1 in ha_myisam::start_bulk_insert (this=0x149f64022990, rows=0, flags=<optimized out>)at /test/11.2_dbg/storage/myisam/ha_myisam.cc:1839
            #12 0x000055aaadc3c694 in handler::ha_start_bulk_insert (flags=0, rows=0, this=<optimized out>) at /test/11.2_dbg/sql/handler.h:3584
            #13 select_insert::prepare (this=0x149f64014c30, values=<optimized out>, u=<optimized out>) at /test/11.2_dbg/sql/sql_insert.cc:4150
            #14 0x000055aaadcfe5b0 in JOIN::prepare (this=this@entry=0x149f64014cf0, tables_init=tables_init@entry=0x0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>)at /test/11.2_dbg/sql/sql_select.cc:1852
            #15 0x000055aaadd15a22 in mysql_select (thd=thd@entry=0x149f64000d58, tables=0x0, fields=@0x149f640140e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149f64014378, last = 0x149f64014378, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=37385559870208, result=0x149f64014c30, unit=0x149f640052a8, select_lex=0x149f64013e28) at /test/11.2_dbg/sql/sql_select.cc:5316
            #16 0x000055aaadd15c4c in handle_select (thd=thd@entry=0x149f64000d58, lex=lex@entry=0x149f640051c8, result=result@entry=0x149f64014c30, setup_tables_done_option=setup_tables_done_option@entry=35184372088832)at /test/11.2_dbg/sql/sql_select.cc:628
            #17 0x000055aaadc82a1b in mysql_execute_command (thd=thd@entry=0x149f64000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:4664
            #18 0x000055aaadc87423 in mysql_parse (thd=thd@entry=0x149f64000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149fc0768290)at /test/11.2_dbg/sql/sql_parse.cc:7922
            #19 0x000055aaadc897aa in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149f64000d58, packet=packet@entry=0x149f6400b309 "INSERT INTO t SELECT 0", packet_length=packet_length@entry=22, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:248
            #20 0x000055aaadc8bacf in do_command (thd=0x149f64000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407
            #21 0x000055aaaddf2d1d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55aab0852b58, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439
            #22 0x000055aaaddf3012 in handle_one_connection (arg=arg@entry=0x55aab0852b58)at /test/11.2_dbg/sql/sql_connect.cc:1341
            #23 0x000055aaae2485c8 in pfs_spawn_thread (arg=0x55aab0821ca8)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201
            #24 0x0000149fc2e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
            #25 0x0000149fc2f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
            

            Also, another oddity is that if the testcase is instead:

            SET SESSION bulk_insert_buffer_size=100000000000000;
            CREATE TABLE t (c INT PRIMARY KEY) ENGINE=MyISAM;
            INSERT INTO t SELECT 0;
            INSERT INTO t SELECT 0;
            

            i.e. PRIMARY KEY instead, the testcase does not crash:

            11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

            11.2.6-dbg>INSERT INTO t SELECT 0;
            ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'
            

            10.11+ only. Two assertions/stacks seen accross versions:

            block_size <= 0xFFFFFFFFL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|mi_init_bulk_insert
            block_size <= 0xFFFFFFFFUL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|mi_init_bulk_insert
            

            Roel Roel Van de Paar added a comment - Slightly different stack with SET SESSION bulk_insert_buffer_size=100000000000000; CREATE TABLE t (c INT , KEY (c)) ENGINE=MyISAM; INSERT INTO t SELECT 0; INSERT INTO t SELECT 0; Leads to 11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug) mariadbd: /test/11.2_dbg/mysys/my_alloc.c:104: calculate_block_sizes: Assertion `block_size <= 0xFFFFFFFFL' failed. 11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug) Core was generated by `/test/MD130824-mariadb-11.2.6-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'. Program terminated with signal SIGABRT, Aborted. Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44   warning: 44 ./nptl/pthread_kill.c: No such file or directory [Current thread is 1 (LWP 2798535)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89 #3 0x0000149fc2e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #4 0x0000149fc2e288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x0000149fc2e2881b in __assert_fail_base (fmt=0x149fc2fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55aaaeba2743 "block_size <= 0xFFFFFFFFL", file=file@entry=0x55aaaeb2fc10 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55aaaed0fbe0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:94 #6 0x0000149fc2e3b507 in __assert_fail (assertion=assertion@entry=0x55aaaeba2743 "block_size <= 0xFFFFFFFFL", file=file@entry=0x55aaaeb2fc10 "/test/11.2_dbg/mysys/my_alloc.c", line=line@entry=104, function=function@entry=0x55aaaed0fbe0 <__PRETTY_FUNCTION__.3> "calculate_block_sizes") at ./assert/assert.c:103 #7 0x000055aaae7799f9 in calculate_block_sizes (mem_root=mem_root@entry=0x55aab0821ee0, block_size=1598837211136, pre_alloc_size=pre_alloc_size@entry=0x149fc0767848)at /test/11.2_dbg/mysys/my_alloc.c:104 #8 0x000055aaae779a70 in init_alloc_root (key=0, mem_root=mem_root@entry=0x55aab0821ee0, block_size=<optimized out>, pre_alloc_size=<optimized out>, pre_alloc_size@entry=0, my_flags=my_flags@entry=0) at /test/11.2_dbg/mysys/my_alloc.c:163 #9 0x000055aaae78ef44 in init_tree (tree=0x55aab0821ca8, default_alloc_size=<optimized out>, memory_limit=<optimized out>, size=size@entry=0, compare=compare@entry=0x55aaae75338d <keys_compare>, free_element=free_element@entry=0x55aaae7544d9 <keys_free>, custom_arg=0x55aab0821f40, my_flags=0) at /test/11.2_dbg/mysys/tree.c:131 #10 0x000055aaae7548a8 in mi_init_bulk_insert (info=0x149f64023a78, cache_size=145348837209, rows=<optimized out>)at /test/11.2_dbg/storage/myisam/mi_write.c:1020 #11 0x000055aaae7234e1 in ha_myisam::start_bulk_insert (this=0x149f64022990, rows=0, flags=<optimized out>)at /test/11.2_dbg/storage/myisam/ha_myisam.cc:1839 #12 0x000055aaadc3c694 in handler::ha_start_bulk_insert (flags=0, rows=0, this=<optimized out>) at /test/11.2_dbg/sql/handler.h:3584 #13 select_insert::prepare (this=0x149f64014c30, values=<optimized out>, u=<optimized out>) at /test/11.2_dbg/sql/sql_insert.cc:4150 #14 0x000055aaadcfe5b0 in JOIN::prepare (this=this@entry=0x149f64014cf0, tables_init=tables_init@entry=0x0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>)at /test/11.2_dbg/sql/sql_select.cc:1852 #15 0x000055aaadd15a22 in mysql_select (thd=thd@entry=0x149f64000d58, tables=0x0, fields=@0x149f640140e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149f64014378, last = 0x149f64014378, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=37385559870208, result=0x149f64014c30, unit=0x149f640052a8, select_lex=0x149f64013e28) at /test/11.2_dbg/sql/sql_select.cc:5316 #16 0x000055aaadd15c4c in handle_select (thd=thd@entry=0x149f64000d58, lex=lex@entry=0x149f640051c8, result=result@entry=0x149f64014c30, setup_tables_done_option=setup_tables_done_option@entry=35184372088832)at /test/11.2_dbg/sql/sql_select.cc:628 #17 0x000055aaadc82a1b in mysql_execute_command (thd=thd@entry=0x149f64000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:4664 #18 0x000055aaadc87423 in mysql_parse (thd=thd@entry=0x149f64000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149fc0768290)at /test/11.2_dbg/sql/sql_parse.cc:7922 #19 0x000055aaadc897aa in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149f64000d58, packet=packet@entry=0x149f6400b309 "INSERT INTO t SELECT 0", packet_length=packet_length@entry=22, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:248 #20 0x000055aaadc8bacf in do_command (thd=0x149f64000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407 #21 0x000055aaaddf2d1d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55aab0852b58, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439 #22 0x000055aaaddf3012 in handle_one_connection (arg=arg@entry=0x55aab0852b58)at /test/11.2_dbg/sql/sql_connect.cc:1341 #23 0x000055aaae2485c8 in pfs_spawn_thread (arg=0x55aab0821ca8)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201 #24 0x0000149fc2e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447 #25 0x0000149fc2f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 Also, another oddity is that if the testcase is instead: SET SESSION bulk_insert_buffer_size=100000000000000; CREATE TABLE t (c INT PRIMARY KEY ) ENGINE=MyISAM; INSERT INTO t SELECT 0; INSERT INTO t SELECT 0; i.e. PRIMARY KEY instead, the testcase does not crash: 11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug) 11.2.6-dbg>INSERT INTO t SELECT 0; ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY' 10.11+ only. Two assertions/stacks seen accross versions: block_size <= 0xFFFFFFFFL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|mi_init_bulk_insert block_size <= 0xFFFFFFFFUL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|mi_init_bulk_insert
            Roel Roel Van de Paar added a comment - - edited

            SET SESSION bulk_insert_buffer_size=100000000000000;
            CREATE TABLE t (a INT,INDEX (a)) ENGINE=Aria;
            INSERT INTO t VALUES (1);
            INSERT INTO t SELECT 0 QUERY;
            

            block_size <= 0xFFFFFFFFL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|maria_init_bulk_insert
            block_size <= 0xFFFFFFFFUL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|maria_init_bulk_insert
            

            Roel Roel Van de Paar added a comment - - edited SET SESSION bulk_insert_buffer_size=100000000000000; CREATE TABLE t (a INT , INDEX (a)) ENGINE=Aria; INSERT INTO t VALUES (1); INSERT INTO t SELECT 0 QUERY; block_size <= 0xFFFFFFFFL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|maria_init_bulk_insert block_size <= 0xFFFFFFFFUL|SIGABRT|calculate_block_sizes|init_alloc_root|init_tree|maria_init_bulk_insert

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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