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

Signal 11 with stored procedure using cursor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2(EOL), 10.3(EOL)
    • N/A
    • Stored routines
    • None
    • Ubuntu 14.04

    Description

      Do the following on a fresh install of MariaDB 10.2.7

      DELIMITER ;;
      CREATE PROCEDURE test()
      BEGIN
        DECLARE test CURSOR FOR
          SELECT 
            IFNULL(NULL,1) test
          FROM 
            ( select 1 as id ) table_a
          GROUP BY table_a.id
        ;     
        OPEN test;
      END
      ;;
      CALL test;;
      

      Causes a Signal 11:

      Version: '10.2.7-MariaDB-10.2.7+maria~trusty'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
       
      Status information:
       
      Current dir: /var/lib/mysql/
      Running threads: 6  Cached threads: 0  Stack size: 299008
       
      Key caches:
      default
      Buffer_size:     134217728
      Block_size:           1024
      Division_limit:        100
      Age_threshold:         300
      Partitions:              0
      blocks used:             0
      not flushed:             0
      w_requests:              0
      writes:                  0
      r_requests:              0
      reads:                   0
       
       
      handler status:
      read_key:            0
      read_next:           0
      read_rnd             0
      read_first:          3
      write:               0
      delete               0
      update:              0
       
      Table status:
      Opened tables:         24
      Open tables:           18
      Open files:            39
      Open streams:           0
       
      Alarm status:
      Active alarms:   0
      Max used alarms: 0
      Next alarm time: 0
       
      Memory status:
      Non-mmapped space allocated from system: 17833984
      Number of free chunks:                   62
      Number of fastbin blocks:                4
      Number of mmapped regions:               10
      Space in mmapped regions:                311881728
      Maximum total allocated space:           0
      Space available in freed fastbin blocks: 304
      Total allocated space:                   12129600
      Total free space:                        5704384
      Top-most, releasable space:              62272
      Estimated memory (with thread stack):    331509760
      Global memory allocated by server:       273861560
      Memory allocated by threads:             188440
       
       
       
      Events status:
      LLA = Last Locked At  LUA = Last Unlocked At
      WOC = Waiting On Condition  DL = Data Locked
       
      Event scheduler status:
      State      : INITIALIZED
      Thread id  : 0
      LLA        : n/a:0
      LUA        : n/a:0
      WOC        : NO
      Workers    : 0
      Executed   : 0
      Data locked: NO
       
      Event queue status:
      Element count   : 0
      Data locked     : NO
      Attempting lock : NO
      LLA             : init_queue:140
      LUA             : init_queue:150
      WOC             : NO
      Next activation : never
      170725 12:16:20 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      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.2.7-MariaDB-10.2.7+maria~trusty
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=7
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467207 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f35300009a8
      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 = 0x7f3598222e70 thread_stack 0x49000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x5615799f002e]
      /usr/sbin/mysqld(handle_fatal_signal+0x30d)[0x56157943787d]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f359ac2b330]
      /usr/sbin/mysqld(_ZN19Materialized_cursor24send_result_set_metadataEP3THDR4ListI4ItemE+0xb9)[0x56157957c689]
      /usr/sbin/mysqld(_ZN18Select_materialize24send_result_set_metadataER4ListI4ItemEj+0xe3)[0x56157957c813]
      /usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0x26e)[0x5615792fdf1e]
      /usr/sbin/mysqld(_ZN4JOIN4execEv+0x33)[0x5615792fe8d3]
      /usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x11a)[0x5615792fea2a]
      /usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x23c)[0x5615792ff56c]
      /usr/sbin/mysqld(+0x4ceca6)[0x5615792a2ca6]
      /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x5c20)[0x5615792af0f0]
      /usr/sbin/mysqld(_Z17mysql_open_cursorP3THDP13select_resultPP18Server_side_cursor+0x164)[0x56157957c1e4]
      /usr/sbin/mysqld(_ZN9sp_cursor4openEP3THD+0x1e)[0x56157956e9fe]
      /usr/sbin/mysqld(_ZN14sp_instr_copen9exec_coreEP3THDPj+0x27)[0x561579564327]
      /usr/sbin/mysqld(_ZN13sp_lex_keeper23reset_lex_and_exec_coreEP3THDPjbP8sp_instr+0x99)[0x56157956a309]
      /usr/sbin/mysqld(_ZN14sp_instr_copen7executeEP3THDPj+0x48)[0x56157956a698]
      /usr/sbin/mysqld(_ZN7sp_head7executeEP3THDb+0x79e)[0x5615795671ae]
      /usr/sbin/mysqld(_ZN7sp_head17execute_procedureEP3THDP4ListI4ItemE+0x5df)[0x5615795688ff]
      /usr/sbin/mysqld(+0x4ce646)[0x5615792a2646]
      /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x1aa7)[0x5615792aaf77]
      /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x2bd)[0x5615792b254d]
      /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x2373)[0x5615792b5733]
      /usr/sbin/mysqld(_Z10do_commandP3THD+0x161)[0x5615792b6081]
      /usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1aa)[0x561579377d9a]
      /usr/sbin/mysqld(handle_one_connection+0x3d)[0x561579377ebd]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184)[0x7f359ac23184]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f359a345ffd]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f353000ef50): is an invalid pointer
      Connection ID (thread ID): 49
      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=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
       
      We think the query pointer is invalid, but we will try to print it anyway. 
      Query: call test
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Rich Rich Theobald
              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.