Bug #19575 MySQL-shared-5.0.21-0.glibc23 causes segfault in SSL_library_init
Submitted: 6 May 2006 4:26 Modified: 21 Sep 2006 7:22
Reporter: Michael McLagan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.24a OS:Linux (Linux)
Assigned to: Magnus Blåudd

[6 May 2006 4:26] Michael McLagan
Description:
Installing the above RPM on a Fedora Core 5.0 system with openssl 0.9.8a-5.2 causes segmentation faults in SSL_library_init() as called from Apache 2.2.0 and Apache 2.2.2 when loading mod_perl.  

Replacing the shared libraries with 5.0.20-0 allows httpd -t to complete with "Syntax OK", whereas the response with 5.0.21-0 is "Segmentation fault".  I localized the fault to the call to SSL_library_init() within the mod_ssl code, backtracked RPMs installed over the last 24hrs and re-installed them one at a time until I found this one caused the fault

The other MySQL RPMs I use -- server, client & devel, are all installed at 5.0.21-0 level without incident, only --shared- results in the error.

How to repeat:
Install 5.0.20 shared libraries.  Configure httpd with mod_authz_mysql and mod_ssl.  Run 'httpd -t'. Update to 5.0.21 and run 'httpd -t' again.  It will fault.
[12 May 2006 12:41] Domas Mituzas
Verified, 5.0.21 shared library has openssl-like symbols exported.

All openssl-like symbols in YaSSL code should be defined as macros by some glue layer and none of these should be exported by mysqlclient.
[31 May 2006 14:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/7095
[31 May 2006 15:05] Chad MILLER
Patch 7095 looks good to me.  Nice work.
[1 Jun 2006 9:49] Magnus Blåudd
Pushed to 5.0.23
[7 Jun 2006 9:29] Magnus Blåudd
Pushed to 5.1.12
[7 Jun 2006 9:30] Magnus Blåudd
Pushed fix that renames all functions from yaSSL that would otherwise conflict with those in OpenSSL.
[10 Jun 2006 15:57] Paul Dubois
Noted in 5.0.23, 5.1.12 changelogs.
[14 Sep 2006 1:35] Michael McLagan
This fix did not completely resolve the problem.  I have recompiled httpd/mod_ssl with the latest headers/libraries and the server will still not load if a shared library beyond 5.0.20 is used.

[root@titan ~]# service httpd start
Starting httpd: *** glibc detected *** /usr/sbin/httpd: double free or corruption (!prev): 0x82861238 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7bbfd0a]
/lib/libc.so.6(__libc_free+0x70)[0xb7bc2f48]
/lib/libcrypto.so.6(CRYPTO_free+0x3a)[0xb799df6a]
/lib/libcrypto.so.6[0xb7a10232]
/lib/libcrypto.so.6[0xb7a1587e]
/lib/libcrypto.so.6(ASN1_item_free+0x13)[0xb7a15af3]
/lib/libcrypto.so.6(X509_free+0x27)[0xb7a103f7]
/usr/lib/httpd/modules/mod_ssl.so[0xb74eb057]
/usr/lib/libapr-1.so.0[0xb7cb2d6d]
/usr/lib/libapr-1.so.0(apr_pool_clear+0x37)[0xb7cb36d7]
/usr/sbin/httpd(main+0x6e7)[0x80010827]
/lib/libc.so.6(__libc_start_main+0xc6)[0xb7b7570e]
/usr/sbin/httpd[0x8000fb11]

bash: line 1:  3507 Aborted                 /usr/sbin/httpd
                                                           [FAILED]
[21 Sep 2006 7:22] Domas Mituzas
That behavior could have been fixed in Bug#21930 (5.0.25) - there we completely got rid of clashing symbols.
[17 Oct 2006 21:30] Rik Serpentier
Same issues with MySQL 5.0.26-max, PHP 5.1.6, Apache 2.2.3 on Mac OS X Intel 10.4.8 Compiling PHP without mysql-support works fine...
[18 Oct 2006 10:43] Magnus Blåudd
Please see bug#19810 for up to date information about PHP and mysql