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

The udf_init() function cause server crash.

    XMLWordPrintable

    Details

      Description

      When insert into a null name to mysql.func, restart the server will crash.

      For example:

      MariaDB [(none)]> select * from mysql.func;
      Empty set (0.001 sec)
       
      MariaDB [(none)]> insert into mysql.func(ret) values(1);
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [(none)]> select * from mysql.func;
      +------+-----+----+----------+
      | name | ret | dl | type     |
      +------+-----+----+----------+
      |      |   1 |    | function |
      +------+-----+----+----------+
      1 row in set (0.001 sec) 
      

      Restart the MariaDB Server, the server crash.

      The error stack is:

      Thread pointer: 0x5557ed51dad8
      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 = 0x7ffd6e777958 thread_stack 0x49000
      /data/server/build/sql/mariadbd(my_print_stacktrace+0x2e)[0x5557eb49f97e]
      mysys/stacktrace.c:307(my_print_stacktrace)[0x5557eaf20daf]
      sigaction.c:0(__restore_rt)[0x7f3eac7bf5f0]
      :0(__strlen_sse2_pminub)[0x7f3eaae0a641]
      sql/sql_udf.cc:209(udf_init())[0x5557eadd01d6]
      sql/mysqld.cc:5533(mysqld_main(int, char**))[0x5557eac7a564]
      ??:0(__libc_start_main)[0x7f3eaacbd505]
      /data/server/build/sql/mariadbd(+0x682973)[0x5557eac6e973]
       
      the gdb core stack is:
       
      #0  0x00007f3c8ba68a61 in pthread_kill () from /lib64/libpthread.so.0
      #1  0x0000563837533557 in my_write_core (sig=<optimized out>) at /data/server/mysys/stacktrace.c:518
      #2  0x0000563836fb4e1e in handle_fatal_signal (sig=11) at /data/server/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  0x00007f3c8a0b6641 in __strlen_sse2_pminub () from /lib64/libc.so.6
      #5  0x0000563836e6418f in udf_init () at /data/server/sql/sql_udf.cc:209
      #6  0x0000563836d0e564 in mysqld_main (argc=27, argv=0x563839740890) at /data/server/sql/mysqld.cc:5531
      #7  0x00007f3c89f69505 in __libc_start_main () from /lib64/libc.so.6
      #8  0x0000563836d02973 in _start ()
      

      I have fixed this bug.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danblack Daniel Black
              Reporter:
              zbdba jingbo zhao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration