RE: DBI errors for Authentication protocol and old_password segfaults

"Musolino, Peter" <[email protected]> Fri, 28 Mar 2008 18:24:09 -0000
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
 I have turned DBI debugging to 2.  Here is the output into httpd/error_log

    -> DBI->connect(dbi:mysql:dbname=rt3;host=localhost, rt, ****)
    -> DBI->install_driver(mysql) for linux perl=5.008005 pid=21022 ruid=48 euid=48
       install_driver: DBD::mysql version 4.006 loaded from /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/mysql.pm
    <- install_driver= DBI::dr=HASH(0xc4c97a0)
    !! warn: 0 CLEARED by call to connect method
    -> connect for DBD::mysql::dr (DBI::dr=HASH(0xc4c97a0)~0xc4c97e8 'dbname=rt3;host=localhost' 'rt' ****) thr#b47cee0
imp_dbh->connect: dsn = dbname=rt3;host=localhost, uid = rt, pwd = xxxxxxxxxxx
imp_dbh->my_login : dbname = rt3, uid = rt, pwd = xxxxxxxxxxxx,host = localhost, port = NULL
imp_dbh->mysql_dr_connect: host = |localhost|, port = 0, uid = rt, pwd = xxxxxxxxxxxx
imp_dbh->use_server_side_prepare: 0
imp_dbh->mysql_dr_connect: client_flags = 2
imp_dbh->mysql_dr_connect: <-    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'mysql_auto_reconnect' 1) thr#b47cee0
    <- STORE= 1 at mysql.pm line 145
    <- connect= DBI::db=HASH(0xc4cb8c0) at DBI.pm line 637
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'PrintError' 1) thr#b47cee0
    <- STORE= 1 at DBI.pm line 689
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'AutoCommit' 1) thr#b47cee0
    <- STORE= 1 at DBI.pm line 689
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'Username' 'rt') thr#b47cee0
    <- STORE= 1 at DBI.pm line 692
    <> FETCH= 'rt' ('Username' from cache) at DBI.pm line 692
    -> connected in DBD::_::db for DBD::mysql::db (DBI::db=HASH(0xc4cb8c0)~0xc4cb7f4 'dbi:mysql:dbname=rt3;host=localhost' 'rt' 'xxxxxxxxxxxx') thr#b47cee0
    <- connected= undef at DBI.pm line 698
    <- connect= DBI::db=HASH(0xc4cb8c0)
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'dbi_connect_closure' CODE(0xc4c7318)) thr#b47cee0
    <- STORE= 1 at DBI.pm line 707
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'FetchHashKeyName' 'NAME_lc') thr#b47cee0
    <- STORE= 1 at Handle.pm line 110
    -> STORE for DBD::mysql::db (DBI::db=HASH(0xc4cb7f4)~INNER 'LongReadLen' 10000000) thr#b47cee0
    <- STORE= 1 at Handle.pm line 104
    -> prepare for DBD::mysql::db (DBI::db=HASH(0xc4cb8c0)~0xc4cb7f4 'SELECT  * FROM Users WHERE Name = ?') thr#b47cee0
        -> dbd_st_prepare MYSQL_VERSION_ID 50024, SQL statement: SELECT  * FROM Users WHERE Name = ?
        >- dbd_st_free_result_sets
        <- dbd_st_free_result_sets RC -1
[Fri Mar 28 13:55:43 2008] [notice] child pid 21022 exit signal Segmentation fault (11)

-----Original Message-----
From: Musolino, Peter [mailto:[email protected]] 
Sent: 28 March 2008 16:38
To: Patrick Galbraith
Cc: [email protected]
Subject: RE: DBI errors for Authentication protocol and old_password segfaults

Running set autocommit=1 from the client runs fine.
mysql> set autocommit=1;
Query OK, 0 rows affected (0.00 sec) 

I cannot tell from regular strace of httpd where the call to the script is going wrong.  I am attempting to attach some debugging to the fastcgi script to see if I can get look at a more granular level as to where the break is happening.

