pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix memory leak in pgbench
23+ messages / 8 participants
[nested] [flat]

* pgsql: Fix memory leak in pgbench
@ 2019-04-09 17:00 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-09 17:28 ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 2 replies; 23+ messages in thread

From: Alvaro Herrera @ 2019-04-09 17:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix memory leak in pgbench

Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult
structs were not being freed during error bailout, because we're now
doing more PQgetResult() calls than previously.  Since there's more
cleanup code outside the discard_response() routine than in it, refactor
the cleanup code, removing the routine.

This has little effect currently, since we abandon processing after
hitting errors, but if we ever get further pgbench features (such as
testing for serializable transactions), it'll matter.

Per Coverity.

Reviewed-by: Michaël Paquier

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fe0e0b4fc7f0cdc2333bda08b199422a1e77a551

Modified Files
--------------
src/bin/pgbench/pgbench.c | 48 ++++++++++++++++++-----------------------------
1 file changed, 18 insertions(+), 30 deletions(-)



^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2019-04-09 17:28 ` Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-09 17:46   ` Re: pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@2ndquadrant.com>
  1 sibling, 1 reply; 23+ messages in thread

From: Fabien COELHO @ 2019-04-09 17:28 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers@lists.postgresql.org


Hello Alvaro,

> Fix memory leak in pgbench

> Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult
> structs were not being freed during error bailout, because we're now
> doing more PQgetResult() calls than previously.

Indeed, I did not consider cleaning up on errors when removing cset, and 
if errors are handled somehow it would have caused a problem.

Thanks for the fix. I could have prepared a patch if told that there was 
some problem, but it seems that pg coverity reports are private.

-- 
Fabien.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-09 17:28 ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
@ 2019-04-09 17:46   ` Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 23+ messages in thread

From: Alvaro Herrera @ 2019-04-09 17:46 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: pgsql-committers@lists.postgresql.org

Hello

On 2019-Apr-09, Fabien COELHO wrote:

> > Fix memory leak in pgbench
> 
> > Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult
> > structs were not being freed during error bailout, because we're now
> > doing more PQgetResult() calls than previously.
> 
> Indeed, I did not consider cleaning up on errors when removing cset, and if
> errors are handled somehow it would have caused a problem.
> 
> Thanks for the fix. I could have prepared a patch if told that there was
> some problem, but it seems that pg coverity reports are private.

They're indeed private.  In this case I could have opened it, since the
code is unreleased thus there's no security restriction, but since it's
so minor I didn't think it worthwhile.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2019-04-10 04:19 ` Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:07   ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 03:58   ` Re: pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@2ndquadrant.com>
  1 sibling, 3 replies; 23+ messages in thread

From: Masahiko Sawada @ 2019-04-10 04:19 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers@lists.postgresql.org

On Wed, Apr 10, 2019 at 2:00 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> Fix memory leak in pgbench
>
> Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult
> structs were not being freed during error bailout, because we're now
> doing more PQgetResult() calls than previously.  Since there's more
> cleanup code outside the discard_response() routine than in it, refactor
> the cleanup code, removing the routine.
>
> This has little effect currently, since we abandon processing after
> hitting errors, but if we ever get further pgbench features (such as
> testing for serializable transactions), it'll matter.
>

This change leads a compiler warning on my machine:

pgbench.c: In function ‘readCommandResponse’:
pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code

@@ -2739,7 +2726,7 @@ readCommandResponse(CState *st, char *varprefix)
    while (res != NULL)
    {
        /* look now at the next result to know whether it is the last */
-       PGresult    *next_res = PQgetResult(st->con);
+       next_res = PQgetResult(st->con);
        bool is_last = (next_res == NULL);

I think we should declare is_last before doing next_res = PQgetResult(st->con).

Attached patch fixes it.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachments:

pgbench.patch (application/octet-stream, 494B) download diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index b67ad5e..632d73c 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2725,9 +2725,11 @@ readCommandResponse(CState *st, char *varprefix) while (res != NULL) { + bool is_last; + /* look now at the next result to know whether it is the last */ next_res = PQgetResult(st->con); - bool is_last = (next_res == NULL); + is_last = (next_res == NULL); switch (PQresultStatus(res)) {
^ permalink raw reply [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
@ 2019-04-10 06:07   ` Michael Paquier <michael@paquier.xyz>
  2019-04-10 06:11     ` Re: pgsql: Fix memory leak in pgbench Andres Freund <andres@anarazel.de>
  2019-04-10 06:11     ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2 siblings, 2 replies; 23+ messages in thread

From: Michael Paquier @ 2019-04-10 06:07 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers@lists.postgresql.org

On Wed, Apr 10, 2019 at 01:19:11PM +0900, Masahiko Sawada wrote:
> This change leads a compiler warning on my machine:
> 
> pgbench.c: In function ‘readCommandResponse’:
> pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code

C99 does not forbid that (see d9dd406).
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:07   ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
@ 2019-04-10 06:11     ` Andres Freund <andres@anarazel.de>
  1 sibling, 0 replies; 23+ messages in thread

