Subject: | DBD::Sybase segfaults on exit |
DBD::Sybase segfaults on exit.
The following will always segfault as the script tries to exit:
use DBI;
my $dbh = DBI->connect('DBI:Sybase:server=192.168.1.101', 'user',
'pass') or die "unable to connect to server $DBI::errstr";
$dbh->do('USE TestDB');
$sth = $dbh->prepare('SELECT Name FROM NamesTable') or die "prepare
failed\n";
$sth->execute() or die "unable to execute query $query error $DBI::errstr";
$sth->finish();
$dbh->disconnect();
The fault occurs in dbdimp.c at line 4199 which is:
if (DBIc_DBISTATE(imp_dbh)->debug >= 3)
There are a number of the same calls in that function. A workaround is
to just comment all of them out (or delete them), as they only appear to
be debug related. The attached patch does that.
Subject: | dbdimp.c.patch |
4199,4201d4198
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3)
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy: called on %x...\n", imp_sth);
<
4204,4205d4200
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3)
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy: dirty set, skipping\n");
4217,4219d4211
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3) {
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy(): freeing imp_sth->statement\n");
< }
4231,4232d4222
< if (DBIc_DBISTATE(imp_dbh)->debug >= 4)
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " ct_cmd_drop() -> CS_COMMAND %x\n", imp_sth->cmd);
4242,4244d4231
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3)
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy(): blkCleanUp()\n");
<
4249,4251d4235
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3) {
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy(): connection closed: %d\n", ret);
< }
4255,4257d4238
< if (DBIc_DBISTATE(imp_dbh)->debug >= 3) {
< PerlIO_printf(DBIc_LOGPIO(imp_dbh), " syb_st_destroy(): reset inUse flag\n");
< }