Bug #86330 | MySQL spontaneously restarts with error 'mysqld got signal 11;' | ||
---|---|---|---|
Submitted: | 15 May 2017 21:57 | Modified: | 16 May 2017 9:00 |
Reporter: | Bazard Shoxer | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.7.18 and 5.7.12 | OS: | Ubuntu |
Assigned to: | CPU Architecture: | Any | |
Tags: | msyqld, MySQL, Signal 11 |
[15 May 2017 21:57]
Bazard Shoxer
[15 May 2017 23:08]
MySQL Verification Team
Thank you for the bug report. There is no test case provided in the bug report and hence there is nothing we can verify here. If you are able to reproduce the bug with one of the latest versions, please attach the exact reproducible test case and change the version on this bug report to the version you tested and change the status back to "Open". Also check for corrupted tables (your log shows errors messages about crashed tables, check hardware issue memory, disks etc).
[16 May 2017 8:59]
Bazard Shoxer
After lots and lots of searching, debugging, trying... and a lot of crashes! I think we found it We're having a table which has at least the following two columns: `prefix` VARCHAR(248) utf8mb4 and `parentPrefix` VARCHAR(248) utf8mb4. The parentPrefix is a dot (.) seperated path of all parents in the hierarchy. We use a VIRTUAL column to combine them into a 'fullPrefix' TEXT. For example: Node A has prefix 'NodeA', parentPrefix NULL. Node B (child of Node A), has prefix 'NodeB', parentPrefix 'NodeA' Node C (child of Node B), has prefix 'NodeC', parentPrefix 'NodeA.NodeB' The hierarchy will look something like this: - Node A (prefix 'NodeA', parentPrefix: NULL, fullPrefix: NodeA) - Node B (prefix 'NodeB', parentPrefix: 'NodeA', fullPrefix: NodeA.NodeB) - Node C (prefix 'NodeC', parentPrefix: 'NodeA.NodeB', fullPrefix: NodeA.NodeB.NodeC) Below is the export of the `fullPrefix` column: ALTER TABLE [tablename] ADD `fullPrefix` TEXT AS (if((`parentPrefix` <> ''),concat_ws('.',`parentPrefix`,`prefix`),`prefix`)) VIRTUAL AFTER `prefix`; When we delete the colom / make it a normal column, everything goes well. When using the VIRTUAL column, using CONCAT_WS, which also uses the dot (.) as seperator, even the most simple query like 'SELECT * FROM [tablename] WHERE 1', !SOMETIMES! results into mysqld exiting with signal 11. In the logs from the previous post, we found the following line: /usr/sbin/mysqld(_ZN19Item_func_concat_ws7val_strEP6String+0x102)[0xb3ec82] The CONCAT_WS function on a VIRTUAL column seems to be the problem. Strangely enough, it doesn't !ALWAYS! give the error. Sometime it does, sometimes it doesn't... We're having the problem on both MySQL versions (5.7.12 and 5.7.18). Problems on both servers can be fixed to remove the CONCAT_WS function on the VIRTUAL column. We now changed our tables, using a trigger before insert/update to CONCAT_WS the values of the `parentPrefix` and `prefix` columns into `fullPrefix`. For now, this works for us, but there seems to be something very wrong in the CONCAT_WS function, combined with a VIRTUAL column!