Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: davem [...] iabyn.com
Cc:
AdminCc:

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 [...] rt.cpan.org
From: Dave Mitchell <davem [...] iabyn.com>
While debugging an issue with DBD::CSV and/or perl: https://rt.perl.org/Ticket/Display.html?id=133270 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")