From: Andres Freund @ 2019-04-10 06:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org,Michael Paquier <michael@paquier.xyz>; Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>



On April 9, 2019 11:07:38 PM PDT, Michael Paquier <michael@paquier.xyz> wrote:
>On Wed, Apr 10, 2019 at 01:19:11PM +0900, Masahiko Sawada wrote:
>> This change leads a compiler warning on my machine:
>> 
>> pgbench.c: In function ‘readCommandResponse’:
>> pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code
>
>C99 does not forbid that (see d9dd406).

Our own set of standards do however. Note that we still have wdeclaration-after-statement in our compiler flags if supported by the compiler.  CF configure.in.

Andres


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:07   ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
@ 2019-04-10 06:11     ` Fabien COELHO <coelho@cri.ensmp.fr>
  1 sibling, 0 replies; 23+ messages in thread

From: Fabien COELHO @ 2019-04-10 06:11 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers@lists.postgresql.org


Bonjour Michaël,

>> This change leads a compiler warning on my machine:
>>
>> pgbench.c: In function ‘readCommandResponse’:
>> pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code
>
> C99 does not forbid that (see d9dd406).

https://www.postgresql.org/docs/devel/source-conventions.html also says:

"A few features included in the C99 standard are, at this time, not be 
permitted to be used in core PostgreSQL code. This currently includes 
variable length arrays, intermingled declarations and code, // comments, 
universal character names. Reasons for that include portability and 
historical practices."

-- 
Fabien.

^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
@ 2019-04-10 06:10   ` Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2 siblings, 1 reply; 23+ messages in thread

From: Fabien COELHO @ 2019-04-10 06:10 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers@lists.postgresql.org


Hello Masahiko-san,

> This change leads a compiler warning on my machine:
>
> pgbench.c: In function ‘readCommandResponse’:
> pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code

<https://www.postgresql.org/docs/devel/source-conventions.html; says:

"Code in PostgreSQL should only rely on language features available in the 
C99 standard"

So it should be all right wrt to warnings.

However the pg style in the same page says that intermingling decl & code 
is not permitted, so the proposed patch should be applied.

-- 
Fabien.

^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
@ 2019-04-10 07:05     ` Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 23+ messages in thread

From: Masahiko Sawada @ 2019-04-10 07:05 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers@lists.postgresql.org

On Wed, Apr 10, 2019 at 3:10 PM Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>
>
> Hello Masahiko-san,
>
> > This change leads a compiler warning on my machine:
> >
> > pgbench.c: In function ‘readCommandResponse’:
> > pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code
>
> <https://www.postgresql.org/docs/devel/source-conventions.html; says:
>
> "Code in PostgreSQL should only rely on language features available in the
> C99 standard"
>
> So it should be all right wrt to warnings.
>
> However the pg style in the same page says that intermingling decl & code
> is not permitted, so the proposed patch should be applied.

Thank you! I didn't know the detail of that PostgreSQL supports C99
standard but I hope the warning will be fixed and coming patches will
still obey that rule.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
@ 2019-04-10 11:12       ` Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  0 siblings, 1 reply; 23+ messages in thread

From: Michael Paquier @ 2019-04-10 11:12 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers@lists.postgresql.org

On Wed, Apr 10, 2019 at 04:05:34PM +0900, Masahiko Sawada wrote:
> Thank you! I didn't know the detail of that PostgreSQL supports C99
> standard but I hope the warning will be fixed and coming patches will
> still obey that rule.

