Bug #89615 | Building Shell 1.0.10 and above from source fails for undefined vio* functions | ||
---|---|---|---|
Submitted: | 10 Feb 2018 18:35 | Modified: | 23 Aug 2018 6:10 |
Reporter: | Georgi Sotirov | Email Updates: | |
Status: | Unsupported | Impact on me: | |
Category: | Shell General / Core Client | Severity: | S2 (Serious) |
Version: | 1.0.10, 1.0.11 | OS: | Linux (Slackware 14.2) |
Assigned to: | CPU Architecture: | Any |
[10 Feb 2018 18:35]
Georgi Sotirov
[10 Feb 2018 18:40]
Georgi Sotirov
That's HAVE_OPENSSL (not HAVE_SSL) of course.
[10 Feb 2018 19:53]
Georgi Sotirov
Yep, if I add libmysqlclient.a (static library) to the command line for linking mysqlsh, everything's fine, which reminds me of bug 82202. Apparently, some symbols are still not exposed in libmysqlclient.so dynamic library.
[10 Feb 2018 20:59]
Georgi Sotirov
Spent some time digging into the CMake scripts in MySQL Shell distribution to finally find out that adding -DMYSQL_EXTRA_LIBRARIES=/usr/lib${LIBDIRSUFFIX}/libmysqlclient.a to configure solves my problem. Still it would be very good if I'm able to link directly to the dynamic library. With MySQL versions released every 1-2 months I do not want to have to relink MySQL Shell with the static library after every new release.
[11 Feb 2018 14:04]
Georgi Sotirov
Unfortunately, my previous "solution" (i.e. with adding -DMYSQL_EXTRA_LIBRARIES=/usr/lib/libmysqlclient.a) wasn't meant to be. The resulting binary has no problem connecting to MySQL using the X protocol, but classic connections fail with segmentation fault. I was able to produce the following with the debugger: Program received signal SIGSEGV, Segmentation fault. 0x00007f8da43c87f0 in mysql_options () from /usr/lib64/libmysqlclient.so.20 (gdb) bt #0 0x00007f8da43c87f0 in mysql_options () from /usr/lib64/libmysqlclient.so.20 #1 0x00000000006320c7 in mysqlsh::mysql::Connection::setup_ssl (this=this@entry=0x28035c0, ssl_info=...) at /usr/src/tmp/mysql-shell-1.0.11-src/modules/mysql_connection.cc:337 #2 0x0000000000633892 in mysqlsh::mysql::Connection::Connection (this=0x28035c0, host=..., port=3306, socket=..., user=..., password=..., schema=..., ssl_info=...) at /usr/src/tmp/mysql-shell-1.0.11-src/modules/mysql_connection.cc:281 #3 0x000000000061cb85 in mysqlsh::mysql::ClassicSession::connect (this=0x2805250, args=...) at /usr/src/tmp/mysql-shell-1.0.11-src/modules/mod_mysql_session.cc:112 #4 0x000000000060303f in mysqlsh::connect_session (args=..., session_type=<optimized out>) at /usr/src/tmp/mysql-shell-1.0.11-src/modules/base_session.cc:109 #5 0x00000000005a4ac5 in shcore::Shell_core::connect_dev_session (this=0x26f8460, args=..., session_type=<optimized out>) at /usr/src/tmp/mysql-shell-1.0.11-src/shellcore/shell_core.cc:439 #6 0x0000000000581a3c in mysqlsh::Base_shell::connect_session (this=this@entry=0x7ffdabd18cc0, args=..., session_type=mysqlsh::SessionType::Auto, recreate_schema=<optimized out>) at /usr/src/tmp/mysql-shell-1.0.11-src/shell/base_shell.cc:309 #7 0x00000000005830bf in mysqlsh::Base_shell::connect (this=this@entry=0x7ffdabd18cc0, primary_session=primary_session@entry=false) at /usr/src/tmp/mysql-shell-1.0.11-src/shell/base_shell.cc:270 #8 0x00000000005839e0 in mysqlsh::Base_shell::cmd_connect (this=0x7ffdabd18cc0, args=...) at /usr/src/tmp/mysql-shell-1.0.11-src/shell/base_shell.cc:646 #9 0x00000000005a788a in std::function<bool (std::vector<std::string, std::allocator<std::string> > const&)>::operator()(std::vector<std::string, std::allocator<std::string> > const&) const (__args#0=..., this=<optimized out>) at /usr/include/c++/5.5.0/functional:2267 #10 shcore::Shell_command_handler::process (this=this@entry=0x7ffdabd18e48, command_line=...) at /usr/src/tmp/mysql-shell-1.0.11-src/shellcore/shell_core.cc:832 #11 0x000000000058075d in mysqlsh::Base_shell::do_shell_command (this=this@entry=0x7ffdabd18cc0, line=...) at /usr/src/tmp/mysql-shell-1.0.11-src/shell/base_shell.cc:826 #12 0x0000000000584043 in mysqlsh::Base_shell::process_line (this=this@entry=0x7ffdabd18cc0, line=...) at /usr/src/tmp/mysql-shell-1.0.11-src/shell/base_shell.cc:838 #13 0x000000000053a2f2 in mysqlsh::Command_line_shell::command_loop (this=this@entry=0x7ffdabd18cc0) at /usr/src/tmp/mysql-shell-1.0.11-src/src/cmdline_shell.cc:164 #14 0x00000000004e0ab6 in main (argc=<optimized out>, argv=0x7ffdabd193f8) at /usr/src/tmp/mysql-shell-1.0.11-src/src/main.cc:265 (gdb) up #1 0x00000000006320c7 in mysqlsh::mysql::Connection::setup_ssl (this=this@entry=0x28035c0, ssl_info=...) at /usr/src/tmp/mysql-shell-1.0.11-src/modules/mysql_connection.cc:337 337 mysql_options(_mysql, MYSQL_OPT_SSL_MODE, &value); (gdb) l 332 if (ssl_info.mode) 333 value = ssl_info.mode; 334 else 335 value = static_cast<int>(shcore::SslMode::Preferred); 336 337 mysql_options(_mysql, MYSQL_OPT_SSL_MODE, &value); 338 339 return true; 340 } 341 (gdb) p _mysql $1 = (MYSQL *) 0x0 So it appears to be null pointer dereference. Therefore, I tried linking directly to the static mysqlclient library (i.e. with -DMYSQL_LIB=/usr/lib/libmysqlclient.a) and this works, but the resulting binary is almost 10 times bigger. How can we make MySQL Shell working again with dynamically linked mysqlclient library like it was the case with 1.0.9? I know Oracle is providing only statically linked binaries, but my aim is to link dynamically.
[19 Feb 2018 9:11]
MySQL Verification Team
Hello Georgi, Thank you for the report and feedback. Thanks, Umesh
[19 Feb 2018 9:13]
MySQL Verification Team
Build details
Attachment: 89615_1.0.11.build (application/octet-stream, text), 257.23 KiB.
[19 Feb 2018 9:33]
Georgi Sotirov
Yes, exactly. I could have provided you the full build log if you have asked :-)
[22 Aug 2018 20:04]
Alfredo Kojima
Posted by developer: MySQL Shell 1.0 is no longer supported and version 8.0 should be used instead. Build instructions are described in the INSTALL file.
[23 Aug 2018 6:10]
Georgi Sotirov
"MySQL Shell 1.0 is no longer supported and version 8.0 should be used instead." Are you really serious with this statement!? MySQL Shell 1.0.11 is an _official_ GA release (available from https://dev.mysql.com/downloads/shell/), which I'm still building for older versions of Slackware. I consider building 8.0, but only for the next Slackware version. "Build instructions are described in the INSTALL file." How are general build instructions going to help me when the source itself doesn't compile!? Have you even looked at the patch I provided?