[freetds] *** glibc detected *** double free orcorruption(fasttop): 0x08c919f8

Bort, Paul pbort at tmwsystems.com
Tue Apr 18 10:52:02 EDT 2006


> > 
> > I upgraded FreeTSD to 0.64RC2 and my scripts runs OK (I get my
> > results) but I get the following error/warning:
> > 
> > <snip>
> > done
> > *** glibc detected *** double free or corruption (fasttop): 
> > 0x08b6c9e0 ***
> > Aborted
> > </snip>
> > 
> > I get the same error if I use FreeTDS current snapshot. I 
> > also get the error
> > with the following configuration.
> > 
> > OS          - CentOS 4.3 x86_64
> > DBI         - 1.40
> > DBD::Sybase - 1.07
> > FreeTDS     - 0.64RC2 or current snapshot
> > ASE         - Adaptive Server Enterprise/12.5.3/EBF 13204 
> > ESD#6/P/Linux
> > 
> > If I comment out the line containing "$dbh->disconnect;" the script
> > doesn't generate this warning/error.
> > 
> > Did anyone encountered this kind of problem ? Can it be fixed ?
> > Thanks for any direction you can provide.
> > 
> 
> Adding a 
> 
>   $sth = undef;
> 
> before disconnect will remove the problem. The reason is that
> $dbh->prepare allocate a CS_COMMAND which is destroyed on ct_con_drop
> (called at $dbh->disconnect) so when $sth is freed is still 
> use a freed
> pointer... Now the problem is; what's the right behavior? I think
> however that right behavior is Sybase one...
> 

The DBI documentation
(http://search.cpan.org/~timb/DBI-1.50/DBI.pm#finish) suggests using
$sth->finish on all statement handles before disconnecting. I didn't
make the connection to the statement handle earlier because I've never
seen that glibc error message.

Regards,
Paul


More information about the FreeTDS mailing list