[MDEV-5634] mysqld crash signal 11 in mysql_audit_general Created: 2014-02-08 Updated: 2014-02-27 Resolved: 2014-02-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.7, 10.0.8 |
| Fix Version/s: | 10.0.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Andrew McDonnell | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Wheezy amd64 |
||
| Description |
|
If I run mysqld with the following command line
and I have a misconfigured entry for pid-file in my defaults file, such that the path is unwritable, I get a segfault when mysqld attempts to report the fact
|
| Comments |
| Comment by Andrew McDonnell [ 2014-02-08 ] | ||||||||||||||||||||||||
|
The segfault appears to be because thd is NULL. Looking at sql/sql_audit.h, I can see a check for thd being NULL, so this is accounted for, but then a derefence attempt is still made in the call to mysql_audit_notify, which causes the crash
| ||||||||||||||||||||||||
| Comment by Andrew McDonnell [ 2014-02-08 ] | ||||||||||||||||||||||||
|
If I attempt to fix this by not dereferencing and instead passing NULL for thd->db and 0 for thd->length, this simply cascades the crash to inside of mysql_audit_notify. Additionally no dereferencing in there fixes the problem. | ||||||||||||||||||||||||
| Comment by Andrew McDonnell [ 2014-02-08 ] | ||||||||||||||||||||||||
|
This patch fixes the problem:
| ||||||||||||||||||||||||
| Comment by Andrew McDonnell [ 2014-02-08 ] | ||||||||||||||||||||||||
|
Expected output after patch:
| ||||||||||||||||||||||||
| Comment by Andrew McDonnell [ 2014-02-08 ] | ||||||||||||||||||||||||
|
I have pushed this to my branch https://code.launchpad.net/~andymc73/maria/oqgraph-maintenance as a single commit, revision 3969, I dont know how to propose a single commit for merging in launchpad though? | ||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-02-10 ] | ||||||||||||||||||||||||
|
holyfoot, please check whether 5.5 is affected | ||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2014-02-27 ] | ||||||||||||||||||||||||
|
Yes, 5.5 is affected. |