Re: Clang 3.3 findings and Illegal Shifts

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, Jeffrey Walton <noloader(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Clang 3.3 findings and Illegal Shifts
Date: 2013-11-14 14:20:20
Message-ID: 1384438820.6535.YahooMailNeo@web162905.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2013-11-12 19:58:31 -0500, Jeffrey Walton wrote:

>> Here are Clang 3.3 findings regarding illegal shifts. The code
>> will be subject to removal by the compiler and optimizer (and
>> linker if LTO is used).

> Those all seem to be runtime errors, so they aren't likely to be
> removed by the compiler. That's not to say they shouldn't be
> looked at though.

Attached are the runtime errors I got from using the clang 3.4
sanitizer with make check-world.  I poked around some web search
results and found that according to the C99 spec, these seemed to
be flagging non-portable code.  I doubt that the issue impacts any
currently-supported platforms, which is why I set it aside until I
saw this thread; but it might some day affect the ability to
support some new platform.

These runtime tests can't be considered complete because the
sanitizer chose to crash things five times when it found things it
didn't like.  What it disliked was not immediately clear to me, but
I'll attach those, too.  Four of the five are identical for the
first 20 lines in the stack trace, with similarities for a few
lines past that.  Also attached, FWIW.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
clang-sanitizer-runtime-error.txt text/plain 8.6 KB
clang-sanitizer-1.txt text/plain 5.7 KB
clang-sanitizer-4.txt text/plain 5.9 KB
clang-sanitizer-3.txt text/plain 6.1 KB
clang-sanitizer-2.txt text/plain 5.7 KB
clang-sanitizer-5.txt text/plain 5.8 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2013-11-14 20:31:55 Re: be-secure.c and SSL/TLS
Previous Message Rene Grün 2013-11-14 09:32:59 BUG #8579: CoreDump of background writer process