[MDEV-7475] Wrong implementation of checking PLUGIN_VAR_SET condition Created: 2015-01-17 Updated: 2015-01-19 Resolved: 2015-01-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Affects Version/s: | 5.5.41, 10.0.15 |
| Fix Version/s: | 5.5.42, 10.0.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | hiroshi HATAKE | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | plugins | ||
| Environment: |
I've confirmed in Windows + Visual Studio 2013. But, other platform is affected this issue. e.g. CentOS 6.5. |
||
| Attachments: |
|
| Description |
|
This issue is MariaDB specific. MySQL is not implement this condition checking. In sql_plugin.cc, MariaDB implements PLUGIN_VAR_STR check as follows:
But, this implementation has a critical bug which causes SEGV. This SEGV issues causes as follows:
Because, these phenomena causes wrong condition about PLUGIN_VAR_STR. In include/mysql/plugin.h, a series of PLUGIN_* value defined. Here is the misleading point: OK, let's apply above description in practice. Here is the line which has causes problem:
From above description,
is valid, because PLUGIN_VAR_NOCMDOPT and PLUGIN_VAR_MEMALLOC are designed as a flag. It is valid.
is invalid code. Because,
is true!
So, PLUGIN_VAR_SET & PLUGIN_VAR_STR ( 0x0007 AND 0x0005) equals PLUGIN_VAR_STR (0x0005). This result causes following bug:
matches PLUGIN_VAR_STR, in spite of PLUGIN_VAR_STR is not set (NULL). As a result, causes SEGV and not to be able to register Mroonga storage engine plugin into MariaDB. I've added a fix patch which is written by Kohei Sutou. |
| Comments |
| Comment by Sergei Golubchik [ 2015-01-17 ] |
|
Thanks! It will be fixed in the next release. |