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

Assertion `strlen(Ptr) == str_length' failed in void Binary_string::chop()

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0
    • 10.4, 10.5, 10.6, 10.11
    • JSON

    Description

      SET @@collation_connection=utf32_czech_ci;
      SET @arr=CONCAT_WS('','[',REPEAT ('1234567,',1250000/2),'2345678]');
      SELECT JSON_DETAILED (@arr);
      

      Leads to

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      mariadbd: /test/11.0_dbg/sql/sql_string.h:327: void Binary_string::chop(): Assertion `strlen(Ptr) == str_length' failed.
      

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      Core was generated by `/test/GAL_MD200223-mariadb-11.0.1-linux-x86_64-dbg/bin/mariadbd --no-defaults -'.
      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 0x147e8dcfa700 (LWP 645034))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055635bb9c960 in my_write_core (sig=sig@entry=6) at /test/11.0_dbg/mysys/stacktrace.c:424
      #2  0x000055635b4981df in handle_fatal_signal (sig=6) at /test/11.0_dbg/sql/signal_handler.cc:357
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000147eab2b8859 in __GI_abort () at abort.c:79
      #6  0x0000147eab2b8729 in __assert_fail_base (fmt=0x147eab44e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55635bd451e2 "strlen(Ptr) == str_length", file=0x55635bd41380 "/test/11.0_dbg/sql/sql_string.h", line=327, function=<optimized out>) at assert.c:92
      #7  0x0000147eab2c9fd6 in __GI___assert_fail (assertion=assertion@entry=0x55635bd451e2 "strlen(Ptr) == str_length", file=file@entry=0x55635bd41380 "/test/11.0_dbg/sql/sql_string.h", line=line@entry=327, function=function@entry=0x55635bd451fc "void Binary_string::chop()") at assert.c:101
      #8  0x000055635b37ee15 in Binary_string::chop (this=0x147e8dcf8058) at /test/11.0_dbg/sql/sql_string.h:327
      #9  json_nice (je=je@entry=0x147e8dcf7e70, nice_js=nice_js@entry=0x147e8dcf8050, mode=Item_func_json_format::DETAILED, tab_size=tab_size@entry=4) at /test/11.0_dbg/sql/item_jsonfunc.cc:400
      #10 0x000055635b38274d in Item_func_json_format::val_str (this=0x147e340137a0, str=0x147e8dcf8050) at /test/11.0_dbg/sql/item_jsonfunc.cc:3994
      #11 0x000055635b3c7be2 in Type_handler::Item_send_str (this=<optimized out>, item=0x147e340137a0, protocol=0x147e34001358, buf=<optimized out>) at /test/11.0_dbg/sql/sql_type.cc:7454
      #12 0x000055635b30129f in Type_handler_string_result::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/11.0_dbg/sql/sql_type.h:5460
      #13 0x000055635b089c4c in Item::send (this=0x147e340137a0, protocol=0x147e34001358, buffer=0x147e8dcf8020) at /test/11.0_dbg/sql/item.h:1235
      #14 0x000055635b0c17d7 in Protocol::send_result_set_row (this=this@entry=0x147e34001358, row_items=row_items@entry=0x147e34013480) at /test/11.0_dbg/sql/protocol.cc:1332
      #15 0x000055635b149b83 in select_send::send_data (this=0x147e34014198, items=@0x147e34013480: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147e34013878, last = 0x147e34013878, elements = 1}, <No data fields>}) at /test/11.0_dbg/sql/sql_class.cc:3102
      #16 0x000055635b240b01 in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/11.0_dbg/sql/sql_class.h:5748
      #17 JOIN::exec_inner (this=this@entry=0x147e340141c0) at /test/11.0_dbg/sql/sql_select.cc:4754
      #18 0x000055635b241a89 in JOIN::exec (this=this@entry=0x147e340141c0) at /test/11.0_dbg/sql/sql_select.cc:4666
      #19 0x000055635b23fa48 in mysql_select (thd=thd@entry=0x147e34000d48, tables=0x0, fields=@0x147e34013480: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147e34013878, last = 0x147e34013878, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x147e34014198, unit=0x147e34004f90, select_lex=0x147e340131c8) at /test/11.0_dbg/sql/sql_select.cc:5146
      #20 0x000055635b2401b9 in handle_select (thd=thd@entry=0x147e34000d48, lex=lex@entry=0x147e34004eb8, result=result@entry=0x147e34014198, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.0_dbg/sql/sql_select.cc:608
      #21 0x000055635b1a628c in execute_sqlcom_select (thd=thd@entry=0x147e34000d48, all_tables=0x0) at /test/11.0_dbg/sql/sql_parse.cc:6267
      #22 0x000055635b1b258c in mysql_execute_command (thd=thd@entry=0x147e34000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.0_dbg/sql/sql_parse.cc:3949
      #23 0x000055635b1a05f6 in mysql_parse (thd=thd@entry=0x147e34000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147e8dcf9300) at /test/11.0_dbg/sql/sql_parse.cc:8002
      #24 0x000055635b1add11 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147e34000d48, packet=packet@entry=0x147e3400ae09 "", packet_length=packet_length@entry=27, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_class.h:1370
      #25 0x000055635b1b0154 in do_command (thd=0x147e34000d48, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_parse.cc:1407
      #26 0x000055635b31449a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55635dc6d608, put_in_cache=put_in_cache@entry=true) at /test/11.0_dbg/sql/sql_connect.cc:1416
      #27 0x000055635b31496c in handle_one_connection (arg=0x55635dc6d608) at /test/11.0_dbg/sql/sql_connect.cc:1318
      #28 0x0000147eab7c9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x0000147eab3b5133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.28 (dbg), 10.5.19 (dbg), 10.6.12 (dbg),10.7.8 (dbg), 10.8.7 (dbg), 10.9.5 (dbg), 10.10.3 (dbg), 10.11.2 (dbg), 11.0.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.28 (opt), 10.5.19 (opt), 10.6.12 (opt), 10.7.8 (opt), 10.8.7 (opt), 10.9.5 (opt), 10.10.3 (opt), 10.11.2 (opt), 11.0.1 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            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.