Re: BUG #5590: undefined shift behavior - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5590: undefined shift behavior
Date
Msg-id 18394.1280765761@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5590: undefined shift behavior  (John Regehr <regehr@cs.utah.edu>)
Responses Re: BUG #5590: undefined shift behavior  (John Regehr <regehr@cs.utah.edu>)
Re: BUG #5590: undefined shift behavior  (John Regehr <regehr@cs.utah.edu>)
Re: BUG #5590: undefined shift behavior  (John Regehr <regehr@cs.utah.edu>)
List pgsql-bugs
John Regehr <regehr@cs.utah.edu> writes:
> On 08/02/2010 09:06 AM, Tom Lane wrote:
>> John: how did you detect this?

> One of my students has hacked Clang to detect integer undefined
> behaviors in C, like this shift problem or signed overflows.

Cool.

> This was
> the only problem that came up during a "make check" of a postgresql with
> this checking turned on, which is pretty cool.

Hrm, I'd have expected you to see a few integer overflows during the
regression tests --- we do test that the overflow checks in places
like int4pl work.  You might be interested in this concurrent thread:
http://archives.postgresql.org/pgsql-hackers/2010-08/msg00024.php
particularly the comments about overflow.

> I'd expect to be able to find more problems if I could get hold of a
> good fuzz tester for postgresql, or at least some much larger test
> inputs. Are there any of these you folks would suggest that I use?

Yeah, the PG regression tests aren't amazingly good coverage-wise
(although running the contrib tests as well as core helps --- did you
do that?).  I'm afraid I haven't got a good suggestion for you.

            regards, tom lane

pgsql-bugs by date:

Previous
From: John Regehr
Date:
Subject: Re: BUG #5590: undefined shift behavior
Next
From: John Regehr
Date:
Subject: Re: BUG #5590: undefined shift behavior