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

SHOW CREATE for nonexistent procedure triggers segfault when cache_sp_in_show_create is enabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.11, 11.4, 11.8, 10.5(EOL)
    • N/A
    • Debug, Stored routines
    • None
    • Not for Release Notes

    Description

      set debug_dbug="+d,cache_sp_in_show_create";
      show create procedure non_existent_procedure;
      

      leads to:

      Core was generated by `/src/MariaDB-server.git/sql/mariadbd --defaults-group-suffix=.1 --defaults-file=/src/MariaDB-server.git/mysql-test/var/my.cnf --log-output=file --default-storage-engine=MyISAM --core-file --loose-debug-sync-timeout=300'.
      Program terminated with signal SIGSEGV, Segmentation fault.
       
      Thread 1 (Thread 0x7fa7e354c6c0 (LWP 462759)):
      #0  __pthread_kill_implementation (threadid=<optimized out>, signo=11, no_tid=0) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (threadid=<optimized out>, signo=11) at ./nptl/pthread_kill.c:89
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=11) at ./nptl/pthread_kill.c:100
      #3  0x00005b0454a03f71 in my_write_core (sig=11) at /src/MariaDB-server.git/mysys/stacktrace.c:424
      #4  0x00005b0454012d4e in handle_fatal_signal (sig=11) at /src/MariaDB-server.git/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  0x00005b0453a76ab7 in check_show_routine_access (thd=0x7fa7cc000dc8, sp=0x0, full_access=0x7fa7e354a8f6) at /src/MariaDB-server.git/sql/sp_head.cc:2978
      #7  0x00005b0453a772ce in sp_head::show_create_routine (this=0x0, thd=0x7fa7cc000dc8, sph=0x5b04557ddc60 <sp_handler_procedure>) at /src/MariaDB-server.git/sql/sp_head.cc:3093
      #8  0x00005b0454225a6a in Sp_handler::sp_show_create_routine (this=0x5b04557ddc60 <sp_handler_procedure>, thd=0x7fa7cc000dc8, name=0x7fa7cc0182a0) at /src/MariaDB-server.git/sql/sp.cc:2016
      #9  0x00005b0453baadb9 in mysql_execute_command (thd=0x7fa7cc000dc8, is_called_from_prepared_stmt=false) at /src/MariaDB-server.git/sql/sql_parse.cc:5621
      #10 0x00005b0453bb215c in mysql_parse (thd=0x7fa7cc000dc8, rawbuf=0x7fa7cc0181f0 "show create procedure p3", length=24, parser_state=0x7fa7e354b2c0) at /src/MariaDB-server.git/sql/sql_parse.cc:7891
      #11 0x00005b0453b9d967 in dispatch_command (command=COM_QUERY, thd=0x7fa7cc000dc8, packet=0x7fa7cc00c149 "show create procedure p3", packet_length=24, blocking=true) at /src/MariaDB-server.git/sql/sql_parse.cc:1877
      #12 0x00005b0453b9c24c in do_command (thd=0x7fa7cc000dc8, blocking=true) at /src/MariaDB-server.git/sql/sql_parse.cc:1416
      #13 0x00005b0453db7a6a in do_handle_one_connection (connect=0x5b045bffa0f8, put_in_cache=true) at /src/MariaDB-server.git/sql/sql_connect.cc:1414
      #14 0x00005b0453db77df in handle_one_connection (arg=0x5b045bc747c8) at /src/MariaDB-server.git/sql/sql_connect.cc:1326
      #15 0x00005b045439844e in pfs_spawn_thread (arg=0x5b045c014e38) at /src/MariaDB-server.git/storage/perfschema/pfs.cc:2198
      #16 0x00007fa7f26a2ef1 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448
      #17 0x00007fa7f273445c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Reproduced on main (4b79d7b8)

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            qobood Vasilii Lakhin
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.