[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