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

Server crashes when creating a package with function with IN/OUT qualifier

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.0
    • 13.0
    • Stored routines
    • None
    • Can result in hang or crash

    Description

      CREATE PACKAGE pkg FUNCTION func (a IN INT) RETURN INT;
      

      Leads to:

      MDEV-10152 CS 12.3.1 0a7f3b5f2d38a37570d3df9d6f3bd078adcdc020 (Optimized, Clang 18.1.3-11) Build 19/02/2026

      Core was generated by `/test/mtest/MDEV-10152/MD190226-mariadb-12.3.1-linux-x86_64-opt/bin/mariadbd --'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  sp_type_def_list::find_type_def (this=0x0, name=...)at /test/mtest/MDEV-10152/12.3_opt/sql/sp_type_def.h:179
       
      [Current thread is 1 (LWP 1001498)]
      (gdb) bt
      #0  sp_type_def_list::find_type_def (this=0x0, name=@0x79bee4c697e0: {str = 0x79bdf0017944 "IN INT) RETURN INT", length = 2}) at /test/mtest/MDEV-10152/12.3_opt/sql/sp_type_def.h:179
      #1  sp_pcontext::find_type_def (this=0x0, name=<optimized out>, current_scope_only=<optimized out>)at /test/mtest/MDEV-10152/12.3_opt/sql/sp_pcontext.cc:438
      #2  0x000060da017790c3 in LEX::find_type_def (this=0x79bdf0027920, name=@0x79bee4c697e0: {str = 0x79bdf0017944 "IN INT) RETURN INT", length = 2}) at /test/mtest/MDEV-10152/12.3_opt/sql/sql_lex.cc:6864
      #3  LEX::set_field_type_typedef (this=0x79bdf0027920, type=0x79bee4c6a260, name=@0x79bee4c697e0: {str = 0x79bdf0017944 "IN INT) RETURN INT", length = 2}, attr=@0x79bee4c697f8: {m_length = 0, m_dec = 0 '\000', m_collation_type = 0 '\000', m_has_explicit_length = false, m_has_explicit_dec = false, m_length_overflowed = false, m_dec_overflowed = false}, coll=@0x79bee4c69828: {m_ci = 0x0, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_EMPTY}, is_typedef=is_typedef@entry=0x79bee4c69607)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_lex.cc:13398
      #4  0x000060da01778f3e in LEX::set_field_type_udt_or_typedef (this=0x0, type=0x79bee4c697e0, name=<error reading variable: Cannot access memory at address 0x1>, attr=@0x79bee4c697f8: {m_length = 0, m_dec = 0 '\000', m_collation_type = 0 '\000', m_has_explicit_length = false, m_has_explicit_dec = false, m_length_overflowed = false, m_dec_overflowed = false}, coll=@0x79bee4c69828: {m_ci = 0x0, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_EMPTY})at /test/mtest/MDEV-10152/12.3_opt/sql/sql_lex.cc:13331
      #5  0x000060da0199c06d in MYSQLparse (thd=thd@entry=0x79bdf0000c68)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_yacc.yy:6643
      #6  0x000060da017925a5 in parse_sql (thd=thd@entry=0x79bdf0000c68, parser_state=parser_state@entry=0x79bee4c6a4d0, creation_ctx=creation_ctx@entry=0x0, do_pfs_digest=true)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_parse.cc:10360
      #7  0x000060da01785bd1 in mysql_parse (thd=thd@entry=0x79bdf0000c68, rawbuf=0x79bdf0017920 "CREATE PACKAGE pkg FUNCTION func (a IN INT) RETURN INT", length=<optimized out>, parser_state=parser_state@entry=0x79bee4c6a4d0)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_parse.cc:7892
      #8  0x000060da017841db in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x79bdf0000c68, packet=packet@entry=0x79bdf0008cc9 "CREATE PACKAGE pkg FUNCTION func (a IN INT) RETURN INT", packet_length=packet_length@entry=54, blocking=true)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_parse.cc:1896
      #9  0x000060da01786171 in do_command (thd=thd@entry=0x79bdf0000c68, blocking=true) at /test/mtest/MDEV-10152/12.3_opt/sql/sql_parse.cc:1432
      #10 0x000060da018b7a9d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x60da35e2adc8, put_in_cache=true)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_connect.cc:1503
      #11 0x000060da018b785f in handle_one_connection (arg=arg@entry=0x60da35e2adc8)at /test/mtest/MDEV-10152/12.3_opt/sql/sql_connect.cc:1415
      #12 0x000060da01c7a609 in pfs_spawn_thread (arg=0x60da35dcd868)at /test/mtest/MDEV-10152/12.3_opt/storage/perfschema/pfs.cc:2198
      #13 0x000079bf1249caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #14 0x000079bf12529c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.