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

Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed & UBSAN: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'

    XMLWordPrintable

Details

    Description

      Same assert as MDEV-21406, but different testcase. Bugs may or may not be related. Test may be (lightly) sporadic. Test may require CLI based replay.

      SET SESSION sql_mode='NO_ZERO_DATE';
      SET SESSION sql_buffer_result=ON;
      SELECT CREATED INTO @c FROM information_schema.routines WHERE routine_schema='test' AND routine_name='a';
      

      Leads to:

      10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

      mysqld: /test/10.6_dbg/sql/compat56.cc:271: void TIME_from_longlong_datetime_packed(MYSQL_TIME*, longlong): Assertion `tmp != ((long long) 0x8000000000000000LL)' failed.
      

      10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

      Core was generated by `/test/MD010121-mariadb-10.6.0-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:56
      [Current thread is 1 (Thread 0x14ebb8551700 (LWP 928788))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x00005651456d90d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
      #2  0x0000565144e6dab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014ebce3cb859 in __GI_abort () at abort.c:79
      #6  0x000014ebce3cb729 in __assert_fail_base (fmt=0x14ebce561588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5651459a6718 "tmp != ((long long) 0x8", '0' <repeats 15 times>, "LL)", file=0x5651459a6508 "/test/10.6_dbg/sql/compat56.cc", line=271, function=<optimized out>) at assert.c:92
      #7  0x000014ebce3dcf36 in __GI___assert_fail (assertion=assertion@entry=0x5651459a6718 "tmp != ((long long) 0x8", '0' <repeats 15 times>, "LL)", file=file@entry=0x5651459a6508 "/test/10.6_dbg/sql/compat56.cc", line=line@entry=271, function=function@entry=0x5651459a66d8 "void TIME_from_longlong_datetime_packed(MYSQL_TIME*, longlong)") at assert.c:101
      #8  0x0000565144e327d5 in TIME_from_longlong_datetime_packed (ltime=ltime@entry=0x14ebb854f210, tmp=tmp@entry=-9223372036854775808) at /test/10.6_dbg/sql/compat56.cc:271
      #9  0x0000565144e427de in Field_datetimef::get_TIME (this=<optimized out>, ltime=0x14ebb854f210, pos=0x14eb88030224 "", fuzzydate={m_mode = date_mode_t::CONV_NONE}) at /test/10.6_dbg/sql/field.cc:7102
      #10 0x0000565144e62e69 in Field_datetimef::get_date (this=<optimized out>, ltime=<optimized out>, fuzzydate=<optimized out>) at /test/10.6_dbg/sql/field.h:3923
      #11 0x0000565144e5d4a8 in Field_temporal::save_in_field (this=0x14eb88020740, to=0x14eb88049550) at /test/10.6_dbg/sql/sql_basic_types.h:279
      #12 0x0000565144ce7d9f in Field::store_field (this=<optimized out>, from=<optimized out>) at /test/10.6_dbg/sql/field.h:907
      #13 0x0000565144e63665 in field_conv_incompatible (to=to@entry=0x14eb88049550, from=from@entry=0x14eb88020740) at /test/10.6_dbg/sql/field_conv.cc:850
      #14 0x0000565144e64c65 in field_conv (to=to@entry=0x14eb88049550, from=from@entry=0x14eb88020740) at /test/10.6_dbg/sql/field_conv.cc:861
      #15 0x0000565144c0178d in Create_tmp_table::finalize (this=this@entry=0x14ebb854f3c0, thd=thd@entry=0x14eb88000db8, table=table@entry=0x14eb88048870, param=param@entry=0x14eb88038618, do_not_open=do_not_open@entry=true, keep_row_order=keep_row_order@entry=false) at /test/10.6_dbg/sql/sql_select.cc:18795
      #16 0x0000565144c02442 in create_tmp_table (thd=0x14eb88000db8, param=0x14eb88038618, fields=@0x14eb88015a50: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14eb88012da8, last = 0x14eb88012da8, elements = 1}, <No data fields>}, group=group@entry=0x0, distinct=distinct@entry=false, save_sum_fields=save_sum_fields@entry=false, select_options=2684750592, rows_limit=18446744073709551615, table_alias=0x565145f689e0 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /test/10.6_dbg/sql/sql_select.cc:19169
      #17 0x0000565144c128f6 in JOIN::create_postjoin_aggr_table (this=this@entry=0x14eb88015728, tab=tab@entry=0x14eb88017688, table_fields=table_fields@entry=0x14eb88015a50, table_group=0x0, save_sum_fields=<optimized out>, distinct=distinct@entry=false, keep_row_order=false) at /test/10.6_dbg/sql/sql_select.cc:3748
      #18 0x0000565144c13cd9 in JOIN::make_aggr_tables_info (this=this@entry=0x14eb88015728) at /test/10.6_dbg/sql/sql_select.cc:3348
      #19 0x0000565144c27355 in JOIN::optimize_stage2 (this=this@entry=0x14eb88015728) at /test/10.6_dbg/sql/sql_select.cc:2992
      #20 0x0000565144c28e3b in JOIN::optimize_inner (this=this@entry=0x14eb88015728) at /test/10.6_dbg/sql/sql_select.cc:2277
      #21 0x0000565144c2906c in JOIN::optimize (this=this@entry=0x14eb88015728) at /test/10.6_dbg/sql/sql_select.cc:1627
      #22 0x0000565144c299ba in mysql_select (thd=thd@entry=0x14eb88000db8, tables=0x14eb88012ea0, fields=@0x14eb88012948: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14eb88012da8, last = 0x14eb88012da8, elements = 1}, <No data fields>}, conds=0x14eb88013df0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684750592, result=0x14eb88012db8, unit=0x14eb88004f80, select_lex=0x14eb880127f8) at /test/10.6_dbg/sql/sql_select.cc:4654
      #23 0x0000565144c29cd0 in handle_select (thd=thd@entry=0x14eb88000db8, lex=lex@entry=0x14eb88004eb8, result=result@entry=0x14eb88012db8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
      #24 0x0000565144b9c19d in execute_sqlcom_select (thd=thd@entry=0x14eb88000db8, all_tables=0x14eb88012ea0) at /test/10.6_dbg/sql/sql_parse.cc:6116
      #25 0x0000565144ba8c7c in mysql_execute_command (thd=thd@entry=0x14eb88000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820
      #26 0x0000565144b95072 in mysql_parse (thd=thd@entry=0x14eb88000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ebb85503d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
      #27 0x0000565144ba31ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14eb88000db8, packet=packet@entry=0x14eb88008d39 "SELECT CREATED INTO @c FROM information_schema.routines WHERE routine_schema='test' AND routine_name='a'", packet_length=packet_length@entry=104) at /test/10.6_dbg/sql/sql_class.h:1293
      #28 0x0000565144ba652d in do_command (thd=0x14eb88000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
      #29 0x0000565144d027fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x565148aeb458, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #30 0x0000565144d02f03 in handle_one_connection (arg=arg@entry=0x565148aeb458) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #31 0x00005651451b888f in pfs_spawn_thread (arg=0x565148a378b8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #32 0x000014ebce8d9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #33 0x000014ebce4c8293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.9 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt)

      Optimized 10.6 build output (and same result on 10.4 debug build):

      10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Optimized)

      10.6.0>show warnings;
      +---------+------+-----------------------------------------------------+
      | Level   | Code | Message                                             |
      +---------+------+-----------------------------------------------------+
      | Warning | 1329 | No data - zero rows fetched, selected, or processed |
      +---------+------+-----------------------------------------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              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.