Re: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com
Cc: thomas(dot)munro(at)enterprisedb(dot)com, maumau307(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org, meskes(at)postgresql(dot)org
Subject: Re: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Date: 2018-06-25 08:02:37
Message-ID: 20180625.170237.198949459.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello. Thank you for commiting this, Thomas.

At Mon, 18 Jun 2018 07:25:13 +0000, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote in <0A3221C70F24FB45833433255569204D1FA1BCD9(at)G01JPEXMBYT05>
> > > I want some remedy for older releases. Our customer worked around this
> > problem by getting a libpq connection in their ECPG application and calling
> > PQfreemem(). That's an ugly kludge, and I don't want other users to follow
> > it.
> > >
> > > I don't see a problem with back-patching as-is, because existing users
> > who just call free() or don't call free() won't be affected. I think that
> > most serious applications somehow state their supported minor releases like
> > "this application supports (or is certified against) PostgreSQL 10.5 or
> > later", just like other applications support "RHEL 6.2 or later" or "Windows
> > XP Sp2 or later."
> >
> > If there is a consensus that we should do that then I'll back-patch,
> > but so far no one else has spoken up in support.
>
> I'll follow the community decision. But I'm afraid that not
> enough people will comment on this to call it a consensus,
> because this topic will not be interesting...

ECPG x Windows makes very small cardinarity even if it is not
zero. Anyway the vast majority of deverloper here are only
working on Unix like OSes. So only two or three persons can make
consensus on this issue:p

> FWIW, I thought back-patching would make committers' future
> burdon smaller thanks to the smaller difference in the code of
> multiple major versions.

However I also don't see a problem to back-patch it, I don't see
a problem on such difference between versions.

I vote for back-patching this up to 9.5 (quite arbitrary..) but
it is fine for me if the documentation of 9.6 and earlier mention
a restriction like "For Windows environment, the application may
crash when it is using free() to the return values from
PGTYPES*_to_ascii functions. Make sure to use the same version of
CRT libray with the ECPG compiler in the case."

.. Is there any means to find the library version on the
installed environment?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2018-06-25 08:16:10 RE: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Previous Message Michael Paquier 2018-06-25 07:18:18 Re: Fix some error handling for read() and errno