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

Hangs + Sig11 in unknown location(s) due to single complex FK query

    XMLWordPrintable

Details

    Description

      The attached testcase (fk.sql), can sporadically generate all sorts of issues in the server like crashes (sig 11 in opt), hangs (mysqld + client), inability to automatically create a core file even though error log shows 'mysqld got signal 11', inability to report stack in error log.

      The testcase is simple (2 lines only) but the second query is very with FK references. Condensed version (as example of what happens only; not for actual use/replay);

      USE test;
      CREATE TABLE  t1  ( `a` int(11) DEFAULT NULL, KEY `a` (`a`), 
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` 
        FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, 
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` 
        FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, 
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` 
      ...etc...
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` 
        FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, 
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` 
        FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, 
      CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` 
        FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL );
      

      I believe the bug affects 10.1-10.4 opt + dbg from what I have seen thus far, and may affect 10.5 also, though this is not confirmed. The testcase may have to be repeated many times, and it could be that machine load affects the reproducibility (with high load being better).

      An example sig11 crash on 10.3.25 optimized:

      10.3.25 bafc5c1321a7dff5f2da292111bf98fed9d1658d (Optimized)

      2020-08-12 12:59:12 0 [Note] /test/MD110820-mariadb-10.3.25-linux-x86_64-opt/bin/mysqld: ready for connections.
      Version: '10.3.25-MariaDB'  socket: '/test/MD110820-mariadb-10.3.25-linux-x86_64-opt/socket.sock'  port: 11826  MariaDB Server
      200812 12:59:15 [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.3.25-MariaDB
      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 = 467424 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x14d6e3812008
      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 = 0x14d70af69d98 thread_stack 0x49000
      

      Attachments

        1. fk.sql
          72 kB
        2. fk2.sql
          145 kB

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              Roel Roel Van de Paar
              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.