Re: [BUGS] BUG #14582: ecpg crashes on SQL input - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14582: ecpg crashes on SQL input
Date
Msg-id 22575.1489077250@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14582: ecpg crashes on SQL input  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #14582: ecpg crashes on SQL input  (Michael Meskes <meskes@postgresql.org>)
List pgsql-bugs
I wrote:
> 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?

After some googling, the answer seems to be that glibc's detection of
double free() is really unreliable for small chunks.  It will basically
only notice an extra free of the same chunk most recently freed within a
given bin (size range).  Since in the problem at hand there are probably
unrelated free's happening between the two free's mentioning the same
chunk, it's quite easy for it to miss the error.  I'm still a bit unsure
why I see the crash in 9.6 but not HEAD, because there's very little
difference between them, but I no longer feel that we need to investigate
more closely.

This all suggests that it might be worth testing ecpg with a debugging
malloc library that has more robust error detection ...

            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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14582: ecpg crashes on SQL input
Next
From: Michael Meskes
Date:
Subject: Re: [BUGS] BUG #14582: ecpg crashes on SQL input