MySQL Forums
Forum List  »  Connector/C++

8.0.12 JDBC api crash VS2017
Posted by: Lefteris E
Date: August 10, 2018 02:07AM

The issue persists in version 8.0.12. Same exact error message.

It is not deterministic since it is caused by the destruction order of 2 global variables:

One global variable is in the c library:
static MEM_ROOT mem_root; ( line 106)

The second global variable is in the c++ connector:
static std::map< sql::SQLString, boost::shared_ptr<MySQL_Driver> > driver; (mysql_driver.cpp line 74)

You may be lucky enough and driver gets destroyed before mem_root. But in my case mem_root is destroyed first, and then driver's destructor tries to access it.

mysql_driver.cpp line 74 (static std::map< sql::SQLString, boost::shared_ptr<MySQL_Driver> > driver;)
mysql_driver.h line 58 (boost::scoped_ptr< ::sql::mysql::NativeAPI::NativeDriverWrapper > proxy;)
mysql_native_driver_wrapper.h line 51 (boost::shared_ptr<IMySQLCAPI> api;)
libmysql_static_proxy.cpp line 55 (this->library_end();)
libmysql_static_proxy.cpp line 252 (return ::mysql_library_end();) line 194 (mysql_client_plugin_deinit();) line 362 (for (p = plugin_list; p; p = p->next) )

*Crash becauce plugin_list[2] points to mem_root allocation that was released*

Options: ReplyQuote

Written By
July 25, 2018 07:24AM
July 30, 2018 05:51AM
August 02, 2018 09:23AM
August 07, 2018 03:54AM
8.0.12 JDBC api crash VS2017
August 10, 2018 02:07AM
August 13, 2018 07:09AM
August 16, 2018 07:32AM
August 16, 2018 04:34PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.