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

Assertion `!str || str != Ptr' failed in String::copy

    XMLWordPrintable

Details

    Description

      Same assert as MDEV-22856, though does not look related.

      SET @c:="SET SESSION collation_connection=utf32_spanish_ci";
      PREPARE s FROM @c;
      EXECUTE s;
      CREATE PROCEDURE p (IN i INT) EXECUTE s;
      SET SESSION character_set_connection=latin2;
      SET @c:="SET @b=get_format(DATE,'EUR')";
      PREPARE s FROM @c;
      EXECUTE s;
      CALL p (@a);
      

      Leads to:

      10.6.0 f74704c7d963ddcd1109843a5861c6bd76409c8d (Debug)

      mysqld: /test/10.6_dbg/sql/sql_string.cc:441: bool String::copy(const char*, size_t, CHARSET_INFO*, CHARSET_INFO*, uint*): Assertion `!str || str != Ptr' failed.
      

      10.6.0 f74704c7d963ddcd1109843a5861c6bd76409c8d (Debug)

      Core was generated by `/test/MD120421-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 0x14a25416a700 (LWP 1488254))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000565074bc7c9e in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
      #2  0x0000565074366b07 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014a26a1da859 in __GI_abort () at abort.c:79
      #6  0x000014a26a1da729 in __assert_fail_base (fmt=0x14a26a370588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x565074d4c3ff "!str || str != Ptr", file=0x565074d4c4f0 "/test/10.6_dbg/sql/sql_string.cc", line=441, function=<optimized out>) at assert.c:92
      #7  0x000014a26a1ebf36 in __GI___assert_fail (assertion=assertion@entry=0x565074d4c3ff "!str || str != Ptr", file=file@entry=0x565074d4c4f0 "/test/10.6_dbg/sql/sql_string.cc", line=line@entry=441, function=function@entry=0x565074d4c6c0 "bool String::copy(const char*, size_t, CHARSET_INFO*, CHARSET_INFO*, uint*)") at assert.c:101
      #8  0x0000565074160c8e in String::copy (this=this@entry=0x14a21801f388, str=0x565074d578f8 "%d.%m.%Y", arg_length=8, from_cs=0x565075617a00 <my_charset_latin1>, to_cs=0x565075623280 <my_charset_utf32_spanish_uca_ci>, errors=errors@entry=0x14a254166fbc) at /test/10.6_dbg/sql/sql_string.cc:441
      #9  0x0000565074459cd8 in Item_func::val_str_from_val_str_ascii (this=0x14a21801f1a8, str=0x14a21801f388, ascii_buffer=0x14a21801f270) at /test/10.6_dbg/sql/sql_string.h:223
      #10 0x00005650743f763a in Item_str_ascii_func::val_str (this=<optimized out>, str=<optimized out>) at /test/10.6_dbg/sql/item_strfunc.h:88
      #11 0x00005650744133b4 in Item_func_set_user_var::check (this=0x14a21801f298, use_result_field=use_result_field@entry=false) at /test/10.6_dbg/sql/field.h:1026
      #12 0x0000565073fa7ae1 in set_var_user::check (this=0x14a21801f400, thd=<optimized out>) at /test/10.6_dbg/sql/set_var.cc:895
      #13 0x0000565073fa9d59 in sql_set_variables (thd=thd@entry=0x14a218000db8, var_list=var_list@entry=0x14a21801e490, free=free@entry=true) at /test/10.6_dbg/sql/set_var.cc:739
      #14 0x00005650740a867d in mysql_execute_command (thd=0x14a218000db8) at /test/10.6_dbg/sql/sql_parse.cc:5017
      #15 0x00005650740bf295 in Prepared_statement::execute (this=this@entry=0x14a21801afe8, expanded_query=expanded_query@entry=0x14a2541677b0, open_cursor=open_cursor@entry=false) at /test/10.6_dbg/sql/sql_prepare.cc:5040
      #16 0x00005650740bf5e3 in Prepared_statement::execute_loop (this=this@entry=0x14a21801afe8, expanded_query=expanded_query@entry=0x14a2541677b0, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/10.6_dbg/sql/sql_prepare.cc:4502
      #17 0x00005650740bfb1a in mysql_sql_stmt_execute (thd=thd@entry=0x14a218000db8) at /test/10.6_dbg/sql/sql_prepare.cc:3579
      #18 0x00005650740a5673 in mysql_execute_command (thd=0x14a218000db8) at /test/10.6_dbg/sql/sql_parse.cc:3943
      #19 0x0000565073fc4597 in sp_instr_stmt::exec_core (this=0x14a218026600, thd=<optimized out>, nextp=0x14a25416824c) at /test/10.6_dbg/sql/sp_head.cc:3770
      #20 0x0000565073fd1cd2 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14a218026648, thd=thd@entry=0x14a218000db8, nextp=nextp@entry=0x14a25416824c, open_tables=open_tables@entry=false, instr=instr@entry=0x14a218026600) at /test/10.6_dbg/sql/sp_head.cc:3497
      #21 0x0000565073fd2867 in sp_instr_stmt::execute (this=0x14a218026600, thd=0x14a218000db8, nextp=0x14a25416824c) at /test/10.6_dbg/sql/sp_head.cc:3676
      #22 0x0000565073fca4e7 in sp_head::execute (this=this@entry=0x14a218025890, thd=thd@entry=0x14a218000db8, merge_da_on_success=merge_da_on_success@entry=true) at /test/10.6_dbg/sql/sp_head.cc:1437
      #23 0x0000565073fcc562 in sp_head::execute_procedure (this=0x14a218025890, thd=thd@entry=0x14a218000db8, args=0x14a218005e78) at /test/10.6_dbg/sql/sp_head.cc:2451
      #24 0x00005650740981b4 in do_execute_sp (thd=thd@entry=0x14a218000db8, sp=sp@entry=0x14a218025890) at /test/10.6_dbg/sql/sql_parse.cc:3007
      #25 0x000056507409dbee in Sql_cmd_call::execute (this=0x14a218013c60, thd=0x14a218000db8) at /test/10.6_dbg/sql/sql_parse.cc:3253
      #26 0x00005650740ab20d in mysql_execute_command (thd=thd@entry=0x14a218000db8) at /test/10.6_dbg/sql/sql_parse.cc:5973
      #27 0x0000565074091a02 in mysql_parse (thd=thd@entry=0x14a218000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a254169410) at /test/10.6_dbg/sql/sql_parse.cc:8004
      #28 0x00005650740a0726 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a218000db8, packet=packet@entry=0x14a21800b369 "CALL p (@a)", packet_length=packet_length@entry=11, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
      #29 0x00005650740a3ac7 in do_command (thd=0x14a218000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
      #30 0x00005650741fd176 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x565076a773b8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #31 0x00005650741fd77b in handle_one_connection (arg=arg@entry=0x565076a773b8) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #32 0x00005650746ab253 in pfs_spawn_thread (arg=0x56507699ba88) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #33 0x000014a26a6e8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x000014a26a2d7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.