[MDEV-760] LP:977571 - Exported YaSSL symbols conflict with OpenSSL, crash Apache Created: 2012-04-09 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Kris Karas (Inactive) | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Apache with mod_ssl loaded dies with a SIGSEGV if it has been dynamically linked against MariaDB 5.3.6. I used "nm -P -s -g /usr/lib64/mysql/libmysqlclient_r.so" from both 5.3.5 and 5.3.6 to get a list of exported symbols, and then did a diff to see what changed. Right at the top of the list, we have the culprit: — /tmp/mariadb-5.3.5.symbols 2012-04-09 17:03:09.916073329 -0400 These symbols being exported from libmysqlclient_r.so are owned by OpenSSL (libcrypto.so). After Apache loads both libcrypto.so and libmysqlclient, it winds up using the MariaDB versions from YaSSL, which causes ssl_init_ModuleKill() to become very unhappy: [MariaDB 5.3.5 is currently loaded, and httpd fires up.]
Sorry, didn't have a chance to track it down to a particular source file. |
| Comments |
| Comment by Kristian Nielsen [ 2012-04-10 ] |
|
Re: Exported YaSSL symbols conflict with OpenSSL, crash Apache Google mentions Slackware when searching for "upgradepkg" - is this from a slackware package of mariadb? I think the root cause of this problem is that MariaDB is linked statically against YaSSL. It should instead link the system ssl libs dynamically, eg. with ./configure --with-ssl=/usr (this is what our .deb packages do). Maybe you can report this upstream? Still, this crashes with 5.3.6 but not with 5.3.5. In 5.3.6, bundled YaSSL was upgraded to 2.1.4 - this is a merge from recent MySQL 5.1. I can try to discuss with some other devevelopers and see if something can be done to avoid the crash. But in the end - I think trying to link both static yassl and dynamic openssl into Apache will cause problems - not just this one. The better fix is to make your packages link libopenssl.so dynamically. |
| Comment by Kris Karas (Inactive) [ 2012-04-10 ] |
|
Re: Exported YaSSL symbols conflict with OpenSSL, crash Apache The MariaDB "package" is constructed as a standard Slackware package, but is custom built from unmodified sources, configured thusly: ./configure --with-ssl --enable-dependency-tracking --enable-assembler --enable-profiling --with-charset=utf8 --with-extra-charsets=all --with-unix-socket-path=/var/mysql/socket --with-mysqld-user=mysql --with-plugins=max-no-ndb --with-readline --without-libedit --with-aria-tmp-tables --docdir=/usr/doc/mariadb-5.3.5 --sysconfdir=/etc --infodir=/usr/info --libdir=/usr/lib64 --mandir=/usr/man --prefix=/usr --localstatedir=/var/mysql The only thing SSL related is "--with-ssl" allowing the ./configure script to best figure out how to implement that in a compatible way. When YaSSL is compiled into MySQL/MariaDB statically, its definitions are supposed to be static as well, which prevents collisions when linking against some other SSL implementation. YaSSLs namespace has (up until now) not collided with that of OpenSSL, allowing both to coexist nicely. I've had no issues running MySQL 5.5.2x, for example. Even if the symbols collide, proper commands to the linker during assembly of the libmysqlclient.so should allow those to be kept private with the shared object, yes? It's been awhile since I read the gory details of the argument list to GNU "ld", but I assume such is possible. |
| Comment by Kristian Nielsen [ 2012-04-13 ] |
|
Re: Exported YaSSL symbols conflict with OpenSSL, crash Apache 5.5 is built differently (mariadb or mysql both). I think it does not export SSL symbols from the libmysqlclient.so, as you suggest to do. You could try mariadb 5.5.23. I sympatise with your statement "allowing the ./configure script to best figure out ..." - unfortunately it is not tradition in the MySQL development to focus on good defaults for people compiling themselves. |
| Comment by Rasmus Johansson (Inactive) [ 2012-04-15 ] |
|
Launchpad bug id: 977571 |
| Comment by Kristian Nielsen [ 2012-10-04 ] |
|
Should be fixed in 5.5, and a reasonable work-around for 5.3 is available. |