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

Sig 11 in json_normalize_sort

    XMLWordPrintable

Details

    • Q3/2025 Maintenance, Q4/2025 Server Maintenance

    Description

      MTR test case:-

      --source include/have_innodb.inc
      CREATE TABLE t (a JSON)Engine=InnoDB;
      INSERT INTO t VALUES (CONCAT (REPEAT('{"v":',5000),'1',REPEAT('}',5000)));
      SELECT JSON_EQUALS (a,a) FROM t;
      

      Leads to:-

      bb-12.1-json_depth_unlimited MDEV-36989 CS 12.1.0 725532989637af2a0a3e35862d25737fb0dae21f (Optimized) Build 19/06/2025

      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000624a37adbf52 in json_normalize_sort (val=0x781b2c791928) at /test/bb-12.1-json_depth_unlimited_dbg/strings/json_normalize.c:323
      ....so on similar lines
      #3519 0x0000624a37adbfca in json_normalize_sort (val=0x781b2c0adc08) at /test/bb-12.1-json_depth_unlimited_dbg/strings/json_normalize.c:331
      #3520 0x0000624a37adbfca in json_normalize_sort (val=0x781be00f3c60) at /test/bb-12.1-json_depth_unlimited_dbg/strings/json_normalize.c:331
      #3521 0x0000624a37adbd6a in json_normalize (result=0x781be00f3e28, s=0x781b2c068e98 "{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":{\"v\":"..., size=30001, cs=0x624a388df458 <my_charset_utf8mb4_bin>, current_mem_root=0x781b2c006e20, temp_je=0x781b2c0175a0, stack=0x781b2c017658) at /test/bb-12.1-json_depth_unlimited_dbg/strings/json_normalize.c:849
      #3522 0x0000624a36f4b3c5 in Item_func_json_equals::val_bool (this=0x781b2c017378) at /test/bb-12.1-json_depth_unlimited_dbg/sql/item_jsonfunc.cc:712
      #3523 0x0000624a36b6f7e2 in Item_bool_func::val_int (this=0x781b2c017378) at /test/bb-12.1-json_depth_unlimited_dbg/sql/item_cmpfunc.h:245
      #3524 0x0000624a36fc15b5 in Type_handler::Item_send_long (this=0x624a3893c948 <type_handler_bool>, item=0x781b2c017378, protocol=0x781b2c001430, buf=0x781be00f4020) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_type.cc:7745
      #3525 0x0000624a36fd5e2d in Type_handler_long::Item_send (this=0x624a3893c948 <type_handler_bool>, item=0x781b2c017378, protocol=0x781b2c001430, buf=0x781be00f4020) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_type.h:6086
      #3526 0x0000624a36b348cd in Item::send (this=0x781b2c017378, protocol=0x781b2c001430, buffer=0x781be00f4020) at /test/bb-12.1-json_depth_unlimited_dbg/sql/item.h:1212
      #3527 0x0000624a36b82b22 in Protocol::send_result_set_row (this=0x781b2c001430, row_items=0x781b2c016ec0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/protocol.cc:1359
      #3528 0x0000624a36c42e6e in select_send::send_data (this=0x781b2c018798, items=...) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_class.cc:3347
      #3529 0x0000624a36c42b00 in select_result_sink::send_data_with_check (this=0x781b2c018798, items=..., u=0x781b2c005150, sent=0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_class.cc:3245
      #3530 0x0000624a36d6652d in end_send (join=0x781b2c0187c0, join_tab=0x781b2c01a670, end_of_records=false) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:25795
      #3531 0x0000624a36d921fd in evaluate_join_record (join=0x781b2c0187c0, join_tab=0x781b2c01a1f8, error=0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:24675
      #3532 0x0000624a36d45a2e in sub_select (join=0x781b2c0187c0, join_tab=0x781b2c01a1f8, end_of_records=false) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:24442
      #3533 0x0000624a36d6cfb5 in do_select (join=0x781b2c0187c0, procedure=0x0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:23953
      #3534 0x0000624a36d6c361 in JOIN::exec_inner (this=0x781b2c0187c0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:5068
      #3535 0x0000624a36d6b55e in JOIN::exec (this=0x781b2c0187c0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:4856
      #3536 0x0000624a36d4635d in mysql_select (thd=0x781b2c000d58, tables=0x781b2c017720, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x781b2c018798, unit=0x781b2c005150, select_lex=0x781b2c016c08) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:5384
      #3537 0x0000624a36d45de5 in handle_select (thd=0x781b2c000d58, lex=0x781b2c005070, result=0x781b2c018798, setup_tables_done_option=0) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_select.cc:634
      #3538 0x0000624a36cedb01 in execute_sqlcom_select (thd=0x781b2c000d58, all_tables=0x781b2c017720) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_parse.cc:6166
      #3539 0x0000624a36ce294e in mysql_execute_command (thd=0x781b2c000d58, is_called_from_prepared_stmt=false) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_parse.cc:3954
      #3540 0x0000624a36cdabf4 in mysql_parse (thd=0x781b2c000d58, rawbuf=0x781b2c016b70 "SELECT JSON_EQUALS (a,a) FROM t", length=31, parser_state=0x781be00f6a10) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_parse.cc:7882
      #3541 0x0000624a36cd7fc8 in dispatch_command (command=COM_QUERY, thd=0x781b2c000d58, packet=0x781b2c1c93b9 "", packet_length=31, blocking=true) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_parse.cc:1877
      #3542 0x0000624a36cdb7a3 in do_command (thd=0x781b2c000d58, blocking=true) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_parse.cc:1416
      #3543 0x0000624a36ec7439 in do_handle_one_connection (connect=0x624a6fc44fd8, put_in_cache=true) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_connect.cc:1414
      #3544 0x0000624a36ec71de in handle_one_connection (arg=0x624a6fc9a2a8) at /test/bb-12.1-json_depth_unlimited_dbg/sql/sql_connect.cc:1326
      #3545 0x0000781be1e9caa4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #3546 0x0000781be1f29c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              saahil Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.