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

Assertion `fd != -1' failed in my_seek on SELECT

    XMLWordPrintable

Details

    Description

      USE test;
      INSTALL SONAME 'ha_archive';
      CREATE TEMPORARY TABLE t2 (c1 INT UNSIGNED ZEROFILL) ENGINE=ARCHIVE;
      REPAIR NO_WRITE_TO_BINLOG TABLE t2 EXTENDED;
      SELECT * FROM t2 WHERE c1 < 1;
      

      Leads to:

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

      mysqld: /test/10.5_dbg/mysys/my_seek.c:58: my_seek: Assertion `fd != -1' failed.
      

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

      Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x1498ab44b700 (LWP 589399))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055b48e6fdb86 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:519
      #2  0x000055b48deb4d7b in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00001498a96e18b1 in __GI_abort () at abort.c:79
      #6  0x00001498a96d142a in __assert_fail_base (fmt=0x1498a9858a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55b48ea5db0f "fd != -1", file=file@entry=0x55b48ebe9fd0 "/test/10.5_dbg/mysys/my_seek.c", line=line@entry=58, function=function@entry=0x55b48ebea090 <__PRETTY_FUNCTION__.15464> "my_seek") at assert.c:92
      #7  0x00001498a96d14a2 in __GI___assert_fail (assertion=assertion@entry=0x55b48ea5db0f "fd != -1", file=file@entry=0x55b48ebe9fd0 "/test/10.5_dbg/mysys/my_seek.c", line=line@entry=58, function=function@entry=0x55b48ebea090 <__PRETTY_FUNCTION__.15464> "my_seek") at assert.c:101
      #8  0x000055b48e6fabcd in my_seek (fd=-1, pos=512, whence=whence@entry=0, MyFlags=MyFlags@entry=0) at /test/10.5_dbg/mysys/my_seek.c:58
      #9  0x00001498865dfefe in azrewind (s=s@entry=0x1498870eb5d8) at /test/10.5_dbg/storage/archive/azio.c:725
      #10 0x00001498865e21ee in ha_archive::read_data_header (this=this@entry=0x1498870eb0a0, file_to_read=file_to_read@entry=0x1498870eb5d8) at /test/10.5_dbg/storage/archive/ha_archive.cc:425
      #11 0x00001498865e27af in ha_archive::rnd_init (this=0x1498870eb0a0, scan=<optimized out>) at /test/10.5_dbg/storage/archive/ha_archive.cc:1177
      #12 0x000055b48debf66c in handler::ha_rnd_init (scan=true, this=0x1498870eb0a0) at /test/10.5_dbg/sql/handler.h:3377
      #13 handler::read_first_row (this=0x1498870eb0a0, buf=0x1498870539a8 "\377", primary_key=64) at /test/10.5_dbg/sql/handler.cc:3305
      #14 0x000055b48dc5963e in handler::ha_read_first_row (primary_key=<optimized out>, buf=<optimized out>, this=0x1498870eb0a0) at /test/10.5_dbg/sql/sql_class.h:6994
      #15 join_read_system (tab=tab@entry=0x149887076480) at /test/10.5_dbg/sql/sql_select.cc:21162
      #16 0x000055b48dc68f9b in join_read_const_table (thd=0x149887015088, tab=tab@entry=0x149887076480, pos=pos@entry=0x149887076a30) at /test/10.5_dbg/sql/sql_select.cc:21056
      #17 0x000055b48dc82c7e in make_join_statistics (keyuse_array=0x149887075e40, tables_list=@0x149887074380: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1498870760c8, last = 0x1498870760c8, elements = 1}, <No data fields>}, join=0x149887075b50) at /test/10.5_dbg/sql/sql_select.cc:5078
      #18 JOIN::optimize_inner (this=this@entry=0x149887075b50) at /test/10.5_dbg/sql/sql_select.cc:2242
      #19 0x000055b48dc84a6f in JOIN::optimize (this=this@entry=0x149887075b50) at /test/10.5_dbg/sql/sql_select.cc:1618
      #20 0x000055b48dc853fc in mysql_select (thd=thd@entry=0x149887015088, tables=<optimized out>, fields=@0x149887074290: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1498870746f0, last = 0x1498870746f0, elements = 1}, <No data fields>}, conds=0x149887075008, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x149887075b28, unit=0x1498870190a0, select_lex=0x149887074140) at /test/10.5_dbg/sql/sql_select.cc:4641
      #21 0x000055b48dc85778 in handle_select (thd=thd@entry=0x149887015088, lex=lex@entry=0x149887018fd8, result=result@entry=0x149887075b28, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #22 0x000055b48dc0dd72 in execute_sqlcom_select (thd=thd@entry=0x149887015088, all_tables=0x149887074738) at /test/10.5_dbg/sql/sql_parse.cc:6210
      #23 0x000055b48dc06e46 in mysql_execute_command (thd=thd@entry=0x149887015088) at /test/10.5_dbg/sql/sql_parse.cc:3932
      #24 0x000055b48dc13d4e in mysql_parse (thd=thd@entry=0x149887015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1498ab44a350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7994
      #25 0x000055b48dc0077e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149887015088, packet=packet@entry=0x149887067089 "SELECT * FROM t2 WHERE c1 < 1", packet_length=packet_length@entry=29, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1867
      #26 0x000055b48dbfef58 in do_command (thd=0x149887015088) at /test/10.5_dbg/sql/sql_parse.cc:1348
      #27 0x000055b48dd5bbc9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14988a4d0808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
      #28 0x000055b48dd5c2e5 in handle_one_connection (arg=arg@entry=0x14988a4d0808) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #29 0x000055b48e1c2572 in pfs_spawn_thread (arg=0x1498a8046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #30 0x00001498aa3c46db in start_thread (arg=0x1498ab44b700) at pthread_create.c:463
      #31 0x00001498a97c2a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.1.47 (dbg), 10.2.34 (dbg), 10.3.25 (dbg), 10.4.15 (dbg), 10.5.6 (dbg)
      MySQL: 5.5.62 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.47 (opt), 10.2.34 (opt), 10.3.25 (opt), 10.4.15 (opt), 10.5.6 (opt)
      MySQL: 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.