From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Meskes <meskes@postgresql.org>
Cc: Dudley, Michael <mdudley@gryphonsensors.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14582: ecpg crashes on SQL input
Date: Thu, 09 Mar 2017 10:48:56 -0500
Message-ID: <20743.1489074536@sss.pgh.pa.us> (raw)
In-Reply-To: <1489071407.2338.19.camel@postgresql.org>
References: <20170308165659.25059.69634@wrigleys.postgresql.org>
<1489065869.2338.11.camel@postgresql.org>
<MWHPR05MB3486D9AB01252062ABC3694ACD210@MWHPR05MB3486.namprd05.prod.outlook.com>
<1489071407.2338.19.camel@postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Michael Meskes <meskes@postgresql.org> writes:
> Could you try the attached patch please?
Wow, that's certainly a bug fix, and it does stop the crash in 9.6 for me,
but I'm not sure that I follow how come the failure seems to be version-
and data-dependent. It looks like, because of this bug, you ought to
reliably have a double free() occurring any time there's more than one
dollar-quoted constant in ecpg's input. Why doesn't glibc notice?
I think that in most cases, the malloc block used for dolqstart would have
been handed out again for another temporary string by the time we reach
the second dollar-quoted constant, so the second free(dolqstart) in itself
wouldn't look like an error to glibc. But when the temporary string is
freed for real, a bit later, that should result in an error. Does ecpg
leak a large fraction of its temporary strings?
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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, meskes@postgresql.org, mdudley@gryphonsensors.com
Subject: Re: BUG #14582: ecpg crashes on SQL input
In-Reply-To: <20743.1489074536@sss.pgh.pa.us>
References: <20170308165659.25059.69634@wrigleys.postgresql.org> <1489065869.2338.11.camel@postgresql.org> <MWHPR05MB3486D9AB01252062ABC3694ACD210@MWHPR05MB3486.namprd05.prod.outlook.com> <1489071407.2338.19.camel@postgresql.org> <20743.1489074536@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