Skip Menu |

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

Report information
The Basics
Id: 108236
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: mmagin [...] arubanetworks.com
Cc:
AdminCc:

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



Subject: result leak in pg_db_putcopyend
Date: Fri, 30 Oct 2015 22:26:59 +0000
To: "bug-DBD-Pg [...] rt.cpan.org" <bug-DBD-Pg [...] rt.cpan.org>
From: Mike Magin <mmagin [...] arubanetworks.com>
While tracking down a memory leak in long-running Perl daemons in our software, I noticed that repeatedly using a COPY statement and ->pg_putcopyend to insert data would steadily leak memory. Valgrind was especially helpful and pointed me to the PGgetResult calls in dbdimpl.c There seems to be a couple of loops where we retry PGgetResult until the result is NULL, but in doing so, we clobber the old value of the pointer and leak a result. The PG docs seem pretty insistent that all values returned by PGgetResult need to be eventually given to Pgclear or there will be leaks. Anyway, the attached patch solved my problem Thanks, Mike

Message body is not shown because sender requested not to inline it.

Thank you for the report and the patch! Applied in 8ca0f67807848143470178fb535ea53cdcd8aad2
Resolved in version 3.6.0