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

MariaDB got crash when call procedure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 10.6.16
    • N/A
    • mariadb in docker
      10.6.16-MariaDB-1:10.6.16+maria~ubu2004

    Description

      we notice one old issue was fixed in the latest release version,
      https://jira.mariadb.org/browse/MDEV-23902

      but when I bring up docker and set general_log=1, the bug trigger again.

      steps:

      docker pull mariadb:10.6.16
      docker run --name m616 -e MYSQL_ROOT_PASSWORD=123456 -d mariadb:10.6.16
      docker exec -it m616 mysql -uroot -p123456
       
      create schema test;
      use test;
      set global general_log=1;
       
      delimiter |
      CREATE OR REPLACE FUNCTION cnt()
      RETURNS INTEGER
      NO SQL
      BEGIN
         RETURN 1;
      END;|
      CREATE OR REPLACE PROCEDURE p1()
      NO SQL
      BEGIN
         DECLARE i INTEGER;
         FOR i IN 1..cnt() DO
            SELECT i;
         END FOR;
      END;|
      delimiter ;
       
      CALL p1(); -- OK
      CALL p1(); -- Crash
      

      logs:

      2023-11-21  1:03:06 0 [Note] mariadbd: ready for connections.
      Version: '10.6.16-MariaDB-1:10.6.16+maria~ubu2004'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
      231121  1:03:33 [ERROR] mysqld got signal 11 ;
      Sorry, we probably made a mistake, and this is a bug.
       
      Your assistance in bug reporting will enable us to fix this for the next release.
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.
       
      Server version: 10.6.16-MariaDB-1:10.6.16+maria~ubu2004-log source revision: b83c379420a8846ae4b28768d3c81fa354cca056
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=1
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468005 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f44d4000c58
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f451813cd18 thread_stack 0x49000
      Printing to addr2line failed
      mariadbd(my_print_stacktrace+0x32)[0x5611310288c2]
      mariadbd(handle_fatal_signal+0x475)[0x561130ae0075]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7f4519281420]
      mariadbd(_ZN7Item_sp7cleanupEv+0x1f)[0x561130b0287f]
      mariadbd(_ZN12Item_func_sp7cleanupEv+0x1c)[0x561130b504cc]
      mariadbd(_Z13cleanup_itemsP4Item+0x21)[0x5611308938c1]
      mariadbd(_ZN7sp_head7executeEP3THDb+0xb2d)[0x5611307e9a3d]
      mariadbd(_ZN7sp_head17execute_procedureEP3THDP4ListI4ItemE+0x67a)[0x5611307eb27a]
      mariadbd(+0x7b8d37)[0x561130892d37]
      mariadbd(_ZN12Sql_cmd_call7executeEP3THD+0x166)[0x561130897a26]
      mariadbd(_Z21mysql_execute_commandP3THDb+0x1016)[0x56113089e0f6]
      mariadbd(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e7)[0x56113088d847]
      mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x1085)[0x56113089a025]
      mariadbd(_Z10do_commandP3THDb+0x13e)[0x56113089c26e]
      mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3b7)[0x5611309b4297]
      mariadbd(handle_one_connection+0x5d)[0x5611309b45ed]
      mariadbd(+0xc5ba16)[0x561130d35a16]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x8609)[0x7f4519275609]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f4518e61133]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f44d4010990): CALL p1()
       
      Connection ID (thread ID): 3
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
       
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /var/lib/mysql
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units
      Max cpu time              unlimited            unlimited            seconds
      Max file size             unlimited            unlimited            bytes
      Max data size             unlimited            unlimited            bytes
      Max stack size            8388608              unlimited            bytes
      Max core file size        unlimited            unlimited            bytes
      Max resident set          unlimited            unlimited            bytes
      Max processes             unlimited            unlimited            processes
      Max open files            10485760             10485760             files
      Max locked memory         65536                65536                bytes
      Max address space         unlimited            unlimited            bytes
      Max file locks            unlimited            unlimited            locks
      Max pending signals       14938                14938                signals
      Max msgqueue size         819200               819200               bytes
      Max nice priority         0                    0
      Max realtime priority     0                    0
      Max realtime timeout      unlimited            unlimited            us
      Core pattern: |abrt-hook-ccpp %s %c %p %u %g %t %e %P %I %h
       
      Kernel version: Linux version 3.10.0-1160.99.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Sep 13 14:19:20 UTC 2023
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shawn2016 Shawn Yan
              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.