Re: Clang 3.3 Analyzer Results

Поиск
Список
Период
Сортировка
От Jeffrey Walton
Тема Re: Clang 3.3 Analyzer Results
Дата
Msg-id CAH8yC8mSzkxCLtreQFbiayGF-rexZ0dc6GvHO+pXjsqAhFmGAg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Clang 3.3 Analyzer Results  ("Tomas Vondra" <tv@fuzzy.cz>)
Ответы Re: Clang 3.3 Analyzer Results
Список pgsql-general
On Mon, Nov 11, 2013 at 2:00 AM, Tomas Vondra <tv@fuzzy.cz> wrote:
>
>> Would someone know the best way to get this to the right folks?
>>
>> Thanks in advance. (And sorry reporting to pgsql-general - the
>> developer list states emails must go elsewhere first).
>
> IMHO pgsql-hackers is the right audience for reports like this. The 'must
> ask somewhere else first' is meant for regular questions that are not that
> closely related to postgresql development, and are likely to be answered
> in the generic mailing lists.
>
> Please, upload the HTML report somewhere and post a link. If it's easier
> to the clang analysis, maybe post instructions on how to do that.
The instructions are kind of easy when they are given as a recipe.
They get a little more involved when they steps have to be explained.

The recipes are below and include building Clang 3.3 from sources. The
Clang recipe lacks a couple of copies - for example,
`asan_symbolize.py` needs to be copied into $PREFIX because `make
install` does not do it. Keep the build directory around until you
have everything you need.

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.

Jeff

##############
# Clang 3.3

# Run from a scratch directory, delete when finished

wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz
wget http://llvm.org/releases/3.3/compiler-rt-3.3.src.tar.gz
# wget http://llvm.org/releases/3.3/lldb-3.3.src.tar.gz
tar xvf llvm-3.3.src.tar.gz
cd llvm-3.3.src/tools
tar xvf ../../cfe-3.3.src.tar.gz
mv cfe-3.3.src clang
# tar xvf ../../lldb-3.3.src.tar.gz
# mv lldb-3.3.src/ lldb
cd ..
cd projects
tar xvf ../../compiler-rt-3.3.src.tar.gz
mv compiler-rt-3.3.src/ compiler-rt
cd ..
./configure --enable-optimized --prefix=/usr/local
make -j4
sudo make install

# Install does not install scan-build and scan-view
# Perform the copy, and/or put them on-path
sudo mkdir /usr/local/bin/scan-build
sudo cp -r tools/clang/tools/scan-build /usr/local/bin
sudo mkdir /usr/local/bin/scan-view
sudo cp -r tools/clang/tools/scan-view /usr/local/bin

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

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


В списке pgsql-general по дате отправления:

Предыдущее
От: Leonardo Carneiro
Дата:
Сообщение: Re: Is it advisable to pg_upgrade directly from 9.0 to 9.3?
Следующее
От: J Smith
Дата:
Сообщение: Errors regarding non-existent files in pg_subtrans