Exported YaSSL symbols conflict with OpenSSL, crash Apache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
New
|
Undecided
|
Kristian Nielsen |
Bug Description
Apache with mod_ssl loaded dies with a SIGSEGV if it has been dynamically linked against MariaDB 5.3.6.
If I downgrade to MariaDB 5.3.5, the problem goes away.
I used "nm -P -s -g /usr/lib64/
--- /tmp/mariadb-
+++ /tmp/mariadb-
@@ -1,3 +1,7 @@
+CRYPTO_add_lock T
+CRYPTO_lock T
+CRYPTO_mem_ctrl T
+EVP_CIPHER_
TERMINATE T
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_
[MariaDB 5.3.5 is currently loaded, and httpd fires up.]
~# httpd
~# killall httpd
~# upgradepkg mariadb-
+=====
| Upgrading mariadb-
+=====
~# httpd
Segmentation fault (core dumped)
~# gdb /usr/sbin/httpd core
[snip]
Core was generated by `httpd'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f1d4fa02c33 in ASN1_primitive_free () from /lib64/
(gdb) bt
#0 0x00007f1d4fa02c33 in ASN1_primitive_free () from /lib64/
#1 0x00007f1d4fa02c57 in ASN1_primitive_free () from /lib64/
#2 0x00007f1d4fa02fdf in ASN1_template_free () from /lib64/
#3 0x00007f1d4fa02eda in asn1_item_
#4 0x00007f1d4fa02fdf in ASN1_template_free () from /lib64/
#5 0x00007f1d4fa02eda in asn1_item_
#6 0x00007f1d4fa03015 in ASN1_item_free () from /lib64/
#7 0x00007f1d4aee9d1a in ssl_init_ModuleKill () from /usr/libexec/
#8 0x00007f1d4f2b0b8e in apr_pool_clear () from /usr/lib64/
#9 0x000000000042828d in main ()
(gdb) quit
Sorry, didn't have a chance to track it down to a particular source file.
Which package is this?
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.