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

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

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

            Roel Roel Van de Paar created issue -
            Roel Roel Van de Paar made changes -
            Field Original Value New Value
            Description The attached testcase, 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);

            {noformat}
            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` FOREIGN KEY (`a`)
            ...etc...
            REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, 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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            The attached testcase, 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);

            {noformat}
            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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Oleksandr Byelkin [ sanja ]
            Roel Roel Van de Paar made changes -
            Attachment fk.sql [ 53214 ]
            Roel Roel Van de Paar made changes -
            Description The attached testcase, 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);

            {noformat}
            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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            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);

            {noformat}
            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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            Roel Roel Van de Paar made changes -
            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);

            {noformat}
            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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            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);

            {noformat}
            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 );
            {noformat}

            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:

            {noformat:title=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
            {noformat}
            Roel Roel Van de Paar made changes -
            Labels foreign-keys
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Aleksey Midenkov [ midenok ]

            Repeating the testcase a number of times has shown the server to hang more easily.

            Roel Roel Van de Paar added a comment - Repeating the testcase a number of times has shown the server to hang more easily.
            Roel Roel Van de Paar added a comment - - edited

            Inserting this into the testcase:

            CREATE TABLE bug56143_1 (a INT);
            

            Makes the testcase more reliably crashable it seems, especially when repeated twice.

            Roel Roel Van de Paar added a comment - - edited Inserting this into the testcase: CREATE TABLE bug56143_1 (a INT); Makes the testcase more reliably crashable it seems, especially when repeated twice.

            With the modifications specified in the last comment, and uploaded as fk2.sql, the outcome is:

            10.4.15 eae968f62d285de97ed607c87bc131cd863d5d03 (Optimized)

            Core was generated by `/test/MD110820-mariadb-10.4.15-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
            [Current thread is 1 (Thread 0x14f632df3700 (LWP 2209794))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
            #1  0x000055ee5b081a77 in my_write_core (sig=sig@entry=11) at /test/10.4_opt/mysys/stacktrace.c:482
            #2  0x000055ee5aa5962a in handle_fatal_signal (sig=11) at /test/10.4_opt/sql/signal_handler.cc:343
            #3  <signal handler called>
            #4  0x000055ee5aa6247b in handler::ha_create_partitioning_metadata (this=0x14f60b9be4b8, name=<optimized out>, old_name=<optimized out>, action_flag=<optimized out>) at /test/10.4_opt/sql/handler.cc:4807
            #5  0x000055ee5a8dad80 in create_table_impl (thd=thd@entry=0x14f60b812008, orig_db=@0x14f60b83f098: {str = 0x14f60b83f740 "test", length = 4}, orig_table_name=@0x14f60b83f0a8: {str = 0x14f60b83f048 "t1", length = 2}, db=@0x14f60b83f098: {str = 0x14f60b83f740 "test", length = 4}, table_name=@0x14f60b83f0a8: {str = 0x14f60b83f048 "t1", length = 2}, path=path@entry=0x14f632df0010 "./test/t1", options={m_options = DDL_options_st::OPT_NONE}, create_info=0x14f632df03e0, alter_info=0x14f632df0320, create_table_mode=0, is_trans=0x14f632df0297, key_info=0x14f632defff8, key_count=0x14f632defff4, frm=0x14f632df0000) at /test/10.4_opt/sql/sql_table.cc:5094
            #6  0x000055ee5a8db0ab in mysql_create_table_no_lock (thd=thd@entry=0x14f60b812008, db=db@entry=0x14f60b83f098, table_name=table_name@entry=0x14f60b83f0a8, create_info=create_info@entry=0x14f632df03e0, alter_info=0x14f632df0320, is_trans=is_trans@entry=0x14f632df0297, create_table_mode=0, table_list=0x14f60b83f080) at /test/10.4_opt/sql/sql_table.cc:5176
            #7  0x000055ee5a8db2c1 in mysql_create_table (thd=thd@entry=0x14f60b812008, create_table=create_table@entry=0x14f60b83f080, create_info=create_info@entry=0x14f632df03e0, alter_info=alter_info@entry=0x14f632df0320) at /test/10.4_opt/sql/sql_table.cc:5268
            #8  0x000055ee5a8dc5ea in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14f60b812008) at /test/10.4_opt/sql/sql_table.cc:11493
            #9  0x000055ee5a848ca4 in mysql_execute_command (thd=thd@entry=0x14f60b812008) at /test/10.4_opt/sql/sql_parse.cc:6098
            #10 0x000055ee5a85022a in mysql_parse (thd=0x14f60b812008, rawbuf=<optimized out>, length=74203, parser_state=0x14f632df24d0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.4_opt/sql/sql_parse.cc:7896
            #11 0x000055ee5a852685 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14f60b812008, packet=packet@entry=0x14f60b8ce009 "CREATE TABLE  t1  ( `a` int(11) DEFAULT NULL, KEY `a` (`a`), CONSTRAINT `", 'a' <repeats 50 times>, "1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, CONSTR"..., packet_length=packet_length@entry=74203, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_opt/sql/sql_parse.cc:1834
            #12 0x000055ee5a853e04 in do_command (thd=0x14f60b812008) at /test/10.4_opt/sql/sql_parse.cc:1352
            #13 0x000055ee5a930dbe in do_handle_one_connection (connect=connect@entry=0x14f62fc32748) at /test/10.4_opt/sql/sql_connect.cc:1412
            #14 0x000055ee5a930e7d in handle_one_connection (arg=0x14f62fc32748) at /test/10.4_opt/sql/sql_connect.cc:1316
            #15 0x000014f631ff16db in start_thread (arg=0x14f632df3700) at pthread_create.c:463
            #16 0x000014f63116ba3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (dbg), 10.2.34 (opt), 10.3.25 (dbg), 10.3.25 (opt), 10.4.15 (dbg), 10.4.15 (opt)

            Bug confirmed not present in:
            MariaDB: 10.5.6 (dbg), 10.5.6 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

            Producing the crash on a debug build of 10.4.15 specifically required executing fk2.sql multiple times (4-5) in succession. Even 30-40+ repeats did not crash 10.5 in any way.

            Roel Roel Van de Paar added a comment - With the modifications specified in the last comment, and uploaded as fk2.sql, the outcome is: 10.4.15 eae968f62d285de97ed607c87bc131cd863d5d03 (Optimized) Core was generated by `/test/MD110820-mariadb-10.4.15-linux-x86_64-opt/bin/mysqld --no-defaults --core'. Program terminated with signal SIGSEGV, Segmentation fault. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 [Current thread is 1 (Thread 0x14f632df3700 (LWP 2209794))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 #1 0x000055ee5b081a77 in my_write_core (sig=sig@entry=11) at /test/10.4_opt/mysys/stacktrace.c:482 #2 0x000055ee5aa5962a in handle_fatal_signal (sig=11) at /test/10.4_opt/sql/signal_handler.cc:343 #3 <signal handler called> #4 0x000055ee5aa6247b in handler::ha_create_partitioning_metadata (this=0x14f60b9be4b8, name=<optimized out>, old_name=<optimized out>, action_flag=<optimized out>) at /test/10.4_opt/sql/handler.cc:4807 #5 0x000055ee5a8dad80 in create_table_impl (thd=thd@entry=0x14f60b812008, orig_db=@0x14f60b83f098: {str = 0x14f60b83f740 "test", length = 4}, orig_table_name=@0x14f60b83f0a8: {str = 0x14f60b83f048 "t1", length = 2}, db=@0x14f60b83f098: {str = 0x14f60b83f740 "test", length = 4}, table_name=@0x14f60b83f0a8: {str = 0x14f60b83f048 "t1", length = 2}, path=path@entry=0x14f632df0010 "./test/t1", options={m_options = DDL_options_st::OPT_NONE}, create_info=0x14f632df03e0, alter_info=0x14f632df0320, create_table_mode=0, is_trans=0x14f632df0297, key_info=0x14f632defff8, key_count=0x14f632defff4, frm=0x14f632df0000) at /test/10.4_opt/sql/sql_table.cc:5094 #6 0x000055ee5a8db0ab in mysql_create_table_no_lock (thd=thd@entry=0x14f60b812008, db=db@entry=0x14f60b83f098, table_name=table_name@entry=0x14f60b83f0a8, create_info=create_info@entry=0x14f632df03e0, alter_info=0x14f632df0320, is_trans=is_trans@entry=0x14f632df0297, create_table_mode=0, table_list=0x14f60b83f080) at /test/10.4_opt/sql/sql_table.cc:5176 #7 0x000055ee5a8db2c1 in mysql_create_table (thd=thd@entry=0x14f60b812008, create_table=create_table@entry=0x14f60b83f080, create_info=create_info@entry=0x14f632df03e0, alter_info=alter_info@entry=0x14f632df0320) at /test/10.4_opt/sql/sql_table.cc:5268 #8 0x000055ee5a8dc5ea in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14f60b812008) at /test/10.4_opt/sql/sql_table.cc:11493 #9 0x000055ee5a848ca4 in mysql_execute_command (thd=thd@entry=0x14f60b812008) at /test/10.4_opt/sql/sql_parse.cc:6098 #10 0x000055ee5a85022a in mysql_parse (thd=0x14f60b812008, rawbuf=<optimized out>, length=74203, parser_state=0x14f632df24d0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.4_opt/sql/sql_parse.cc:7896 #11 0x000055ee5a852685 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14f60b812008, packet=packet@entry=0x14f60b8ce009 "CREATE TABLE t1 ( `a` int(11) DEFAULT NULL, KEY `a` (`a`), CONSTRAINT `", 'a' <repeats 50 times>, "1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL, CONSTR"..., packet_length=packet_length@entry=74203, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_opt/sql/sql_parse.cc:1834 #12 0x000055ee5a853e04 in do_command (thd=0x14f60b812008) at /test/10.4_opt/sql/sql_parse.cc:1352 #13 0x000055ee5a930dbe in do_handle_one_connection (connect=connect@entry=0x14f62fc32748) at /test/10.4_opt/sql/sql_connect.cc:1412 #14 0x000055ee5a930e7d in handle_one_connection (arg=0x14f62fc32748) at /test/10.4_opt/sql/sql_connect.cc:1316 #15 0x000014f631ff16db in start_thread (arg=0x14f632df3700) at pthread_create.c:463 #16 0x000014f63116ba3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (dbg), 10.2.34 (opt), 10.3.25 (dbg), 10.3.25 (opt), 10.4.15 (dbg), 10.4.15 (opt) Bug confirmed not present in: MariaDB: 10.5.6 (dbg), 10.5.6 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt) Producing the crash on a debug build of 10.4.15 specifically required executing fk2.sql multiple times (4-5) in succession. Even 30-40+ repeats did not crash 10.5 in any way.
            Roel Roel Van de Paar made changes -
            Attachment fk2.sql [ 53233 ]

            Lowering the priority as the use case probably will never be the real world. Also high chance it is superseded by MDEV-16417.

            midenok Aleksey Midenkov added a comment - Lowering the priority as the use case probably will never be the real world. Also high chance it is superseded by MDEV-16417 .
            midenok Aleksey Midenkov made changes -
            Priority Critical [ 2 ] Major [ 3 ]

            Adding ASAN trace for fk.sql as requested in MDEV-23467

            10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized)

            ASAN:DEADLYSIGNAL
            =================================================================
            ==2380091==ERROR: AddressSanitizer: SEGV on unknown address 0x6210000a0000 (pc 0x1501e5c91d8f bp 0x000000000d68 sp 0x1501c192c1d8 T31)
            ==2380091==The signal is caused by a WRITE memory access.
                #0 0x1501e5c91d8e  (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
                #1 0x1501e5b9153b in _IO_default_xsputn (/lib/x86_64-linux-gnu/libc.so.6+0x8e53b)
                #2 0x1501e5b6007a in vfprintf (/lib/x86_64-linux-gnu/libc.so.6+0x5d07a)
                #3 0x1501e5b84740 in _IO_vsprintf (/lib/x86_64-linux-gnu/libc.so.6+0x81740)
                #4 0x55b2cbbcbd18 in __interceptor_vsprintf (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4ec6d18)
                #5 0x55b2cdea90ed in ib_push_warning(trx_t*, dberr_t, char const*, ...) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:21571
                #6 0x55b2ce816ebc in dict_create_foreign_constraints_low /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4194
                #7 0x55b2ce81a568 in dict_create_foreign_constraints(trx_t*, char const*, unsigned long, char const*, unsigned long) /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4582
                #8 0x55b2cdeeb34e in create_table_info_t::create_table(bool) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12436
                #9 0x55b2cdf1605f in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12884
                #10 0x55b2cd117a86 in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /test/10.4_opt/sql/handler.cc:4742
                #11 0x55b2cd11b503 in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /test/10.4_opt/sql/handler.cc:5206
                #12 0x55b2cc5b60e0 in create_table_impl /test/10.4_opt/sql/sql_table.cc:5070
                #13 0x55b2cc5b85df in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /test/10.4_opt/sql/sql_table.cc:5154
                #14 0x55b2cc5b939c in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /test/10.4_opt/sql/sql_table.cc:5246
                #15 0x55b2cc5cfdb1 in Sql_cmd_create_table_like::execute(THD*) /test/10.4_opt/sql/sql_table.cc:11466
                #16 0x55b2cc1b54a3 in mysql_execute_command(THD*) /test/10.4_opt/sql/sql_parse.cc:6101
                #17 0x55b2cc1e239b in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.4_opt/sql/sql_parse.cc:7901
                #18 0x55b2cc1efefd in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.4_opt/sql/sql_parse.cc:1841
                #19 0x55b2cc1f9937 in do_command(THD*) /test/10.4_opt/sql/sql_parse.cc:1359
                #20 0x55b2cc8044ae in do_handle_one_connection(CONNECT*) /test/10.4_opt/sql/sql_connect.cc:1412
                #21 0x55b2cc804d92 in handle_one_connection /test/10.4_opt/sql/sql_connect.cc:1316
                #22 0x1501e800b6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
                #23 0x1501e5c24a3e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x121a3e)
             
            AddressSanitizer can not provide additional info.
            SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
            Thread T31 created by T0 here:
                #0 0x55b2cbb6520f in __interceptor_pthread_create (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4e6020f)
                #1 0x55b2cbc6043b in inline_mysql_thread_create /test/10.4_opt/include/mysql/psi/mysql_thread.h:1275
                #2 0x55b2cbc6043b in create_thread_to_handle_connection(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6261
                #3 0x55b2cbc72e29 in create_new_thread(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6329
                #4 0x55b2cbc73688 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/10.4_opt/sql/mysqld.cc:6427
                #5 0x55b2cbc74d0b in handle_connections_sockets() /test/10.4_opt/sql/mysqld.cc:6585
                #6 0x55b2cbc772a4 in mysqld_main(int, char**) /test/10.4_opt/sql/mysqld.cc:5917
                #7 0x1501e5b24b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
             
            ==2380091==ABORTING
            

            Roel Roel Van de Paar added a comment - Adding ASAN trace for fk.sql as requested in MDEV-23467 10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized) ASAN:DEADLYSIGNAL ================================================================= ==2380091==ERROR: AddressSanitizer: SEGV on unknown address 0x6210000a0000 (pc 0x1501e5c91d8f bp 0x000000000d68 sp 0x1501c192c1d8 T31) ==2380091==The signal is caused by a WRITE memory access. #0 0x1501e5c91d8e (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e) #1 0x1501e5b9153b in _IO_default_xsputn (/lib/x86_64-linux-gnu/libc.so.6+0x8e53b) #2 0x1501e5b6007a in vfprintf (/lib/x86_64-linux-gnu/libc.so.6+0x5d07a) #3 0x1501e5b84740 in _IO_vsprintf (/lib/x86_64-linux-gnu/libc.so.6+0x81740) #4 0x55b2cbbcbd18 in __interceptor_vsprintf (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4ec6d18) #5 0x55b2cdea90ed in ib_push_warning(trx_t*, dberr_t, char const*, ...) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:21571 #6 0x55b2ce816ebc in dict_create_foreign_constraints_low /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4194 #7 0x55b2ce81a568 in dict_create_foreign_constraints(trx_t*, char const*, unsigned long, char const*, unsigned long) /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4582 #8 0x55b2cdeeb34e in create_table_info_t::create_table(bool) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12436 #9 0x55b2cdf1605f in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12884 #10 0x55b2cd117a86 in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /test/10.4_opt/sql/handler.cc:4742 #11 0x55b2cd11b503 in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /test/10.4_opt/sql/handler.cc:5206 #12 0x55b2cc5b60e0 in create_table_impl /test/10.4_opt/sql/sql_table.cc:5070 #13 0x55b2cc5b85df in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /test/10.4_opt/sql/sql_table.cc:5154 #14 0x55b2cc5b939c in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /test/10.4_opt/sql/sql_table.cc:5246 #15 0x55b2cc5cfdb1 in Sql_cmd_create_table_like::execute(THD*) /test/10.4_opt/sql/sql_table.cc:11466 #16 0x55b2cc1b54a3 in mysql_execute_command(THD*) /test/10.4_opt/sql/sql_parse.cc:6101 #17 0x55b2cc1e239b in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.4_opt/sql/sql_parse.cc:7901 #18 0x55b2cc1efefd in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.4_opt/sql/sql_parse.cc:1841 #19 0x55b2cc1f9937 in do_command(THD*) /test/10.4_opt/sql/sql_parse.cc:1359 #20 0x55b2cc8044ae in do_handle_one_connection(CONNECT*) /test/10.4_opt/sql/sql_connect.cc:1412 #21 0x55b2cc804d92 in handle_one_connection /test/10.4_opt/sql/sql_connect.cc:1316 #22 0x1501e800b6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da) #23 0x1501e5c24a3e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x121a3e)   AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e) Thread T31 created by T0 here: #0 0x55b2cbb6520f in __interceptor_pthread_create (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4e6020f) #1 0x55b2cbc6043b in inline_mysql_thread_create /test/10.4_opt/include/mysql/psi/mysql_thread.h:1275 #2 0x55b2cbc6043b in create_thread_to_handle_connection(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6261 #3 0x55b2cbc72e29 in create_new_thread(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6329 #4 0x55b2cbc73688 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/10.4_opt/sql/mysqld.cc:6427 #5 0x55b2cbc74d0b in handle_connections_sockets() /test/10.4_opt/sql/mysqld.cc:6585 #6 0x55b2cbc772a4 in mysqld_main(int, char**) /test/10.4_opt/sql/mysqld.cc:5917 #7 0x1501e5b24b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)   ==2380091==ABORTING

            Adding ASAN trace for fk2.sql

            10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized)

            ASAN:DEADLYSIGNAL
            =================================================================
            ==2391945==ERROR: AddressSanitizer: SEGV on unknown address 0x6210000a0000 (pc 0x1496a0c19d8f bp 0x000000000d68 sp 0x14967c8b41c8 T31)
            ==2391945==The signal is caused by a WRITE memory access.
                #0 0x1496a0c19d8e  (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
                #1 0x1496a0b1953b in _IO_default_xsputn (/lib/x86_64-linux-gnu/libc.so.6+0x8e53b)
                #2 0x1496a0ae807a in vfprintf (/lib/x86_64-linux-gnu/libc.so.6+0x5d07a)
                #3 0x1496a0b0c740 in _IO_vsprintf (/lib/x86_64-linux-gnu/libc.so.6+0x81740)
                #4 0x56443055bd18 in __interceptor_vsprintf (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4ec6d18)
                #5 0x5644328390ed in ib_push_warning(trx_t*, dberr_t, char const*, ...) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:21571
                #6 0x5644331a81c3 in dict_create_foreign_constraints_low /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4514
                #7 0x5644331aa568 in dict_create_foreign_constraints(trx_t*, char const*, unsigned long, char const*, unsigned long) /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4582
                #8 0x56443287b34e in create_table_info_t::create_table(bool) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12436
                #9 0x5644328a605f in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12884
                #10 0x564431aa7a86 in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /test/10.4_opt/sql/handler.cc:4742
                #11 0x564431aab503 in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /test/10.4_opt/sql/handler.cc:5206
                #12 0x564430f460e0 in create_table_impl /test/10.4_opt/sql/sql_table.cc:5070
                #13 0x564430f485df in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /test/10.4_opt/sql/sql_table.cc:5154
                #14 0x564430f4939c in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /test/10.4_opt/sql/sql_table.cc:5246
                #15 0x564430f5fdb1 in Sql_cmd_create_table_like::execute(THD*) /test/10.4_opt/sql/sql_table.cc:11466
                #16 0x564430b454a3 in mysql_execute_command(THD*) /test/10.4_opt/sql/sql_parse.cc:6101
                #17 0x564430b7239b in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.4_opt/sql/sql_parse.cc:7901
                #18 0x564430b7fefd in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.4_opt/sql/sql_parse.cc:1841
                #19 0x564430b89937 in do_command(THD*) /test/10.4_opt/sql/sql_parse.cc:1359
                #20 0x5644311944ae in do_handle_one_connection(CONNECT*) /test/10.4_opt/sql/sql_connect.cc:1412
                #21 0x564431194d92 in handle_one_connection /test/10.4_opt/sql/sql_connect.cc:1316
                #22 0x1496a2f936da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
                #23 0x1496a0baca3e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x121a3e)
             
            AddressSanitizer can not provide additional info.
            SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
            Thread T31 created by T0 here:
                #0 0x5644304f520f in __interceptor_pthread_create (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4e6020f)
                #1 0x5644305f043b in inline_mysql_thread_create /test/10.4_opt/include/mysql/psi/mysql_thread.h:1275
                #2 0x5644305f043b in create_thread_to_handle_connection(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6261
                #3 0x564430602e29 in create_new_thread(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6329
                #4 0x564430603688 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/10.4_opt/sql/mysqld.cc:6427
                #5 0x564430604d0b in handle_connections_sockets() /test/10.4_opt/sql/mysqld.cc:6585
                #6 0x5644306072a4 in mysqld_main(int, char**) /test/10.4_opt/sql/mysqld.cc:5917
                #7 0x1496a0aacb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
             
            ==2391945==ABORTING
            

            Also, shell level output seen on CLI exit - perhaps due to an incomplete server response (as server crashed).

            10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized)

            =================================================================
            ==2392008==ERROR: LeakSanitizer: detected memory leaks
             
            Direct leak of 128 byte(s) in 1 object(s) allocated from:
                #0 0x55ad125da1d8 in calloc (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysql+0x3f91d8)
                #1 0x55ad12653948 in mysql_init /test/10.4_opt/libmariadb/libmariadb/mariadb_lib.c:1108
                #2 0x55ad12624a61 in sql_real_connect /test/10.4_opt/client/mysql.cc:4665
                #3 0x55ad12624a61 in sql_connect /test/10.4_opt/client/mysql.cc:4741
                #4 0x55ad12626bed in com_connect /test/10.4_opt/client/mysql.cc:4334
                #5 0x55ad12626bed in reconnect /test/10.4_opt/client/mysql.cc:2937
                #6 0x55ad12627398 in mysql_real_query_for_lazy(char const*, unsigned long) /test/10.4_opt/client/mysql.cc:2985
                #7 0x55ad1262f8a9 in com_go /test/10.4_opt/client/mysql.cc:3242
                #8 0x55ad1263471d in add_line /test/10.4_opt/client/mysql.cc:2411
                #9 0x55ad1263471d in read_and_execute /test/10.4_opt/client/mysql.cc:2111
                #10 0x55ad1263a5b3 in com_source /test/10.4_opt/client/mysql.cc:4398
                #11 0x55ad1263419e in read_and_execute /test/10.4_opt/client/mysql.cc:2101
                #12 0x55ad12519f48 in main /test/10.4_opt/client/mysql.cc:1277
                #13 0x1469c0565b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
             
            Direct leak of 8 byte(s) in 1 object(s) allocated from:
                #0 0x55ad125da1d8 in calloc (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysql+0x3f91d8)
                #1 0x55ad12653905 in mysql_init /test/10.4_opt/libmariadb/libmariadb/mariadb_lib.c:1106
                #2 0x55ad12624a61 in sql_real_connect /test/10.4_opt/client/mysql.cc:4665
                #3 0x55ad12624a61 in sql_connect /test/10.4_opt/client/mysql.cc:4741
                #4 0x55ad12626bed in com_connect /test/10.4_opt/client/mysql.cc:4334
                #5 0x55ad12626bed in reconnect /test/10.4_opt/client/mysql.cc:2937
                #6 0x55ad12627398 in mysql_real_query_for_lazy(char const*, unsigned long) /test/10.4_opt/client/mysql.cc:2985
                #7 0x55ad1262f8a9 in com_go /test/10.4_opt/client/mysql.cc:3242
                #8 0x55ad1263471d in add_line /test/10.4_opt/client/mysql.cc:2411
                #9 0x55ad1263471d in read_and_execute /test/10.4_opt/client/mysql.cc:2111
                #10 0x55ad1263a5b3 in com_source /test/10.4_opt/client/mysql.cc:4398
                #11 0x55ad1263419e in read_and_execute /test/10.4_opt/client/mysql.cc:2101
                #12 0x55ad12519f48 in main /test/10.4_opt/client/mysql.cc:1277
                #13 0x1469c0565b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
             
            SUMMARY: AddressSanitizer: 136 byte(s) leaked in 2 allocation(s).
            

            Roel Roel Van de Paar added a comment - Adding ASAN trace for fk2.sql 10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized) ASAN:DEADLYSIGNAL ================================================================= ==2391945==ERROR: AddressSanitizer: SEGV on unknown address 0x6210000a0000 (pc 0x1496a0c19d8f bp 0x000000000d68 sp 0x14967c8b41c8 T31) ==2391945==The signal is caused by a WRITE memory access. #0 0x1496a0c19d8e (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e) #1 0x1496a0b1953b in _IO_default_xsputn (/lib/x86_64-linux-gnu/libc.so.6+0x8e53b) #2 0x1496a0ae807a in vfprintf (/lib/x86_64-linux-gnu/libc.so.6+0x5d07a) #3 0x1496a0b0c740 in _IO_vsprintf (/lib/x86_64-linux-gnu/libc.so.6+0x81740) #4 0x56443055bd18 in __interceptor_vsprintf (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4ec6d18) #5 0x5644328390ed in ib_push_warning(trx_t*, dberr_t, char const*, ...) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:21571 #6 0x5644331a81c3 in dict_create_foreign_constraints_low /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4514 #7 0x5644331aa568 in dict_create_foreign_constraints(trx_t*, char const*, unsigned long, char const*, unsigned long) /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4582 #8 0x56443287b34e in create_table_info_t::create_table(bool) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12436 #9 0x5644328a605f in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12884 #10 0x564431aa7a86 in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /test/10.4_opt/sql/handler.cc:4742 #11 0x564431aab503 in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /test/10.4_opt/sql/handler.cc:5206 #12 0x564430f460e0 in create_table_impl /test/10.4_opt/sql/sql_table.cc:5070 #13 0x564430f485df in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /test/10.4_opt/sql/sql_table.cc:5154 #14 0x564430f4939c in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /test/10.4_opt/sql/sql_table.cc:5246 #15 0x564430f5fdb1 in Sql_cmd_create_table_like::execute(THD*) /test/10.4_opt/sql/sql_table.cc:11466 #16 0x564430b454a3 in mysql_execute_command(THD*) /test/10.4_opt/sql/sql_parse.cc:6101 #17 0x564430b7239b in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.4_opt/sql/sql_parse.cc:7901 #18 0x564430b7fefd in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.4_opt/sql/sql_parse.cc:1841 #19 0x564430b89937 in do_command(THD*) /test/10.4_opt/sql/sql_parse.cc:1359 #20 0x5644311944ae in do_handle_one_connection(CONNECT*) /test/10.4_opt/sql/sql_connect.cc:1412 #21 0x564431194d92 in handle_one_connection /test/10.4_opt/sql/sql_connect.cc:1316 #22 0x1496a2f936da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da) #23 0x1496a0baca3e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x121a3e)   AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e) Thread T31 created by T0 here: #0 0x5644304f520f in __interceptor_pthread_create (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4e6020f) #1 0x5644305f043b in inline_mysql_thread_create /test/10.4_opt/include/mysql/psi/mysql_thread.h:1275 #2 0x5644305f043b in create_thread_to_handle_connection(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6261 #3 0x564430602e29 in create_new_thread(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6329 #4 0x564430603688 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/10.4_opt/sql/mysqld.cc:6427 #5 0x564430604d0b in handle_connections_sockets() /test/10.4_opt/sql/mysqld.cc:6585 #6 0x5644306072a4 in mysqld_main(int, char**) /test/10.4_opt/sql/mysqld.cc:5917 #7 0x1496a0aacb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)   ==2391945==ABORTING Also, shell level output seen on CLI exit - perhaps due to an incomplete server response (as server crashed). 10.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized) ================================================================= ==2392008==ERROR: LeakSanitizer: detected memory leaks   Direct leak of 128 byte(s) in 1 object(s) allocated from: #0 0x55ad125da1d8 in calloc (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysql+0x3f91d8) #1 0x55ad12653948 in mysql_init /test/10.4_opt/libmariadb/libmariadb/mariadb_lib.c:1108 #2 0x55ad12624a61 in sql_real_connect /test/10.4_opt/client/mysql.cc:4665 #3 0x55ad12624a61 in sql_connect /test/10.4_opt/client/mysql.cc:4741 #4 0x55ad12626bed in com_connect /test/10.4_opt/client/mysql.cc:4334 #5 0x55ad12626bed in reconnect /test/10.4_opt/client/mysql.cc:2937 #6 0x55ad12627398 in mysql_real_query_for_lazy(char const*, unsigned long) /test/10.4_opt/client/mysql.cc:2985 #7 0x55ad1262f8a9 in com_go /test/10.4_opt/client/mysql.cc:3242 #8 0x55ad1263471d in add_line /test/10.4_opt/client/mysql.cc:2411 #9 0x55ad1263471d in read_and_execute /test/10.4_opt/client/mysql.cc:2111 #10 0x55ad1263a5b3 in com_source /test/10.4_opt/client/mysql.cc:4398 #11 0x55ad1263419e in read_and_execute /test/10.4_opt/client/mysql.cc:2101 #12 0x55ad12519f48 in main /test/10.4_opt/client/mysql.cc:1277 #13 0x1469c0565b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)   Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x55ad125da1d8 in calloc (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysql+0x3f91d8) #1 0x55ad12653905 in mysql_init /test/10.4_opt/libmariadb/libmariadb/mariadb_lib.c:1106 #2 0x55ad12624a61 in sql_real_connect /test/10.4_opt/client/mysql.cc:4665 #3 0x55ad12624a61 in sql_connect /test/10.4_opt/client/mysql.cc:4741 #4 0x55ad12626bed in com_connect /test/10.4_opt/client/mysql.cc:4334 #5 0x55ad12626bed in reconnect /test/10.4_opt/client/mysql.cc:2937 #6 0x55ad12627398 in mysql_real_query_for_lazy(char const*, unsigned long) /test/10.4_opt/client/mysql.cc:2985 #7 0x55ad1262f8a9 in com_go /test/10.4_opt/client/mysql.cc:3242 #8 0x55ad1263471d in add_line /test/10.4_opt/client/mysql.cc:2411 #9 0x55ad1263471d in read_and_execute /test/10.4_opt/client/mysql.cc:2111 #10 0x55ad1263a5b3 in com_source /test/10.4_opt/client/mysql.cc:4398 #11 0x55ad1263419e in read_and_execute /test/10.4_opt/client/mysql.cc:2101 #12 0x55ad12519f48 in main /test/10.4_opt/client/mysql.cc:1277 #13 0x1469c0565b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)   SUMMARY: AddressSanitizer: 136 byte(s) leaked in 2 allocation(s).
            Roel Roel Van de Paar made changes -
            Labels foreign-keys affects-tests foreign-keys
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.1 [ 16100 ]
            midenok Aleksey Midenkov made changes -
            Summary Hangs + Sig11 in unknown location(s) due to single complex FK query on optimized builds Hangs + Sig11 in unknown location(s) due to single complex FK query
            midenok Aleksey Midenkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Assignee Aleksey Midenkov [ midenok ] Nikita Malyavin [ nikitamalyavin ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            midenok Aleksey Midenkov made changes -
            midenok Aleksey Midenkov made changes -
            Component/s Storage Engine - InnoDB [ 10129 ]
            nikitamalyavin Nikita Malyavin added a comment - - edited

            oktopush

            nikitamalyavin Nikita Malyavin added a comment - - edited oktopush
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Nikita Malyavin [ nikitamalyavin ] Aleksey Midenkov [ midenok ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            nikitamalyavin Nikita Malyavin made changes -
            Status Stalled [ 10000 ] Open [ 1 ]
            nikitamalyavin Nikita Malyavin made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Aleksey Midenkov [ midenok ] Nikita Malyavin [ nikitamalyavin ]
            nikitamalyavin Nikita Malyavin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            nikitamalyavin Nikita Malyavin added a comment - - edited

            will take a closer look though

            nikitamalyavin Nikita Malyavin added a comment - - edited will take a closer look though

            approve

            nikitamalyavin Nikita Malyavin added a comment - approve
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Nikita Malyavin [ nikitamalyavin ] Aleksey Midenkov [ midenok ]
            midenok Aleksey Midenkov made changes -
            issue.field.resolutiondate 2021-04-23 13:35:12.0 2021-04-23 13:35:12.56
            midenok Aleksey Midenkov made changes -
            Fix Version/s 10.2.38 [ 25207 ]
            Fix Version/s 10.3.29 [ 25206 ]
            Fix Version/s 10.4.19 [ 25205 ]
            Fix Version/s 10.5.10 [ 25204 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 112325 ] MariaDB v4 [ 158229 ]

            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.