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

From John Regehr
Subject Re: BUG #5590: undefined shift behavior
Date
Msg-id 4C56F6C6.70704@cs.utah.edu
Whole thread Raw
In response to Re: BUG #5590: undefined shift behavior  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> 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.

I saw no signed overflows.  Our patch still has some rough edges, but
this part is pretty well tested.

Perhaps the int4pl checks fire before the overflowing operation can be
performed, stopping them from happening?

Anyway when I get a bit of time I'll stub out the checks and make sure
that I see some checks firing.

>  You might be interested in this concurrent thread:
> http://archives.postgresql.org/pgsql-hackers/2010-08/msg00024.php
> particularly the comments about overflow.

Thanks.  I've been corresponding with Neil about this a bit.

Nice to hear that Clang has -fwrapv now, I hadn't known about that.

> 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.

I haven't tried the contrib tests, I'll do that, thanks.

Sooner or later we'll push our patch into LLVM and then anyone testing
your code can help out.

Just randomly: it's trivial to compile postgresql using clang on OSX.
However, I cannot get it to work on Linux with or without Peter
Eisentraut's patches.  It's no big deal since I have a Mac sitting
around but I could get stuff done faster on Linux!

John

pgsql-bugs by date:

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