[MDEV-25498] MySQL 5.7.34 crash with signal 11 when server_audit.so installed Created: 2021-04-23 Updated: 2023-04-24 Resolved: 2023-04-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugin - Audit |
| Affects Version/s: | N/A |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | William Wong | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Environment: |
redhat 7 |
||
| Description |
|
MySQL 5.7.34 crash with signal 11 when server_audit.so installed MariaDB Audit Plugin version 1.4.10 |
| Comments |
| Comment by Elena Stepanova [ 2021-04-25 ] | ||||||||||||||||||||||||||
|
I tried plugin from the current 10.4 (plugin version 1.4.13)
With MySQL 5.7.33 the same plugin library works all right (or at least it doesn't crash on startup). | ||||||||||||||||||||||||||
| Comment by Ralf Gebhardt [ 2021-04-27 ] | ||||||||||||||||||||||||||
|
Hi frelist, could you also reproduce this with issue with MariaDB Server? If yes, please let us know which version you used that we can work on a fix. | ||||||||||||||||||||||||||
| Comment by William Wong [ 2021-04-29 ] | ||||||||||||||||||||||||||
|
Hi Ralf, we cannot reproduce this issue in MariaDB. We have some production DB using MariaDB 10.5.8 without issue. | ||||||||||||||||||||||||||
| Comment by Kyle Bresin [ 2021-04-29 ] | ||||||||||||||||||||||||||
|
The sql_audit.cc stack trace there, along with the following changelog from MySQL 5.7.34:
got me interested into what exactly MySQL changed... Here's the change from 5.7.33 => 5.7.34:
Kind of looks like they were messing with audit log plugin logic? And maybe mariadb is friendly fire? | ||||||||||||||||||||||||||
| Comment by Kyle Bresin [ 2021-04-30 ] | ||||||||||||||||||||||||||
|
Nevermind, looks like they just renamed the debug assertion, I don't think that is the culprit... | ||||||||||||||||||||||||||
| Comment by Kyle Bresin [ 2021-04-30 ] | ||||||||||||||||||||||||||
|
A bit more context. MySQL 5.7.34 starts up fine with the mariadb server_audit.so plugin installed. It only crashes upon a client connect:
Note, it does this even if the user/pass is invalid:
It also does this even if server_audit_logging=OFF. Or if connect is removed from server_audit_events. | ||||||||||||||||||||||||||
| Comment by minlei sun (Inactive) [ 2021-05-02 ] | ||||||||||||||||||||||||||
|
This is caused by the problem of get_db_mysql57.
So the convenient way is to modify the auditing_v4 function in the test_audit_v4.c file, just comment the get_db_mysql57(...)
| ||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2021-05-03 ] | ||||||||||||||||||||||||||
|
Looks like MySQL changed the THD structure in the version 5.7.34. | ||||||||||||||||||||||||||
| Comment by Ralf Gebhardt [ 2021-05-03 ] | ||||||||||||||||||||||||||
|
holyfoot, as we obviously test the MariaDB Audit Plugin against MariaDB Server we never will catch such changes. If MySQL is doing such changes in a maintenance release, from my point of view it is best to clearly document that the plugin does not support MySQL 5.7 instead of updating offsets whenever MySQL is doing changes. | ||||||||||||||||||||||||||
| Comment by Kyle Bresin [ 2021-05-03 ] | ||||||||||||||||||||||||||
|
I agree with Ralf, that this behavior by MySQL is poor. That said, the maria side fix would go into a function whose sole purpose seems to be for mysql 5.7 compatibility? (get_db_mysql57). IMHO, responding to an anti-community action with another anti-community action only harms OS db communities, which (honestly) seems to be the entire goal of Oracle purchasing MySQL... That said, I totally get that it seems unfair that MySQL made this mess, but seem unwilling to own, or even discuss it. So I earnestly hope the mariadb community is better than they are. | ||||||||||||||||||||||||||
| Comment by Kyle Bresin [ 2021-05-03 ] | ||||||||||||||||||||||||||
|
minlei, I was able to confirm that your proposed patch worked for me, recompliling mariadb server_audit.so plugin with that fix made the plugin not crash on mysql 5.7.34. Thanks so much for looking into it, I really appreciate it! | ||||||||||||||||||||||||||
| Comment by Ralf Gebhardt [ 2021-05-03 ] | ||||||||||||||||||||||||||
|
kbresin, we for sure still can get added a fix for mysql 5.7 to the MariaDB Audit plugin, as long as it does not do any harm to the use with MariaDB Server. But we cannot state MySQL 5.7 "to be supported", and maybe should add a comment also in the code that this part of the code is not tested. | ||||||||||||||||||||||||||
| Comment by Modasir Khan [ 2021-05-21 ] | ||||||||||||||||||||||||||
|
Thanks - When will a fix be available for this ? Will a server_audit.so compatible with MySQL 5.7.34be available to download ? | ||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2021-05-21 ] | ||||||||||||||||||||||||||
|
The fix commenting get_db_mysql57() works correctly most of the time. Though sometimes the database name in log record will be empty. | ||||||||||||||||||||||||||
| Comment by Modasir Khan [ 2021-06-06 ] | ||||||||||||||||||||||||||
|
Any update on when the fix would be available for this issue ? | ||||||||||||||||||||||||||
| Comment by Dennis Elling [ 2021-10-12 ] | ||||||||||||||||||||||||||
|
Like holyfoot said, the THD structure has changed in 5.7.34 with this Fix: "Bug #32628376" sql/sql_class.h:
Increasing the offset by 8 bytes and recompiling worked for me without commenting the get_db_mysql57 function.
|