Clang 3.3 findings and Illegal Shifts

From: Jeffrey Walton <noloader(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Clang 3.3 findings and Illegal Shifts
Date: 2013-11-13 00:58:31
Message-ID: CAH8yC8mdYJcDQEV+GJGpaOMqx3ECEONgsH0xqC4EwGicEMrN3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

The recipe used to produce the findings is below.

*****

$ /usr/local/bin/clang -v
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

*****

make distclean

export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
export CFLAGS="-g3 -fsanitize=undefined"
export CXXFLAGS="-g3 -fsanitize=undefined -fno-sanitize=vptr"

./configure

make

make check

*****

...
creating directory
/home/jwalton/Desktop/postgresql-9.3.1/src/test/regress/./tmp_check/data
... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... localtime.c:127:20: runtime error:
left shift of negative value -1
ok
creating template1 database in
/home/jwalton/postgresql-9.3.1/src/test/regress/./tmp_check/data/base/1
... localtime.c:127:20: runtime error: left shift of negative value -1
relmapper.c:670:2: runtime error: left shift of negative value -1
ok
initializing pg_authid ... localtime.c:127:20: runtime error: left
shift of negative value -1
ok
initializing dependencies ... localtime.c:127:20: runtime error: left
shift of negative value -1
ok
creating system views ... localtime.c:127:20: runtime error: left
shift of negative value -1
ok
loading system objects' descriptions ... localtime.c:127:20: runtime
error: left shift of negative value -1
ok
creating collations ... localtime.c:127:20: runtime error: left shift
of negative value -1
ok
creating conversions ... localtime.c:127:20: runtime error: left shift
of negative value -1
ok
creating dictionaries ... localtime.c:127:20: runtime error: left
shift of negative value -1
ok
setting privileges on built-in objects ... localtime.c:127:20: runtime
error: left shift of negative value -1
ok
creating information schema ... localtime.c:127:20: runtime error:
left shift of negative value -1
localtime.c:127:20: runtime error: left shift of negative value -1
ok
loading PL/pgSQL server-side language ... localtime.c:127:20: runtime
error: left shift of negative value -1
ok
vacuuming database template1 ... localtime.c:127:20: runtime error:
left shift of negative value -1
pg_lzcompress.c:601:5: runtime error: left shift of negative value -68
pg_lzcompress.c:601:5: runtime error: left shift of negative value -68
pg_lzcompress.c:385:16: runtime error: left shift of negative value -68
pg_lzcompress.c:615:4: runtime error: left shift of negative value -68
pg_lzcompress.c:385:16: runtime error: left shift of negative value -37
pg_lzcompress.c:615:4: runtime error: left shift of negative value -37
pg_lzcompress.c:385:16: runtime error: left shift of negative value -37
pg_lzcompress.c:615:4: runtime error: left shift of negative value -37
pg_lzcompress.c:601:5: runtime error: left shift of negative value -37
inval.c:524:39: runtime error: left shift of negative value -1
relmapper.c:670:2: runtime error: left shift of negative value -1
ok
copying template1 to template0 ... localtime.c:127:20: runtime error:
left shift of negative value -1
relmapper.c:670:2: runtime error: left shift of negative value -1
inval.c:524:39: runtime error: left shift of negative value -1
ok
copying template1 to postgres ... localtime.c:127:20: runtime error:
left shift of negative value -1
ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Sync to disk skipped.
The data directory might become corrupt if the operating system crashes.

Success. You can now start the database server using:
...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2013-11-13 03:36:35 Re: BUG #8566: Postgres ODBC Driver 9.02.0100 (32 bits) cannot be used under WINDOWS 7 64 bits
Previous Message Jeffrey Walton 2013-11-12 23:10:28 Re: BUG #8588: Need work arounds for Apple unaligned access