Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 125590
Status: new
Priority: 0/
Queue: DBI

Owner: Nobody in particular
Requestors: davem [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: circular reference in DBI::DBD::SqlEngine::TieTables
Date: Fri, 15 Jun 2018 13:46:32 +0100
To: bug-DBI [...]
From: Dave Mitchell <davem [...]>
Download (untitled) / with headers
text/plain 1.3k
While debugging an issue with DBD::CSV and/or perl: I spotted code in DBI::DBD::SqlEngine::TieTables which appears to be creating a circular reference, and thus leaking. DBI::DBD::SqlEngine::TieTables::TIEHASH() creates a tie object hash, one of whose entries is a reference back to the $dbh handle. I don't understand this code well enough to be 100% certain its a leak, but it sure looks like a weaken() is in order. The following code definitely leaks, although that may be in part due to a bug in Text::CSV_XS which I have reported separately: (it requires editing 'f_dir' to point to an untarred DBD-CSV-0.53 directory) use strict; use warnings; use DBI; while (1) { my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_schema => undef, f_dir => '/home/davem/tmp-nobackup/dbd-csv-free/DBD-CSV-0.53/t', f_dir_search => [], f_ext => ".csv/r", f_lock => 2, f_encoding => "utf8", csv_auto_diag => 0, RaiseError => 1, PrintError => 1, FetchHashKeyName => "NAME_lc", }) or die "$DBI::errstr\n" || $DBI::errstr; } -- Art is anything that has a label (especially if the label is "untitled 1")

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to