Subject: | code dumps on dbd_ix_dr_discon_all |
root@stats-test etc]# uname -a
Linux stats-test 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008
i686 i686 i386 GNU/Linux
----------------------------
[root@stats-test etc]# perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
----------------------------
DBI version 1.52
----------------------------
#0 dbd_ix_link_delete (link_d=0x87226c0, function=0xf43a60
<dbd_db_destroyer>) at link.c:73
73 link_2->prev = link_1;
(gdb) bt
#0 dbd_ix_link_delete (link_d=0x87226c0, function=0xf43a60
<dbd_db_destroyer>) at link.c:73
#1 0x00f47b5e in dbd_ix_link_delchain (head=0x83689d8,
function=0xf43a60 <dbd_db_destroyer>) at link.c:85
#2 0x00f43a3d in dbd_ix_dr_discon_all (drh=0x86f7c4c,
imp_drh=0x8368978) at dbdimp.ec:246
#3 0x00f3e5ae in XS_DBD__Informix__dr_discon_all_ (my_perl=0x834b008,
cv=0x86f7814) at Informix.xsi:44
#4 0x00278c55 in XS_DBI_dispatch () from
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBI/DBI.so
#5 0x0076c42d in Perl_pp_entersub () from /usr/lib/perl5/5.8.8/i386-
linux-thread-multi/CORE/libperl.so
#6 0x0076589f in Perl_runops_standard () from
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
#7 0x0070600e in ?? () from /usr/lib/perl5/5.8.8/i386-linux-thread-
multi/CORE/libperl.so
#8 0x0070a816 in Perl_call_sv () from /usr/lib/perl5/5.8.8/i386-linux-
thread-multi/CORE/libperl.so
#9 0x0070ab3b in Perl_call_list () from /usr/lib/perl5/5.8.8/i386-
linux-thread-multi/CORE/libperl.so
#10 0x0070c91e in perl_destruct () from /usr/lib/perl5/5.8.8/i386-linux-
thread-multi/CORE/libperl.so
#11 0x080491c7 in main ()
------------------------
This bug is reproducible only when the connection is disconnected from
the server (or on network failure) and then the script reconnects using
$dbh->connect without disconnecting first.
I did some debugging and I found that the problem is that the
dbd_ix_db_destroy is not cleaning when the connection is not active and
dbd_ix_link_delete is trying to access memory which was already
overwritten.
I think that this patch should fix the problem.
@@ -934,7 +934,7 @@
{
static const char function[] = "dbd_ix_db_destroy";
dbd_ix_enter(function);
- if (DBIc_is(imp_dbh, DBIcf_ACTIVE))
+ if (DBIc_is(imp_dbh, DBIcf_IMPSET))
dbd_ix_db_disconnect(dbh, imp_dbh);
DBIc_off(imp_dbh, DBIcf_IMPSET);
dbd_ix_exit(function);
However I'm not sure if this will not break something else.