[Maria-developers] plugin doesn't load
Hi, just one question: I have a simple plugin (a minimal storage engine) that does not load. When I try to load it I get this error-message: MariaDB [(none)]> install plugin dummy soname 'ha_dummy'; ERROR 1126 (HY000): Can't open shared library '/home/august/MariaDB/pgm/lib/plugin/ha_dummy.so' (errno: 2 undefined symbol: _ZN9ha_myisam5cloneEPKcP11st_mem_root) Can you please give me a tip. Thanks. Environment is MariaDB 10.0.4. The same code works without any problems in MySQL (5.5.8 - just for a test). The code is a minimal engine that just does nothing, I want to use it as a template for further work. this is the code in the form that it is working (the relevant parts): in the header-file: class ha_dummy: public handler in the code: ha_dummy::ha_dummy(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg) now I change this by modifying the inheritance-order: in the header file: added: #include "../myisam/ha_myisam.h" #include "../myisam/myisamdef.h" modified: class ha_dummy: public ha_myisam in the code: /* Constructor */ ha_dummy::ha_dummy(handlerton *hton, TABLE_SHARE *table_arg) :ha_myisam(hton, table_arg) It compiles but I cannot load it. What's the problem with st_mem_root? Thanks AugustQ PS: as written before: both versions work with MySQL.
Hi, AugustQ! On Dec 05, AugustQ wrote:
just one question: I have a simple plugin (a minimal storage engine) that does not load. When I try to load it I get this error-message:
MariaDB [(none)]> install plugin dummy soname 'ha_dummy'; ERROR 1126 (HY000): Can't open shared library '/home/august/MariaDB/pgm/lib/plugin/ha_dummy.so' (errno: 2 undefined symbol: _ZN9ha_myisam5cloneEPKcP11st_mem_root)
Can you please give me a tip. Thanks.
Environment is MariaDB 10.0.4.
The same code works without any problems in MySQL (5.5.8 - just for a test).
This happens because in MariaDB statically linked plugins don't export all their symbols. This helps to avoid name clashes with dynamically loaded plugins (like, when InnoDB is loaded and XtraDB is compiled in). Unlike MySQL we have a lot more of community developed storage engines, and we have to take these issues seriously. Because of that, the symbol _ZN9ha_myisam5cloneEPKcP11st_mem_root is local in MariaDB, and your plugin doesn't see it. In MySQL this symbol is global. I'll see if I can remove this. Alternatively, you can try to link your plugin explicitly with libmyisam.a Regards, Sergei
Alternatively, you can try to link your plugin explicitly with libmyisam.a
Won't this create two copies of libmyisam.a in memory (each one working with it's own set of static variables), and there'll be a danger of calling functions from different libraries with the same set of dynamically allocated data? Pavel On Thu, Dec 5, 2013 at 10:06 AM, Sergei Golubchik <serg@mariadb.org> wrote:
Hi, AugustQ!
On Dec 05, AugustQ wrote:
just one question: I have a simple plugin (a minimal storage engine) that does not load. When I try to load it I get this error-message:
MariaDB [(none)]> install plugin dummy soname 'ha_dummy'; ERROR 1126 (HY000): Can't open shared library '/home/august/MariaDB/pgm/lib/plugin/ha_dummy.so' (errno: 2 undefined symbol: _ZN9ha_myisam5cloneEPKcP11st_mem_root)
Can you please give me a tip. Thanks.
Environment is MariaDB 10.0.4.
The same code works without any problems in MySQL (5.5.8 - just for a test).
This happens because in MariaDB statically linked plugins don't export all their symbols. This helps to avoid name clashes with dynamically loaded plugins (like, when InnoDB is loaded and XtraDB is compiled in). Unlike MySQL we have a lot more of community developed storage engines, and we have to take these issues seriously.
Because of that, the symbol _ZN9ha_myisam5cloneEPKcP11st_mem_root is local in MariaDB, and your plugin doesn't see it. In MySQL this symbol is global.
I'll see if I can remove this.
Alternatively, you can try to link your plugin explicitly with libmyisam.a
Regards, Sergei
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi, Pavel! On Dec 05, Pavel Ivanov wrote:
Alternatively, you can try to link your plugin explicitly with libmyisam.a
Won't this create two copies of libmyisam.a in memory (each one working with it's own set of static variables), and there'll be a danger of calling functions from different libraries with the same set of dynamically allocated data?
Yes, it will. I don't think there will be any danger like that, because symbols from libmyisam.a won't be visible outside of the plugin (and outside of the server). Regards, Sergei
Hi Sergej, thanks for your tip! A first test shows that this work now. I will do some more tests tomorrow. And in case of further problems I will come back. Thanks!!! AugustQ On Do, 2013-12-05 at 19:06 +0100, Sergei Golubchik wrote:
Hi, AugustQ!
On Dec 05, AugustQ wrote:
just one question: I have a simple plugin (a minimal storage engine) that does not load. When I try to load it I get this error-message:
MariaDB [(none)]> install plugin dummy soname 'ha_dummy'; ERROR 1126 (HY000): Can't open shared library '/home/august/MariaDB/pgm/lib/plugin/ha_dummy.so' (errno: 2 undefined symbol: _ZN9ha_myisam5cloneEPKcP11st_mem_root)
Can you please give me a tip. Thanks.
Environment is MariaDB 10.0.4.
The same code works without any problems in MySQL (5.5.8 - just for a test).
This happens because in MariaDB statically linked plugins don't export all their symbols. This helps to avoid name clashes with dynamically loaded plugins (like, when InnoDB is loaded and XtraDB is compiled in). Unlike MySQL we have a lot more of community developed storage engines, and we have to take these issues seriously.
Because of that, the symbol _ZN9ha_myisam5cloneEPKcP11st_mem_root is local in MariaDB, and your plugin doesn't see it. In MySQL this symbol is global.
I'll see if I can remove this.
Alternatively, you can try to link your plugin explicitly with libmyisam.a
Regards, Sergei
participants (3)
-
AugustQ
-
Pavel Ivanov
-
Sergei Golubchik