[MDEV-23684] MariaDB 10.3 / 10.4 / 10.5 crashing and restarting intermittently - status=11/SEGV Created: 2020-09-07 Updated: 2021-08-12 Resolved: 2020-11-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE |
| Affects Version/s: | 10.3.24, 10.4.14, 10.5.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Carlos Oliveira | Assignee: | Daniel Black |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | crash, need_feedback | ||
| Environment: |
Ubuntu 18.04.4 LTS, Ubuntu 18.04.5 LTS, running on virtual machines (vmware and VirtualBox) and AWS EC2 instances |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Hello, After I installed a new server with MariaDB 10.4 or 10.5, I am facing on ubuntu syslog the "systemd[1]: mariadb.service: Main process exited, code=killed, status=11/SEGV" being reported a lot of times. Then applications loss the DB connections and some transactions are broken. I tried to install a new server, MariaDB, and restore a existing mysql dump file, however the same error happened. My system: - AWS EC2 running ubuntu 18.04 instances; - MariaDB 10.4.14 / 10.5 (error on both versions); - Client applications (nodejs using mysql or mariadb dependency); My findings so far is that only on MariaDB 10.4.13 (using a not-upgraded developer server and another one using AWS RDS MariaDB) the error does not happen. All other tentatives, I tried existing and new servers with MariaDB 10.4.14 and 10.5.x, the erratic behavior was the same (service crash and restart with status=11/SEGV). I am attaching my syslog and coredump files. PS: I also recorded the error on community KB: https://mariadb.com/kb/en/mariadb-104-105-crashing-and-restarting-intermittently-status11segv/ Best regards, |
| Comments |
| Comment by Carlos Oliveira [ 2020-09-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I installed a new server for testing and the same error happened with MariaDB 10.3.24. After additional testing, I found a "WITH RECURSIVE" SQL statement, where server process had crashed with the "status=11/SEGV". The server crash behavior happened even out of application runtime (nodejs with mysql/mariadb modules), using dbForge client to reproduce it. Please find attached new screenshots and the SQL statement where I reproduced the crash. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-09-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Edit: no longer required
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-09-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I pulled out your core dump and found the following backtrace. I suspect being this deep you may have just run out of stack. Maybe the RECURSIVE CTE didn't actually have a propper bounding. https://mariadb.com/kb/en/server-system-variables/#max_recursive_iterations can help prevent these from crashing the server.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-09-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Based on this and the stack depth, I think you've either got a cyclic parent hierarcy, or its just very very deep. 10.5 has a 'CYCLE' option that prevents cyclic paths https://mariadb.com/kb/en/with/ If its just very very deep - increase your thread_stack system variable. Can you check your data and see if this is the case? Don't worry about the information I asked for yesterday. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Carlos Oliveira [ 2021-08-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As latest update: 1) Same server (on-prem), same database, after vanilla upgrade do MariaDB 10.6 release, the "crash" error is not happening anymore. 2) Using same database dump, running on AWS RDS Mariab 10.4, the "crash" error does not happen. |