Bug #22073 Segmentation fault on Freeradius start connection
Submitted: 7 Sep 2006 9:11 Modified: 12 Oct 2006 11:08
Reporter: Vladimir Kukushkin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.11 OS:Linux (Linux)
Assigned to: CPU Architecture:Any
Tags: freeradius, libmysqlclient, segmentation fault

[7 Sep 2006 9:11] Vladimir Kukushkin
Description:
Freeradius 1.1.3 compiled against libmysqlclient.so.15.0.0 dies with "Segmentation fault" during startup while attempt to connect to MySQL server 5.1.11 (glibc23).
Below is output and backtrace of the radius server started under gdb with option -X.
Linux version: Linux wide 2.4.20-31.9 #1 Tue Apr 13 17:41:45 EDT 2004 i686 i686 i386 GNU/Linux
gcc: gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
mysqld: mysqld  Ver 5.1.11-beta-log for pc-linux-gnu on i686 (MySQL Community Server (GPL))
-----------------------------------------------------
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to radius@localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 26131)]
0x405635e4 in TaoCrypt::CountWords (X=0xd8003e7c, N=1198843955)
    at ../include/misc.hpp:245
245     ../include/misc.hpp: No such file or directory.
        in ../include/misc.hpp
Current language:  auto; currently c++
-------------------------------------------
#0  0x405635e4 in TaoCrypt::CountWords (X=0xd8003e7c, N=1198843955)
    at ../include/misc.hpp:245
#1  0x40544f4d in TaoCrypt::Integer::WordCount (this=0x815ea38)
    at integer.cpp:3113
#2  0x40543c3e in TaoCrypt::Integer::operator= (this=0x814b590, t=@0x815ea38)
    at integer.cpp:2811
#3  0x405139a8 in yaSSL::Integer::operator= (this=0x815dad8, that=@0x815ea20)
    at crypto_wrapper.cpp:739
#4  0x40526ef9 in yaSSL::SSL_CTX::SetDH (this=0x815da78, dh=@0x815eb08)
    at yassl_int.cpp:1571
#5  0x4051a113 in SSL_CTX_set_tmp_dh (ctx=0x815da78, dh=0x815eb08)
    at ssl.cpp:427
#6  0x4050ecec in new_VioSSLConnectorFd (
    key_file=0x814e8c8 "/var/lib/mysql/openssl/client-key.pem",
    cert_file=0x81448f0 "/var/lib/mysql/openssl/client-cert.pem",
    ca_file=0x814b568 "/var/lib/mysql/openssl/cacert.pem", ca_path=0x0,
    cipher=0x0) at viosslfactories.c:283
#7  0x40508f1c in mysql_real_connect (mysql=0x814e4f8,
    host=0x4056b58d "localhost", user=0x8147a60 "radius",
    passwd=0x81478c0 "hflbecnm", db=0x814c1f0 "radius", port=0,
    unix_socket=0x40566cd9 "/var/lib/mysql/mysql.sock", client_flag=43663)
    at client.c:2029
#8  0x4046dcc3 in sql_init_socket (sqlsocket=0x8147a30, config=0x814c888)
    at stdlib.h:382
#9  0x404694f9 in connect_single_socket (sqlsocket=0x8147a30, inst=0x814ad20)
    at sql.c:70
#10 0x404696bd in sql_init_socketpool (inst=0x814ad20) at sql.c:131
#11 0x40467c45 in rlm_sql_instantiate (conf=0x8147a30, instance=0xd8003e7c)
    at rlm_sql.c:695
#12 0x080539f7 in find_module_instance ()
#13 0x08055148 in modcall ()
#14 0x08055524 in compile_modsingle ()
#15 0x08053f16 in find_module_instance ()
#16 0x08054353 in setup_modules ()
#17 0x080577cc in main ()
#18 0x4027862d in __libc_start_main () from /lib/libc.so.6

How to repeat:
Configure with ssl,compile,install MySQL-{server,client,develop} v.5.1.11 to linux redhat-9 i386 box. Configure, compile,install Freeradius server 1.1.3 at the same box. Run Freeradius server as superuser with option -X or do the same under gdb.
[12 Sep 2006 11:08] Valeriy Kravchuk
Thank you for a problem report. Why do you think it is a bug in MySQL and not in Freeradius? Is there anything suspicious in the error log of MySQL server?
[12 Oct 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".