Add-Ons & Services

libmysqlclient18 auto init woes

Please post support and help requests here.

libmysqlclient18 auto init woes

Postby gregee123 » 22 Nov 2013, 21:58

Poco 1.5.2 - Ubuntu x64

my problem is as follows:

I've written a plugin for my app that links dynamically to libPocoDataMySQL.so.22 and its deps. When I try to load it either with ClassLoader or directly by dlopen() the program hangs. The reason is when dlopen() calls _init on the plugin .so lib the MySQL::Connector::registerConnector() is called automatically which causes libmysqlclient18 to deadlock (v. 16 seems to work normally?).

I didn't know how to prevent it. I tried to define POCO_NO_AUTOMATIC_LIB_INIT before including Connector.h to no avail. I even removed the whole auto-init part from Connector.h still hangs.

Then I came across this line in Connector.cpp:

const MySQLConnectorRegistrator pocoMySQLConnectorRegistrator;

which seems to instantiate the registrator regardless of POCO_NO_AUTOMATIC_LIB_INIT. (Please correct me if I'm wrong!).

So what I did was I commented out the line:


from the MySQLConnectorRegistrator constructor __and recompiled libPocoDatMySQL.so__

This finally did the trick!

Is there a simpler way to prevent auto initialization of mysqlclient?

I'm still learning this lib so I could have done something wrong...
currently using: 1.5.3
Posts: 24
Joined: 29 Mar 2013, 12:11

Re: libmysqlclient18 auto init woes

Postby gregee123 » 16 Dec 2013, 14:53

Anyone? This is easily reproducible. Do you need more info or are you planning to leave it like this?
currently using: 1.5.3
Posts: 24
Joined: 29 Mar 2013, 12:11

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests