Re: Bug in bttext_abbrev_convert()

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Bug in bttext_abbrev_convert()
Date: 2015-07-01 04:39:57
Message-ID: CAB7nPqQe0au3f=uH6FDexM_yam6pAF0g23H0Me2NC1yo5VstpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 1, 2015 at 9:36 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Tue, Jun 30, 2015 at 5:25 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
>> Isn't this the kind of thing Coverty's supposed to find?
>
> I don't know, but in general I'm not very excited about static
> analysis tools. The best things that they have going for them is that
> they're available, and don't require test coverage in the same way as
> running the regression tests with Valgrind enabled.

Well, yes. It should have complained about that if it were a perfect
tool able to emulate all code paths with all possible variable values.
But Coverity is not actually that perfect, and sometimes it misses the
shot, like here. by experience when you look at reports of a static
tool, you need to have a look first at other code paths that share
similarities with the problem reported, and you will actually see that
most of the time what the static tool saw is just the tip of the
iceberg. The human factor is determinant in this case.

> There is no real testing of sorting in the regression tests. It would
> be nice to have a way of generating a large and varied selection of
> sort operations programmatically, to catch this kind of thing.
> pg_regress is not really up to it. The same applies to various other
> cases where having a lot of "expected" output makes using pg_regress
> infeasible.

Well, the issue is double here:
1) Having a buildfarm member with valgrind would greatly help.
2) This code path is not used at all AFAIK in the test suite, so we
definitely lack regression tests here. In your opinion what would be a
sort set large enough to be able to trigger this code path? The idea
is to not make the regression test suite take too much time because of
it, and not to have the server created by pg_regress running the
regression tests having a too large PGDATA folder. For example, could
a btree index do it with a correct data set do it on at least one
platform?
Regards,
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Piotr Stefaniak 2015-07-01 05:12:38 Re: NULL passed as an argument to memcmp() in parse_func.c
Previous Message Fujii Masao 2015-07-01 03:39:11 WAL-related tools and .paritial WAL file