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

SIGSEGV in mi_mmap_pread | _mi_read_static_record | mi_rprev | ha_myisam::index_prev

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8
    • 10.11, 11.4, 11.8
    • None
    • None
    • Can result in hang or crash
    • Q3/2026 Server Maintenance

    Description

      --source include/have_partition.inc
       
      SET @@GLOBAL.myisam_use_mmap=1;
      CREATE TABLE t1 (c1 INT KEY,c2 INT) ENGINE=MYISAM PARTITION BY RANGE(c1) (PARTITION p1 VALUES LESS THAN(100));
      INSERT INTO t1 VALUES (0,0);
      OPTIMIZE TABLE t1;
      HANDLER t1 OPEN;
      HANDLER t1 READ `PRIMARY` LAST;
      HANDLER t1 READ `PRIMARY`=(1);
      HANDLER t1 READ `PRIMARY` PREV;
      

      Leads to:

      CS 10.11.18 6f1204ad849b72a997fd34ce44a522d76716c24d (Debug, Clang 18.1.3-11) Build 22/05/2026

      Core was generated by `/test/MD220526-mariadb-10.11.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --l'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __memcpy_evex_unaligned_erms ()at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:366
       
      [Current thread is 1 (LWP 3079067)]
      (gdb) bt
      #0  __memcpy_evex_unaligned_erms ()at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:366
      #1  0x00005f025fb137a6 in mi_mmap_pread (info=0x759c6402e978, Buffer=0xa5a5a5a5a5a5a5af <error: Cannot access memory at address 0xa5a5a5a5a5a5a5af>, Count=9, offset=0, MyFlags=4)at /test/10.11_dbg/storage/myisam/mi_dynrec.c:183
      #2  0x00005f025fb33652 in _mi_read_static_record (info=0x759c6402e978, pos=0, record=0xa5a5a5a5a5a5a5af <error: Cannot access memory at address 0xa5a5a5a5a5a5a5af>) at /test/10.11_dbg/storage/myisam/mi_statrec.c:178
      #3  0x00005f025fb2cee4 in mi_rprev (info=0x759c6402e978, buf=0xa5a5a5a5a5a5a5af <error: Cannot access memory at address 0xa5a5a5a5a5a5a5af>, inx=0) at /test/10.11_dbg/storage/myisam/mi_rprev.c:106
      #4  0x00005f025faf8d7f in ha_myisam::index_prev (this=0x759c6402ca20, buf=0xa5a5a5a5a5a5a5af <error: Cannot access memory at address 0xa5a5a5a5a5a5a5af>) at /test/10.11_dbg/storage/myisam/ha_myisam.cc:2027
      #5  0x00005f025f26d183 in handler::ha_index_prev (this=0x759c6402ca20, buf=0xa5a5a5a5a5a5a5af <error: Cannot access memory at address 0xa5a5a5a5a5a5a5af>) at /test/10.11_dbg/sql/handler.cc:3744
      #6  0x00005f025f5cfb19 in ha_partition::handle_ordered_prev (this=0x759c6402c178, buf=0x759c6402da00 "\375H")at /test/10.11_dbg/sql/ha_partition.cc:8486
      #7  0x00005f025f5cfa8c in ha_partition::index_prev (this=0x759c6402c178, buf=0x759c6402da00 "\375H") at /test/10.11_dbg/sql/ha_partition.cc:6330
      #8  0x00005f025f26d183 in handler::ha_index_prev (this=0x759c6402c178, buf=0x759c6402da00 "\375H") at /test/10.11_dbg/sql/handler.cc:3744
      #9  0x00005f025ee25b09 in mysql_ha_read (thd=0x759c64000d58, tables=0x759c640135d8, mode=RPREV, keyname=0x759c64013d00 "PRIMARY", key_expr=0x759c64013d08, ha_rkey_mode=HA_READ_KEY_EXACT, cond=0x0, select_limit_cnt=1, offset_limit_cnt=0)at /test/10.11_dbg/sql/sql_handler.cc:937
      #10 0x00005f025ee8ccbc in mysql_execute_command (thd=0x759c64000d58, is_called_from_prepared_stmt=false)at /test/10.11_dbg/sql/sql_parse.cc:5823
      #11 0x00005f025ee7c404 in mysql_parse (thd=0x759c64000d58, rawbuf=0x759c64013480 "HANDLER t1 READ `PRIMARY` PREV", length=30, parser_state=0x7db38cc37a20) at /test/10.11_dbg/sql/sql_parse.cc:8221
      #12 0x00005f025ee79859 in dispatch_command (command=COM_QUERY, thd=0x759c64000d58, packet=0x759c6400af09 "", packet_length=30, blocking=true) at /test/10.11_dbg/sql/sql_parse.cc:1924
      #13 0x00005f025ee7cfb3 in do_command (thd=0x759c64000d58, blocking=true)at /test/10.11_dbg/sql/sql_parse.cc:1434
      #14 0x00005f025f05b889 in do_handle_one_connection (connect=0x5f026ede72f8, put_in_cache=true) at /test/10.11_dbg/sql/sql_connect.cc:1475
      #15 0x00005f025f05b622 in handle_one_connection (arg=0x5f026ede7288)at /test/10.11_dbg/sql/sql_connect.cc:1387
      #16 0x00007db39829caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #17 0x00007db398329c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.11  dbg  220526  6f1204ad849b72a997fd34ce44a522d76716c24d  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      CS  10.11  opt  220526  6f1204ad849b72a997fd34ce44a522d76716c24d  No bug found
      CS  11.4   dbg  220526  19c59f2c79637cc360cc6d6b219ed9131124500d  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      CS  11.4   opt  220526  19c59f2c79637cc360cc6d6b219ed9131124500d  No bug found
      CS  11.8   dbg  220526  b494164767979072713fdeccc175ce3b3f5b1983  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      CS  11.8   opt  220526  b494164767979072713fdeccc175ce3b3f5b1983  No bug found
      CS  12.3   dbg  220526  66b3c6784689fbb65110a5b21efcb815a8bcde24  No bug found
      CS  12.3   opt  220526  66b3c6784689fbb65110a5b21efcb815a8bcde24  No bug found
      CS  13.0   dbg  220526  c8e8d33309606e682c98675d594dbd23ebc2ddf6  No bug found
      CS  13.0   opt  220526  c8e8d33309606e682c98675d594dbd23ebc2ddf6  No bug found
      ES  10.6   dbg  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      ES  10.6   opt  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found
      ES  11.4   dbg  040825  a1c03ccd54b582e75506687ee19b273ca897f261  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      ES  11.4   opt  040825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found
      ES  11.8   dbg  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  SIGSEGV|mi_mmap_pread|_mi_read_static_record|mi_rprev|ha_myisam::index_prev
      ES  11.8   opt  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  No bug found
      

      Attachments

        Activity

          People

            monty Michael Widenius
            ramesh Ramesh Sivaraman
            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.