-----Original Message-----
From: Patrick Galbraith [mailto:[email protected]] 
Sent: 28 March 2008 14:39
To: Musolino, Peter
Cc: [email protected]
Subject: Re: DBI errors for Authentication protocol and old_password segfaults

even if it's not supported, it shouldn't crash it - it's just a database 
call from client to server that either passes or fails. What if you run 
that command in the mysql client?

Musolino, Peter wrote:

>I did some normal queries and selecting out of the table is fine.  
>One of the last things it does before the segfault is:  
>write(1, "\21\0\0\0\3set autocommit=1", 21) = 21
>
>I have been looking around a bit more and I am wondering if it is related to this old bug here:
>http://bugs.mysql.com/bug.php?id=24244
>
>I never actually see that message about autocommit not being supported in any of my stack traces or log files though.
>
>-----Original Message-----
>From: Patrick Galbraith [mailto:[email protected]] 
>Sent: 27 March 2008 21:27
>To: Musolino, Peter
>Cc: [email protected]
>Subject: Re: DBI errors for Authentication protocol and old_password segfaults
>
>Is there any way you could write a simple DBI perl script to connect to 
>the db, select something out of a table, etc.. That way you could 
>isolate it a bit more, and if there's anything wrong with the driver, I 
>can look at it.
>
>Musolino, Peter wrote:
>
>  
>
>>Hi,
>>I have been working on a problem relating to Request Tracker.  I have been scouring the web for answers to questions, but instead of answers, I just get new questions.
>>A bit about the environment, the modules, and the app:
>>
>>RHEL 4.0 Update 6
>>Apache 2.0.52-38
>>MySQL-client-standard 5.0.24a-0
>>MySQL-devel-standard-5.0.24a-0
>>MySQL-server-standard-5.0.24a-0
>>MySQL-shared-compat-5.0.24a-0
>>mod_perl 2.0.1
>>DBD::mysql 4.006
>>DBI 1.604
>>RT 3.6.6
>>DBIx::SearchBuilder-1.51
>>
>>We were first getting the following error in the apache error logs:
>>
>>DBI connect('dbname=rt3;host=localhost','rt',...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuilder/Handle.pm line 106
>>[Wed Mar 26 09:47:11 2008] [error] [client 10.20.1.102] Connect Failed Client does not support authentication protocol requested by server; consider upgrading MySQL client\n at /opt/rt3/lib/RT.pm line 220\n
>>
>>I checked and there would be no reason that the DBD::mysql would not be using anything but the latest mysql client libraries, so I am not sure why it is still trying to use the older protocol and choking on the new long password scheme.  So I took the second of the more suggested routes and changed the password of that user with the old_password method.  Instead of that error, I started to get segfaults.
>>
>>[Tue Mar 25 12:26:40 2008] [notice] child pid 25271 exit signal Segmentation fault (11)
>>
>>There were no errors in the mysql err logs nor the system logs.
>>
>>I decided to do an strace against the running apache process and saw the following:
>>
>>connect(1, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"}, 110) = 0
>>setsockopt(1, SOL_IP, IP_TOS, [8], 4)   = -1 EOPNOTSUPP (Operation not supported)
>>setsockopt(1, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
>>read(1, ">\0\0\0", 4)                   = 4
>>read(1, "\n5.0.24a-standard\0\304\224\0\0-gCVdwJK\0,"..., 62) = 62
>>open("/usr/share/mysql/charsets/Index", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
>>write(1, "\24\0\0\1\217 \0\0\0rt\0P[XJIQKK\0rt3", 24) = 24
>>read(1, "\5\0\0\2", 4)                  = 4
>>read(1, "\0\0\0\2\0", 5)                = 5
>>fcntl64(1, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
>>read(1, 0xc0977b8, 8192)                = -1 EAGAIN (Resource temporarily unavailable)
>>fcntl64(1, F_SETFL, O_RDWR)             = 0
>>write(1, "\21\0\0\0\3set autocommit=1", 21) = 21
>>read(1, "\5\0\0\1", 4)                  = 4
>>read(1, "\0\0\0\2\0", 5)                = 5
>>time(NULL)                              = 1206447319
>>time(NULL)                              = 1206447319
>>--- SIGSEGV (Segmentation fault) @ 0 (0) ---
>>chdir("/etc/httpd")                     = 0
>>rt_sigaction(SIGSEGV, {SIG_DFL}, {SIG_DFL}, 8) = 0
>>kill(5043, SIGSEGV)                     = 0
>>sigreturn()                             = ? (mask now [])
>>--- SIGSEGV (Segmentation fault) @ 0 (0) ---
>>Process 5043 detached
>>
>>The Index error is for missing files which can be found in mysql 3.0.  I copied the Index files and relevant .conf files into the charsets directory and the Index error and replaced with 
>>
>>open("/usr/share/mysql/charsets/Index", O_RDONLY|O_LARGEFILE) = 36
>>fstat64(36, {st_mode=S_IFREG|0755, st_size=549, ...}) = 0
>>mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e63000
>>read(36, "# sql/share/charsets/Index\n#\n# T"..., 4096) = 549
>>read(36, "", 4096)                      = 0
>>close(36)                               = 0
>>munmap(0xb7e63000, 4096)                = 0
>>
>>However the segfault still remains.
>>
>>I also ran an strace against mysql and got a similar error.
>>
>>fcntl64(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0
>>accept(12, {sa_family=AF_FILE, path="��
>>n"}, [2]) = 18
>>fcntl64(12, F_SETFL, O_RDWR)            = 0
>>getsockname(18, {sa_family=AF_FILE, path="/var/lib/mysql"}, [28]) = 0
>>fcntl64(18, F_SETFL, O_RDONLY)          = 0
>>fcntl64(18, F_GETFL)                    = 0x2 (flags O_RDWR)
>>fcntl64(18, F_SETFL, O_RDWR|O_NONBLOCK) = 0
>>setsockopt(18, SOL_IP, IP_TOS, [8], 4)  = -1 EOPNOTSUPP (Operation not supported)
>>time(NULL)                              = 1206613476
>>clone(child_stack=0xb16b24c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, parent_tidptr=0xb16b2be8, {entry_number:6, base_addr:0xb16b2ba0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb16b2be8) = 13994
>>select(13, [10 12], NULL, NULL, NULL <unfinished ...>
>>
>>I am fresh out of ideas.  Can anyone assist?  I have posted to the RT list have not yet received any response and given roots in mysql and DBI, I thought this would be appropriate
>>
>>Thanks in advance,
>>
>>Peter Musolino
>>D.B. Zwirn (UK) Ltd.
>>peter.musolino a t dbzco.com
>>
>>
>>
>>
>>
>>This e-mail message is intended only for the named recipient(s) above.  It may contain confidential information.  If you are not the intended recipient, you are hereby noti
>>fied that any use, dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited.  D.B. Zwirn & Co., L.P. reserves the right to archive
>>and monitor all e-mail communications through its networks.  If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and
>>delete the message and any attachment(s) from your system.  Thank you.
>>
>> 
>>
>>    
>>
>
>
>  
>


-- 
Patrick Galbraith, Senior Programmer 
Grazr - Easy feed grazing and sharing
http://www.grazr.com 

Satyam Eva Jayate - Truth Alone Triumphs
Mundaka Upanishad




This e-mail message is intended only for the named recipient(s) above.  It may contain confidential information.  If you are not the intended recipient, you are hereby noti
fied that any use, dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited.  D.B. Zwirn & Co., L.P. reserves the right to archive
 and monitor all e-mail communications through its networks.  If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and
 delete the message and any attachment(s) from your system.  Thank you.

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]



This e-mail message is intended only for the named recipient(s) above.  It may contain confidential information.  If you are not the intended recipient, you are hereby noti
fied that any use, dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited.  D.B. Zwirn & Co., L.P. reserves the right to archive
 and monitor all e-mail communications through its networks.  If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and
 delete the message and any attachment(s) from your system.  Thank you.

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]