Ah, thanks I missed that bit from the docs.  I should have paid more
attention.  I am sure that Álvaro will address your patch in a timely
manner.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
@ 2019-04-11 02:16         ` Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 23+ messages in thread

From: Thomas Munro @ 2019-04-11 02:16 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Masahiko Sawada <sawada.mshk@gmail.com>; Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

On Wed, Apr 10, 2019 at 11:12 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, Apr 10, 2019 at 04:05:34PM +0900, Masahiko Sawada wrote:
> > Thank you! I didn't know the detail of that PostgreSQL supports C99
> > standard but I hope the warning will be fixed and coming patches will
> > still obey that rule.
>
> Ah, thanks I missed that bit from the docs.  I should have paid more
> attention.  I am sure that Álvaro will address your patch in a timely
> manner.

. o O ( Is it time to run with -Werror on some BF animals yet? )

-- 
Thomas Munro
https://enterprisedb.com





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
@ 2019-04-11 04:53           ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 05:10             ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 2 replies; 23+ messages in thread

From: Tom Lane @ 2019-04-11 04:53 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; Masahiko Sawada <sawada.mshk@gmail.com>; Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

Thomas Munro <thomas.munro@gmail.com> writes:
> . o O ( Is it time to run with -Werror on some BF animals yet? )

I've got -Werror turned on on longfin; I'm surprised that it's not
whining about this.  Perhaps -Wdeclaration-after-statement doesn't
really do anything on clang?

Anyway, I'd be in favor of having at least one reasonably-recent-gcc
animal running with -Werror.  gcc and clang seem to have rather
different sets of warnings.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-11 05:10             ` Masahiko Sawada <sawada.mshk@gmail.com>
  1 sibling, 0 replies; 23+ messages in thread

From: Masahiko Sawada @ 2019-04-11 05:10 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Michael Paquier <michael@paquier.xyz>; Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

On Thu, Apr 11, 2019 at 1:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Thomas Munro <thomas.munro@gmail.com> writes:
> > . o O ( Is it time to run with -Werror on some BF animals yet? )
>
> I've got -Werror turned on on longfin; I'm surprised that it's not
> whining about this.  Perhaps -Wdeclaration-after-statement doesn't
> really do anything on clang?
>
> Anyway, I'd be in favor of having at least one reasonably-recent-gcc
> animal running with -Werror.  gcc and clang seem to have rather
> different sets of warnings.

+1

FWIW, I've found at least grouse[1] and koreaceratops[2] using gcc
4.4.7 (not recent though) complains this warning.

