Bug #9941 segfault inside mysql.so
Submitted: 15 Apr 2005 18:58 Modified: 27 May 2005 14:02
Reporter: Andy Maas Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[15 Apr 2005 18:58] Andy Maas
Description:
mysql version: mysql-pro-4.1.10a-pc-linux-gnu-i686

We use perl DBI to access mysql from our application. Application is a a long daemon. Once in a while it segfault inside mysql. This seems to only happen since we upgrade mysql. We have been using mysql since early 4.1.

Based on stack trace, segfault seems to be in CBI connect. Here is how we usually make such call:

    DBI->connect_cached($args->{datasource},$args->{database_login},$args->{database_password},
            { RaiseError => 1, PrintError => 0, AutoCommit => $args->{AutoCommit}});

(gdb) bt
#0  0xb9db1b53 in my_stat () from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#1  0xb9db07d9 in my_read_charset_file ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#2  0xb9db09ff in init_available_charsets ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#3  0xb9db0d98 in get_charset_by_csname ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#4  0xb9dbecad in mysql_real_connect ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#5  0xb9d9a9f5 in mysql_dr_connect ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#6  0xb9d9b901 in _MyLogin () from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#7  0xb9d9bbef in mysql_db_login () from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#8  0xb9da07f9 in XS_DBD__mysql__db__login ()
   from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
#9  0x08109f76 in Perl_pp_entersub ()
#10 0x08102b89 in Perl_runops_standard ()
#11 0x080abad9 in S_call_body ()
#12 0x080ab9f5 in Perl_call_sv ()
#13 0xbd873fb4 in XS_DBI_dispatch () from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBI/DBI.so
#14 0x08109f76 in Perl_pp_entersub ()
#15 0x08102b89 in Perl_runops_standard ()
#16 0x080abad9 in S_call_body ()
#17 0x080ab9f5 in Perl_call_sv ()
#18 0xbd873fb4 in XS_DBI_dispatch () from /opt/proofpoint/pps-3.1.0.30/opt/perl/lib/site_perl/5.8.6/i686-linux-thread-multi/auto/DBI/DBI.so
#19 0x08109f76 in Perl_pp_entersub ()
#20 0x08102b89 in Perl_runops_standard ()
#21 0x080abad9 in S_call_body ()
#22 0x080ab8d4 in Perl_call_sv ()
#23 0x0807ff90 in Perl::call (this=0x0, fmt=0x8176157 "", ret=0x128abf6c) at PerlEmbed.cpp:192
#24 0x08073829 in InputHandler::headers_gotperl (this=0x128abf80) at Filter.cpp:166
#25 0xbefb8a84 in Dispatcher::exec (this=0xbdcc1c30, aobj=@0xbdcc1a0c) at Dispatch.cpp:116
#26 0xbefb8c0f in Dispatcher::run (this=0xbfffe65c) at Dispatch.cpp:147
#27 0xbefb8c6f in Dispatcher::worker (parm=0x2) at Dispatch.cpp:156
#28 0xbefda43b in Thread::threadInit (pArgs=0x81a0500) at Thread.cpp:291
#29 0xbef42dec in start_thread () from /lib/tls/libpthread.so.0
#30 0xbedeea2a in clone () from /lib/tls/libc.so.6

How to repeat:
There is sure way to repeat it. I have this reproduced in a stress test environment where our application is heavily tested. I can be sure of getting one or two core files in one day out of the three installations we have.
[24 Apr 2005 22:03] Jorge del Conde
Hi!

Can you please send us a test-case that reproduces this behaviour ?

Thanks a lot
[25 Apr 2005 17:40] Andy Maas
I just looked at my initial comment and the part "There is sure way to repeat it." is not quitre right. I can only reproduce it in a load test environment where I have three machines tested and in a day I usually see a core file in at least one of them (different machines often times).

So there is no sure way to reproduce it.
[25 May 2005 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".
[27 May 2005 14:02] MySQL Verification Team
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

Please feel free for to comment or re-open this bug report
when you are able for to provide a repeatable test case.

Thanks in advance.