Re: Patch: Implement failover on libpq connect level.

From: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter van Hardenberg <pvh(at)pvh(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-10-27 13:46:05
Message-ID: CAD__OujSGmLNZ_qw+v3aL-fDXxWSjrXd209+efGmZHMwzwTfdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Wed, Oct 26, 2016 at 8:49 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Let me know your thoughts.

One small issue. I tried to run make installcheck after applying patch
there seems to be a invalid write access in code (resulting in crash).

==118997== Invalid write of size 1
==118997== at 0x4E3DDF1: connectOptions2 (fe-connect.c:884)
==118997== by 0x4E3D6FF: PQconnectStartParams (fe-connect.c:608)
==118997== by 0x4E3D553: PQconnectdbParams (fe-connect.c:465)
==118997== by 0x413067: main (startup.c:245)
==118997== Address 0x5dc4014 is 0 bytes after a block of size 4 alloc'd
==118997== at 0x4C29BFD: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==118997== by 0x4E3DD3C: connectOptions2 (fe-connect.c:880)
==118997== by 0x4E3D6FF: PQconnectStartParams (fe-connect.c:608)
==118997== by 0x4E3D553: PQconnectdbParams (fe-connect.c:465)
==118997== by 0x413067: main (startup.c:245)

After locally fixing this by allocating an extra space for string terminal
character. make installcheck tests pass.
-(char *) malloc(sizeof(char) * (e - s));
+ (char *) malloc(sizeof(char) * (e - s + 1));

--
Thanks and Regards
Mithun C Y
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Claudio Freire 2016-10-27 15:54:26 Re: CLUSTER, reform_and_rewrite_tuple(), and parallelism
Previous Message Michael Paquier 2016-10-27 13:05:45 Re: [BUG] pg_basebackup from disconnected standby fails

Browse pgsql-jdbc by date

  From Date Subject
Next Message Robert Haas 2016-10-27 17:45:57 Re: Patch: Implement failover on libpq connect level.
Previous Message Robert Haas 2016-10-26 15:19:39 Re: Patch: Implement failover on libpq connect level.