From: Tom Lane <tgl@sss.pgh.pa.us>
To: icegood1980@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15627: libpq memory leak
Date: Sun, 10 Feb 2019 12:03:07 -0500
Message-ID: <25171.1549818187@sss.pgh.pa.us> (raw)
In-Reply-To: <15627-292cee37a2b87e13@postgresql.org>
References: <15627-292cee37a2b87e13@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> PQisBusy has memory leak with next valgrind stack:
> 1: malloc in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
> 2: PQmakeEmptyPGresult in
> /opt/src/postgres/src/interfaces/libpq/fe-exec.c:146
> 3: getRowDescriptions in
> /opt/src/postgres/src/interfaces/libpq/fe-protocol3.c:492
> 4: pqParseInput3 in
> /opt/src/postgres/src/interfaces/libpq/fe-protocol3.c:293
> 5: parseInput in /opt/src/postgres/src/interfaces/libpq/fe-exec.c:1747
> 6: PQisBusy in /opt/src/postgres/src/interfaces/libpq/fe-exec.c:1764
I don't believe this is actually a leak: what is happening is that
we're collecting the query result that will eventually be returned
by PQgetResult. If the calling program never calls PQgetResult
after PQisBusy, then tools like valgrind might claim that's a leak,
but the claim has nothing to do with reality.
If you think there's a real problem here, please show a self-contained
test case that causes steady increase in memory consumption.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, icegood1980@gmail.com
Subject: Re: BUG #15627: libpq memory leak
In-Reply-To: <25171.1549818187@sss.pgh.pa.us>
References: <15627-292cee37a2b87e13@postgresql.org> <25171.1549818187@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox