Re: Clang 3.3 Analyzer Results - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Clang 3.3 Analyzer Results
Date
Msg-id 1384208298.28663.YahooMailNeo@web162905.mail.bf1.yahoo.com
Whole thread Raw
Responses Re: Clang 3.3 Analyzer Results  (Peter Geoghegan <pg@heroku.com>)
Re: Clang 3.3 Analyzer Results  (Jeffrey Walton <noloader@gmail.com>)
List pgsql-hackers
[moving the discussion to pgsql-hackers]

Jeffrey Walton <noloader@gmail.com> wrote:

> The Analyzer is invoked with scan-build. Its used when compiling
> the package because it performs static analysis.
>
> The Santizers are invoked with the runtime flags. They are used
> with the `check` program because they perform dynamic analysis.
> The more self test the better.

Thanks for the recipes!

> ##############
> # Scan-view
>
> make distclean
>
> export CC="/usr/local/bin/clang"
> export CXX="/usr/local/bin/clang++"
>
> /usr/local/bin/scan-build/scan-build --use-analyzer=/usr/local/bin/clang ./configure
>
> /usr/local/bin/scan-build/scan-build --use-analyzer=/usr/local/bin/clang make

I'm currently capturing a text version of all the warnings from
this.  Will gzip and post when it finishes.  It's generating a lot
of warnings; I have no idea how many are PostgreSQL problems and
how many are false positives; will just post the whole set FWIW.  I
am using the 3.4 development nightly snapshot with these commands:

scan-build --use-analyzer=/usr/bin/clang ./configure --silent --prefix=$PWD/Debug --enable-debug --enable-cassert
--enable-depend--with-libxml --with-libxslt --with-openssl --with-perl --with-python 
scan-build --use-analyzer=/usr/bin/clang make -s world

> ##############
> # Sanitizers
>
> make distclean
>
> export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib/clang/3.3/lib/darwin/
> export CC=/usr/local/bin/clang
> export CXX=/usr/local/bin/clang++
> export CFLAGS="-g3 -fsanitize=address -fsanitize=undefined"
> export CXXFLAGS="-g3 -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr"
>
> ./configure
>
> make
>
> make check 2>&1 | asan_symbolize.py

I haven't tried this yet, but will have a go at it after I capture
the other.

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


pgsql-hackers by date:

Previous
From: Nigel Heron
Date:
Subject: Re: stats for network traffic WIP
Next
From: Josh Berkus
Date:
Subject: Re: pg_dump and pg_dumpall in real life