Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 80669
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: sveta.smirnova [...] oracle.com
Cc: pali [...] cpan.org
AdminCc:

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



Subject: BDB::mysql connect memory leak
Originally reported by Carlos Velasco at http://bugs.mysql.com/bug.php?id=66859 Description: DBD::mysql leaks memory when using connect Seems related to bug #60531 but I am seeing this with good password. How to repeat: Perl is 5.16.1 DBD::mysql is 4.022 DBI is 1.622 mysql is mysql-5.5.27.tar.gz Use this perl script: #!/usr/bin/perl use Devel::Leak; use DBI; use DBD::mysql; my $DLcount; my $DLhandle; my $con; my $con = DBI->connect('DBI:mysql:database=test;host=127.0.0.1', 'root', '', {PrintError => 0,PrintWarn=>0}); $DLcount = Devel::Leak::NoteSV($DLhandle); print "PRE 1 count: $DLcount\n"; undef $con; $con = DBI->connect('DBI:mysql:database=test;host=127.0.0.1', 'root', '', {PrintError => 0,PrintWarn=>0}); $DLcount = Devel::Leak::NoteSV($DLhandle); print "POST 1 count: $DLcount\n"; $DLcount = Devel::Leak::NoteSV($DLhandle); print "PRE 2 count: $DLcount\n"; undef $con; $con = DBI->connect('DBI:mysql:database=test;host=127.0.0.1', 'root', '', {PrintError => 0,PrintWarn=>0}); $DLcount = Devel::Leak::CheckSV($DLhandle); print "POST 2 count: $DLcount\n"; Output shows: # perl test.pl PRE 1 count: 12777 POST 1 count: 12778 PRE 2 count: 12778 new 0x7cce08 : SV = NULL(0x0) at 0x7cce08 REFCNT = 1 FLAGS = (PADSTALE,PADMY) new 0x743250 : SV = PVAV(0x8f38e8) at 0x743250 REFCNT = 1 FLAGS = (PADSTALE,PADMY) ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL) new 0x743b98 : SV = NULL(0x0) at 0x743b98 REFCNT = 1 FLAGS = (PADSTALE,PADMY) old (1): 0 SV = UNKNOWN(0xff) (0x743b80) at 0x7435c8 REFCNT = 0 FLAGS = () old (1): 0 SV = UNKNOWN(0xff) (0x7435c8) at 0x7430a0 REFCNT = 0 FLAGS = () POST 2 count: 12779 [18 Sep 15:39] Carlos Velasco But DBD::mysql leaks test shows ok # SLOW_TESTS=1 make test PERL_DL_NONLAZY=1 /usr/bin/perl-64 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base.t .................. ok ... t/60leaks.t ................. ok [18 Sep 16:00] Sveta Smirnova This is not duplicate of bug #60531 [18 Sep 18:12] Carlos Velasco It seems this problem has been there for long long ago: https://bugs.launchpad.net/ubuntu/+source/libdbd-mysql-perl/+bug/51746
Subject: DBD::mysql connect memory leak
RT-Send-CC: pali [...] cpan.org
I get different output, even on 4.022. PRE 1 count: 13067 POST 1 count: 13071 PRE 2 count: 13071 new 0x7ff0a2a45668 : new 0x7ff0a2a45758 : new 0x7ff0a2956878 : old (1): 0 old (1): 0 POST 2 count: 13072 @Pali, could you take a look?
On Štv Dec 01 03:33:20 2016, MICHIELB wrote: Show quoted text
> I get different output, even on 4.022. > > PRE 1 count: 13067 > POST 1 count: 13071 > PRE 2 count: 13071 > new 0x7ff0a2a45668 : > new 0x7ff0a2a45758 : > new 0x7ff0a2956878 : > old (1): > 0 > old (1): > 0 > POST 2 count: 13072
See: https://metacpan.org/pod/Devel::Leak CAVEATS: Note that you need a perl built with -DDEBUGGING for sv_dump() to print anything, but counts are valid in any perl. So this is probably reason why you do not see dumps. Show quoted text
> @Pali, could you take a look?
I'm getting result: PRE 1 count: 13033 POST 1 count: 13034 PRE 2 count: 13034 POST 2 count: 13035 So it mens that there is some leak. All new values have flags PADSTALE,PADMY except one: new 0x1d5cdf8 : SV = IV(0x1d5cde8) at 0x1d5cdf8 REFCNT = 1 FLAGS = () IV = 0 Which looks like that scalar leak... I spent some time to find it, but without luck. I have no idea where it is :-(