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

ASAN: global-buffer-overflow, Assertion `inited==RND' failed

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.3(EOL)
    • N/A
    • Versioned Tables
    • None

    Description

      git 10.3 commit 358ae4b46dd52b329154cf

      Version: '10.3.9-MariaDB-debug-log'  socket: '/home/alice/aliska/2/current1_4/mysql.sock'  port: 13060  Source distribution
      =================================================================
      ==1225==ERROR: AddressSanitizer: global-buffer-overflow on address 0x563e0f135774 at pc 0x7fa934309676 bp 0x7fa904d2ff20 sp 0x7fa904d2f6c8
      READ of size 38 at 0x563e0f135774 thread T33
          #0 0x7fa934309675 in memcmp (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x77675)
          #1 0x563e0d14feee in QUICK_GROUP_MIN_MAX_SELECT::add_range(SEL_ARG*) /home/alice/git/10.3/sql/opt_range.cc:13788
          #2 0x563e0d14e0ae in TRP_GROUP_MIN_MAX::make_quick(PARAM*, bool, st_mem_root*) /home/alice/git/10.3/sql/opt_range.cc:13536
          #3 0x563e0d10db28 in SQL_SELECT::test_quick_select(THD*, Bitmap<64u>, unsigned long long, unsigned long long, bool, bool, bool) /home/alice/git/10.3/sql/opt_range.cc:2680
          #4 0x563e0c7bbb89 in get_quick_record_count /home/alice/git/10.3/sql/sql_select.cc:4247
          #5 0x563e0c7c1578 in make_join_statistics /home/alice/git/10.3/sql/sql_select.cc:4877
          #6 0x563e0c7a5705 in JOIN::optimize_inner() /home/alice/git/10.3/sql/sql_select.cc:1871
          #7 0x563e0c7a18e1 in JOIN::optimize() /home/alice/git/10.3/sql/sql_select.cc:1446
          #8 0x563e0c7bb498 in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /home/alice/git/10.3/sql/sql_select.cc:4196
          #9 0x563e0c796fd2 in handle_select(THD*, LEX*, select_result*, unsigned long) /home/alice/git/10.3/sql/sql_select.cc:382
          #10 0x563e0c71cbc1 in execute_sqlcom_select /home/alice/git/10.3/sql/sql_parse.cc:6541
          #11 0x563e0c70b3d4 in mysql_execute_command(THD*) /home/alice/git/10.3/sql/sql_parse.cc:3764
          #12 0x563e0c7255ab in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/alice/git/10.3/sql/sql_parse.cc:8076
          #13 0x563e0c7001b6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/alice/git/10.3/sql/sql_parse.cc:1847
          #14 0x563e0c6fd34e in do_command(THD*) /home/alice/git/10.3/sql/sql_parse.cc:1392
          #15 0x563e0ca4aa7b in do_handle_one_connection(CONNECT*) /home/alice/git/10.3/sql/sql_connect.cc:1402
          #16 0x563e0ca4a458 in handle_one_connection /home/alice/git/10.3/sql/sql_connect.cc:1308
          #17 0x7fa93313e6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
          #18 0x7fa9325d341c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10741c)
       
      0x563e0f135774 is located 0 bytes to the right of global variable 'is_null_string' defined in '/home/alice/git/10.3/sql/opt_range.cc:139:14' (0x563e0f135760) of size 20
      SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 memcmp
      Shadow bytes around the buggy address:
        0x0ac841e1ea90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1ead0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      =>0x0ac841e1eae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[04]f9
        0x0ac841e1eaf0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0ac841e1eb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      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
        Heap right redzone:      fb
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack partial redzone:   f4
        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
      

      SELECT `col_varchar_key`,
             MIN(`col_varchar_nokey`)
      FROM `C`
      WHERE ((`col_varchar_key` <> '1975-11-25 16:08:50.006202')
             AND NOT (`col_varchar_nokey` = '2021-09-04 15:23:27.026063'))
        AND (NOT (`col_varchar_nokey` = '0000-00-00 00:00:00')
             AND `col_varchar_key` IN ('20321205133134.051183',
                                       '1980-11-18 20:07:33.050205',
                                       '0000-00-00 00:00:00',
                                       '0000-00-00 00:00:00'))
      GROUP BY `col_varchar_key` ;
      

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            it is probably duplicate of MDEV-16241

            Version: '10.3.9-MariaDB-debug'  
            mysqld: /m3-10.3/src/sql/handler.h:3068: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
            180726 13:12:11 [ERROR] mysqld got signal 6 ;
             
            stack_bottom = 0x7f90ec1bdd40 thread_stack 0x49000
            mysys/stacktrace.c:269(my_print_stacktrace)[0x55bd2f03a28f]
            sql/signal_handler.cc:168(handle_fatal_signal)[0x55bd2e7b43ba]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f90f12fb390]
            linux/raise.c:54(__GI_raise)[0x7f90f06b4428]
            stdlib/abort.c:91(__GI_abort)[0x7f90f06b602a]
            assert/assert.c:92(__assert_fail_base)[0x7f90f06acbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f90f06acc82]
            sql/handler.h:3069(handler::ha_rnd_end())[0x55bd2e42f5dc]
            sql/multi_range_read.cc:1003(DsMrr_impl::dsmrr_init(handler*, st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2e677259]
            handler/ha_innodb.cc:20554(ha_innobase::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2eb1e288]
            sql/ha_partition.cc:6440(ha_partition::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2effa022]
            sql/opt_range.cc:11412(QUICK_RANGE_SELECT::reset())[0x55bd2e92b2a5]
            sql/opt_range.cc:1649(QUICK_ROR_INTERSECT_SELECT::reset())[0x55bd2e914026]
            sql/sql_select.cc:20188(join_init_read_record(st_join_table*))[0x55bd2e53e299]
            sql/sql_select.cc:19268(sub_select(JOIN*, st_join_table*, bool))[0x55bd2e53c07b]
            sql/sql_select.cc:18811(do_select(JOIN*, Procedure*))[0x55bd2e53b619]
            sql/sql_select.cc:4021(JOIN::exec_inner())[0x55bd2e514a4d]
            sql/sql_select.cc:3816(JOIN::exec())[0x55bd2e513ec0]
            sql/sql_select.cc:4222(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55bd2e515127]
            sql/sql_select.cc:382(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55bd2e50724a]
            sql/sql_parse.cc:6542(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55bd2e4d1bcc]
            sql/sql_parse.cc:3765(mysql_execute_command(THD*))[0x55bd2e4c8025]
            sql/sql_parse.cc:8073(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55bd2e4d5aac]
            sql/sql_parse.cc:1849(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55bd2e4c2afa]
            sql/sql_parse.cc:1392(do_command(THD*))[0x55bd2e4c1517]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55bd2e62743b]
            sql/sql_connect.cc:1309(handle_one_connection)[0x55bd2e62718c]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f90f12f16ba]
            x86_64/clone.S:111(clone)[0x7f90f078641d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f906c0137a8): SELECT `col_varchar_nokey`, MIN( `col_varchar_key` ) FROM `E` WHERE ( ( `col_varchar_nokey` = '0000-00-00 00:00:00' ) AND ( `col_int_key` = '1997-03-13 23:51:54.028533' ) ) AND ( `pk` IS NULL AND ( `col_varchar_key` <= '0000-00-00 00:00:00' ) ) AND ( `col_int_key` IN ( '0000-00-00 00:00:00', '2001-03-26 19:19:48.021167', '0000-00-00 00:00:00', '2034-11-27 17:52:29.057269', '19931128230630.036234', '20330111042408.009362' ) AND `col_varchar_nokey` BETWEEN '19881109140349.000101' AND '19901201172248.012554' ) OR ( `col_varchar_nokey` IS NULL AND `col_varchar_key` IS NULL ) AND ( ( `col_int_key` = '0000-00-00 00:00:00' ) AND `col_int_key` IN ( '20010904220028.040114', '19770914143220.005767', '0000-00-00 00:00:00', '1974-04-14 00:22:07.038371', '2005-09-15 05:21:33.023572', '2012-11-26 09:57:35.030519' ) ) GROUP BY `col_int_key`
            Connection ID (thread ID): 9
            Status: NOT_KILLED
            

            alice Alice Sherepa added a comment - it is probably duplicate of MDEV-16241 Version: '10.3.9-MariaDB-debug' mysqld: /m3-10.3/src/sql/handler.h:3068: int handler::ha_rnd_end(): Assertion `inited==RND' failed. 180726 13:12:11 [ERROR] mysqld got signal 6 ;   stack_bottom = 0x7f90ec1bdd40 thread_stack 0x49000 mysys/stacktrace.c:269(my_print_stacktrace)[0x55bd2f03a28f] sql/signal_handler.cc:168(handle_fatal_signal)[0x55bd2e7b43ba] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f90f12fb390] linux/raise.c:54(__GI_raise)[0x7f90f06b4428] stdlib/abort.c:91(__GI_abort)[0x7f90f06b602a] assert/assert.c:92(__assert_fail_base)[0x7f90f06acbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f90f06acc82] sql/handler.h:3069(handler::ha_rnd_end())[0x55bd2e42f5dc] sql/multi_range_read.cc:1003(DsMrr_impl::dsmrr_init(handler*, st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2e677259] handler/ha_innodb.cc:20554(ha_innobase::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2eb1e288] sql/ha_partition.cc:6440(ha_partition::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*))[0x55bd2effa022] sql/opt_range.cc:11412(QUICK_RANGE_SELECT::reset())[0x55bd2e92b2a5] sql/opt_range.cc:1649(QUICK_ROR_INTERSECT_SELECT::reset())[0x55bd2e914026] sql/sql_select.cc:20188(join_init_read_record(st_join_table*))[0x55bd2e53e299] sql/sql_select.cc:19268(sub_select(JOIN*, st_join_table*, bool))[0x55bd2e53c07b] sql/sql_select.cc:18811(do_select(JOIN*, Procedure*))[0x55bd2e53b619] sql/sql_select.cc:4021(JOIN::exec_inner())[0x55bd2e514a4d] sql/sql_select.cc:3816(JOIN::exec())[0x55bd2e513ec0] sql/sql_select.cc:4222(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55bd2e515127] sql/sql_select.cc:382(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55bd2e50724a] sql/sql_parse.cc:6542(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55bd2e4d1bcc] sql/sql_parse.cc:3765(mysql_execute_command(THD*))[0x55bd2e4c8025] sql/sql_parse.cc:8073(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55bd2e4d5aac] sql/sql_parse.cc:1849(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55bd2e4c2afa] sql/sql_parse.cc:1392(do_command(THD*))[0x55bd2e4c1517] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55bd2e62743b] sql/sql_connect.cc:1309(handle_one_connection)[0x55bd2e62718c] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f90f12f16ba] x86_64/clone.S:111(clone)[0x7f90f078641d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f906c0137a8): SELECT `col_varchar_nokey`, MIN( `col_varchar_key` ) FROM `E` WHERE ( ( `col_varchar_nokey` = '0000-00-00 00:00:00' ) AND ( `col_int_key` = '1997-03-13 23:51:54.028533' ) ) AND ( `pk` IS NULL AND ( `col_varchar_key` <= '0000-00-00 00:00:00' ) ) AND ( `col_int_key` IN ( '0000-00-00 00:00:00', '2001-03-26 19:19:48.021167', '0000-00-00 00:00:00', '2034-11-27 17:52:29.057269', '19931128230630.036234', '20330111042408.009362' ) AND `col_varchar_nokey` BETWEEN '19881109140349.000101' AND '19901201172248.012554' ) OR ( `col_varchar_nokey` IS NULL AND `col_varchar_key` IS NULL ) AND ( ( `col_int_key` = '0000-00-00 00:00:00' ) AND `col_int_key` IN ( '20010904220028.040114', '19770914143220.005767', '0000-00-00 00:00:00', '1974-04-14 00:22:07.038371', '2005-09-15 05:21:33.023572', '2012-11-26 09:57:35.030519' ) ) GROUP BY `col_int_key` Connection ID (thread ID): 9 Status: NOT_KILLED

            People

              alice Alice Sherepa
              alice Alice Sherepa
              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.