[MDEV-8508] mroonga fails embedded tests in 10.1 Created: 2015-07-20 Updated: 2015-11-18 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Mroonga |
| Affects Version/s: | 10.1.6 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.1.9-3 |
| Description |
|
mroonga crashes in embedded tests in 10.1. this looks like a linking problem. the crash happens immediately in mrn_init() on
In -DCMAKE_BUILD_TYPE=Debug this is compiled to
And in gdb I see that %rax is 0 in the last line. Other plugins (for example, qc_info plugin) succeed, while having very similar code. I'd guess the issue has something to do with compilation or linking options that mroonga uses. As a temporary workaround I have made mroonga tests not to run by default in embedded test runs. |
| Comments |
| Comment by Kouhei Sutou [ 2015-08-16 ] |
|
I've fixed it on master in the Mroonga repository: https://github.com/mroonga/mroonga I've added "MRN_BUILD_FOR_EMBEDDED_SERVER" CMake option. We need to enable the value by passing "-DMRN_BUILD_FOR_EMBEDDED_SERVER=ON" when we build Mroonga for embedded server. Reason: Mroonga uses "THD". "THD" has more fields when it's build for embedded server. (See "#ifdef EMBEDDED_LIBRARY" in sql/sql_class.h.) We need to build Mroonga with "EMBEDDED_LIBRARY" flag for embedded server. The "MRN_BUILD_FOR_EMBEDDED_SERVER" CMake option adds "-DEMBEDDED_LIBRARY" compiler (preprocessor) flag. |
| Comment by Sergei Golubchik [ 2015-08-16 ] |
|
Thanks a lot! Does that mean you didn't use THD before 5.04? Normally, for engines that use THD our solution is to specify RECOMPILE_FOR_EMBEDDED in MYSQL_ADD_PLUGIN in the CMakeLists.txt. See, for example, storage/myisam/CMakeLists.txt. But this solution only works if the plugin is compiled in statically — cmake will build libmroonga.a to link into mysqld and libmroonga_embedded.a to link into libmysqld.a. If the plugin is built as a dynamic module — ha_mroonga.so — there can be only one file and until you use THD directly, this one file cannot work both for the standalone and embedded server, as far as I understand. So, for now I'll add RECOMPILE_FOR_EMBEDDED for mroonga and I'll enable embedded tests for mroonga but only when mroonga is built in statically. If you'd like to consider removing dependency on THD, I'd be happy to help with that too. Please, tell me what you use THD for and I'll see what we can do about it. |
| Comment by Kouhei Sutou [ 2015-08-17 ] |
|
> Does that mean you didn't use THD before 5.04? Mroonga used THD before 5.04. The test failure reported in this issue is caused by "unresolved symbol" load error on dlopen() in sql/sql_plugin.cc. The symbol was referenced from unused code for MariaDB 10.1 build. It was fixed by disabling the code at https://github.com/mroonga/mroonga/commit/2894292fd908b1bbe59d829e7fdab89e6d751d4d#diff-ba714ec217aa6836e39b3aea9da57ae2R16267 (Sorry. I forgot the "unresolved symbol" name.) > So, for now I'll add RECOMPILE_FOR_EMBEDDED for mroonga and I'll enable embedded tests for mroonga but only when mroonga is built in statically. Unfortunately, it doesn't solve anything. Because Mroonga passes MODULE_ONLY flag to mysql_add_plugin(): https://github.com/MariaDB/server/blob/10.1/storage/mroonga/CMakeLists.txt#L323 RECOMPILE_FOR_EMBEDDED doesn't work for MODULE_ONLY plugin: https://github.com/MariaDB/server/blob/10.1/cmake/plugin.cmake#L122 > If you'd like to consider removing dependency on THD, I'd be happy to help with that too. Please, tell me what you use THD for and I'll see what we can do about it. We want to implement "abort on warning" feature in Mroonga. If we can implement the feature without THD, we don't use THD for the feature. EMBEDDED_LIBRARY macro affects THD::abort_on_warning position in THD. |
| Comment by Kouhei Sutou [ 2015-08-17 ] |
|
Sorry. I forgot to mention about this: Thanks for your help! |
| Comment by Sergei Golubchik [ 2015-11-13 ] |
|
I've tried again and don't think this crash that I see has anything to do with THD. Incorrect offset to THD::abort_on_warning could only cause a crash when you access thd->abort_on_warning or later. But I see a crash immediately in mrn_init() |
| Comment by Kouhei Sutou [ 2015-11-14 ] |
|
Thanks for trying this again. Could you show how to try this again? |