[1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=grouse&dt=2019-04-10%2009%3A06%3A0...
[2] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=koreaceratops&dt=2019-04-10%2007%3...

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-11 07:03             ` Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 23+ messages in thread

From: Fabien COELHO @ 2019-04-11 07:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Michael Paquier <michael@paquier.xyz>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>


Hello Tom,

> Thomas Munro <thomas.munro@gmail.com> writes:
>> . o O ( Is it time to run with -Werror on some BF animals yet? )
>
> I've got -Werror turned on on longfin; I'm surprised that it's not
> whining about this.  Perhaps -Wdeclaration-after-statement doesn't
> really do anything on clang?
>
> Anyway, I'd be in favor of having at least one reasonably-recent-gcc
> animal running with -Werror.  gcc and clang seem to have rather
> different sets of warnings.

Yep. Hopefully non contradictory:-)

I can set up farm animals with bleeding age clang/gcc (compiled weekly 
from sources) with -Werror (seawasp & moonjelly are already running with 
those but without -Werror).

However, I'm not sure how motivated the project is with keeping up with 
the latest warnings, there could be some instability, it may require some 
adjustements, but they are a glimpse of what is to come, so maybe a less 
bleeding edge set of compilers should be selected.

-- 
Fabien.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
@ 2019-04-11 08:23               ` Michael Paquier <michael@paquier.xyz>
  2019-04-11 13:35                 ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 16:36                 ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 2 replies; 23+ messages in thread

From: Michael Paquier @ 2019-04-11 08:23 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

On Thu, Apr 11, 2019 at 09:03:19AM +0200, Fabien COELHO wrote:
> I can set up farm animals with bleeding age clang/gcc (compiled weekly from
> sources) with -Werror (seawasp & moonjelly are already running with those
> but without -Werror).

If possible, I would not recommend using compiled versions from
source, but just the latest stable versions released for gcc and 
clang.  Even if this can catch up compiler bugs using Postgres code at
a very early stage, the false positives induced have been proving to
hurt because of the time investigations took to determine if this was
a problem on our side or not.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
@ 2019-04-11 13:35                 ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 15:52                   ` Re: pgsql: Fix memory leak in pgbench Andres Freund <andres@anarazel.de>
  1 sibling, 1 reply; 23+ messages in thread

From: Tom Lane @ 2019-04-11 13:35 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

Michael Paquier <michael@paquier.xyz> writes:
> On Thu, Apr 11, 2019 at 09:03:19AM +0200, Fabien COELHO wrote:
>> I can set up farm animals with bleeding age clang/gcc (compiled weekly from
>> sources) with -Werror (seawasp & moonjelly are already running with those
>> but without -Werror).

> If possible, I would not recommend using compiled versions from
> source, but just the latest stable versions released for gcc and 
> clang.  Even if this can catch up compiler bugs using Postgres code at
> a very early stage, the false positives induced have been proving to
> hurt because of the time investigations took to determine if this was
> a problem on our side or not.

Yeah, I'm not excited about having to expend effort on working around
warnings seen only in unstable compilers.  I was thinking more of
using some solid-but-not-ancient gcc release.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 13:35                 ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-11 15:52                   ` Andres Freund <andres@anarazel.de>
  2019-04-11 16:07                     ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 1 reply; 23+ messages in thread

From: Andres Freund @ 2019-04-11 15:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Michael Paquier <michael@paquier.xyz>; Fabien COELHO <coelho@cri.ensmp.fr>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

Hi,

On 2019-04-11 09:35:23 -0400, Tom Lane wrote:
> Michael Paquier <michael@paquier.xyz> writes:
> > On Thu, Apr 11, 2019 at 09:03:19AM +0200, Fabien COELHO wrote:
> >> I can set up farm animals with bleeding age clang/gcc (compiled weekly from
> >> sources) with -Werror (seawasp & moonjelly are already running with those
> >> but without -Werror).
> 
> > If possible, I would not recommend using compiled versions from
> > source, but just the latest stable versions released for gcc and 
> > clang.  Even if this can catch up compiler bugs using Postgres code at
> > a very early stage, the false positives induced have been proving to
> > hurt because of the time investigations took to determine if this was
> > a problem on our side or not.
> 
> Yeah, I'm not excited about having to expend effort on working around
> warnings seen only in unstable compilers.  I was thinking more of
> using some solid-but-not-ancient gcc release.

I could easily add that to one of EXEC_BACKEND or -DDCOPY_PARSE_PLAN_TREES
-DRAW_EXPRESSION_COVERAGE_TEST, --disable-atomics, --disable-spinlocks
animals. I'd probably go for one of the latter, because they tend to
break very rarely for other reasons these days.

While the buildfarm page says they run gcc 6, it's actually just the
latest stable release, updated regularly.

I kinda wish the buildfarm wouldn't require manually updating compiler
versions...

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 13:35                 ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 15:52                   ` Re: pgsql: Fix memory leak in pgbench Andres Freund <andres@anarazel.de>
@ 2019-04-11 16:07                     ` Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 0 replies; 23+ messages in thread

From: Fabien COELHO @ 2019-04-11 16:07 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Michael Paquier <michael@paquier.xyz>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>


> I kinda wish the buildfarm wouldn't require manually updating compiler
> versions...

It does not. My cron script uses the update script to keep them up to 
date:

  ./update_personality.pl --config=$PG/moonjelly.conf --compiler-version="$(gcc --version | head -1 | sed 's/gcc (GCC) //')"
  ./update_personality.pl --config=$PG/seawasp.conf --compiler-version="$(clang --version | head -1 | sed 's/^clang version //')"

-- 
Fabien.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
@ 2019-04-11 16:36                 ` Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 17:17                   ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 23+ messages in thread

From: Fabien COELHO @ 2019-04-11 16:36 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>


>> I can set up farm animals with bleeding age clang/gcc (compiled weekly from
>> sources) with -Werror (seawasp & moonjelly are already running with those
>> but without -Werror).
>
> If possible, I would not recommend using compiled versions from
> source, but just the latest stable versions released for gcc and
> clang.

Yep, but I'm a compiler person, so I'm happy with compiling bleeding edge 
pg with bleeding edge gcc & clang.

Note that there is also "caiman" running a non release gcc version.

> Even if this can catch up compiler bugs using Postgres code at
> a very early stage,

Indeed, several times, and they were reported and fixed.

> the false positives induced have been proving to hurt because of the 
> time investigations took to determine if this was a problem on our side 
> or not.

ISTM that the answer is that they are experimental animals, hence the 
choice of stingy jellyfish names, and failures should not be investigated 
immediately.

Maybe some "experimental" warning could be shown somewhere as a reminder? 
I can add it in the compiler version, something like:

   "Ubuntu 18.04.2 LTS **EXPERIMENTAL** gcc ..."

-- 
Fabien.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 16:36                 ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
@ 2019-04-11 17:17                   ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-12 06:57                     ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 1 reply; 23+ messages in thread

From: Tom Lane @ 2019-04-11 17:17 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Michael Paquier <michael@paquier.xyz>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>

Fabien COELHO <coelho@cri.ensmp.fr> writes:
> Maybe some "experimental" warning could be shown somewhere as a reminder? 
> I can add it in the compiler version, something like:
>    "Ubuntu 18.04.2 LTS **EXPERIMENTAL** gcc ..."

+1.  Also you might consider marking that in a "note" for the
animal.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 06:10   ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-10 07:05     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-10 11:12       ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 02:16         ` Re: pgsql: Fix memory leak in pgbench Thomas Munro <thomas.munro@gmail.com>
  2019-04-11 04:53           ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-11 07:03             ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 08:23               ` Re: pgsql: Fix memory leak in pgbench Michael Paquier <michael@paquier.xyz>
  2019-04-11 16:36                 ` Re: pgsql: Fix memory leak in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  2019-04-11 17:17                   ` Re: pgsql: Fix memory leak in pgbench Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-12 06:57                     ` Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 0 replies; 23+ messages in thread

From: Fabien COELHO @ 2019-04-12 06:57 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Michael Paquier <michael@paquier.xyz>; Thomas Munro <thomas.munro@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>


Hello Tom,

>> I can add it in the compiler version, something like:
>>    "Ubuntu 18.04.2 LTS **EXPERIMENTAL** gcc ..."
>
> +1.

Done, should be seen on next run.

The list of compilers is accumulating on the "Members" page for caiman, 
handfish, moonjelly and seawasp. Not sure how useful it is to keep an 
extended history for quickly moving targets.

I'd be interested in running corresponding -Werror animals, which would be 
likely to be in the red, if it would be acceptable with some 
**EXPERIMENTAL** or even **IGNORE** warning. Hmmm, probably people like to 
see an all green status page.

> Also you might consider marking that in a "note" for the animal.

I have, but have not found where to put an animal note.

-- 
Fabien.





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
@ 2019-04-11 03:58   ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2019-04-11 05:11     ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2 siblings, 1 reply; 23+ messages in thread

From: Alvaro Herrera @ 2019-04-11 03:58 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: pgsql-committers@lists.postgresql.org

On 2019-Apr-10, Masahiko Sawada wrote:

> This change leads a compiler warning on my machine:
> 
> pgbench.c: In function ‘readCommandResponse’:
> pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code

> I think we should declare is_last before doing next_res = PQgetResult(st->con).
> 
> Attached patch fixes it.

Thanks, pushed.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 23+ messages in thread

* Re: pgsql: Fix memory leak in pgbench
  2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
  2019-04-10 04:19 ` Re: pgsql: Fix memory leak in pgbench Masahiko Sawada <sawada.mshk@gmail.com>
  2019-04-11 03:58   ` Re: pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2019-04-11 05:11     ` Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 0 replies; 23+ messages in thread

From: Masahiko Sawada @ 2019-04-11 05:11 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>

On Thu, Apr 11, 2019 at 12:58 PM Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
>
> On 2019-Apr-10, Masahiko Sawada wrote:
>
> > This change leads a compiler warning on my machine:
> >
> > pgbench.c: In function ‘readCommandResponse’:
> > pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code
>
> > I think we should declare is_last before doing next_res = PQgetResult(st->con).
> >
> > Attached patch fixes it.
>
> Thanks, pushed.
>

Thank you!

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center





^ permalink  raw  reply  [nested|flat] 23+ messages in thread


end of thread, other threads:[~2019-04-12 06:57 UTC | newest]

Thread overview: 23+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 17:00 pgsql: Fix memory leak in pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
2019-04-09 17:28 ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-09 17:46   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2019-04-10 04:19 ` Masahiko Sawada <sawada.mshk@gmail.com>
2019-04-10 06:07   ` Michael Paquier <michael@paquier.xyz>
2019-04-10 06:11     ` Andres Freund <andres@anarazel.de>
2019-04-10 06:11     ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-10 06:10   ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-10 07:05     ` Masahiko Sawada <sawada.mshk@gmail.com>
2019-04-10 11:12       ` Michael Paquier <michael@paquier.xyz>
2019-04-11 02:16         ` Thomas Munro <thomas.munro@gmail.com>
2019-04-11 04:53           ` Tom Lane <tgl@sss.pgh.pa.us>
2019-04-11 05:10             ` Masahiko Sawada <sawada.mshk@gmail.com>
2019-04-11 07:03             ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-11 08:23               ` Michael Paquier <michael@paquier.xyz>
2019-04-11 13:35                 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-04-11 15:52                   ` Andres Freund <andres@anarazel.de>
2019-04-11 16:07                     ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-11 16:36                 ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-11 17:17                   ` Tom Lane <tgl@sss.pgh.pa.us>
2019-04-12 06:57                     ` Fabien COELHO <coelho@cri.ensmp.fr>
2019-04-11 03:58   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2019-04-11 05:11     ` Masahiko Sawada <sawada.mshk@gmail.com>

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