Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Fabien COELHO
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 ke

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Tom Lane
Fabien COELHO 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.

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Fabien COELHO
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

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Fabien COELHO
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) //')" ./upd

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Andres Freund
Hi, On 2019-04-11 09:35:23 -0400, Tom Lane wrote: > Michael Paquier 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

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Tom Lane
Michael Paquier 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

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Michael Paquier
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 version

Re: pgsql: Fix memory leak in pgbench

2019-04-11 Thread Fabien COELHO
Hello Tom, Thomas Munro 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 ha

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Masahiko Sawada
On Thu, Apr 11, 2019 at 12:58 PM Alvaro Herrera 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 w

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Masahiko Sawada
On Thu, Apr 11, 2019 at 1:54 PM Tom Lane wrote: > > Thomas Munro 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 any

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Tom Lane
Thomas Munro 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 on

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Alvaro Herrera
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

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Thomas Munro
On Wed, Apr 10, 2019 at 11:12 PM Michael Paquier 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. > >

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Michael Paquier
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 mor

Re: pgsql: Fix memory leak in pgbench

2019-04-10 Thread Masahiko Sawada
On Wed, Apr 10, 2019 at 3:10 PM Fabien COELHO 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 > >

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
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

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Andres Freund
On April 9, 2019 11:07:38 PM PDT, Michael Paquier 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 a

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
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 says: "Code in PostgreSQL should only re

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Michael Paquier
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 sign

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Masahiko Sawada
On Wed, Apr 10, 2019 at 2:00 AM Alvaro Herrera 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 mo

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Alvaro Herrera
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 n

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
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 removi

pgsql: Fix memory leak in pgbench

2019-04-09 Thread Alvaro Herrera
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,