> I'll mark this as "returned with feedback". I'd be happy to take a patch 
> that helps to reduce sanitizer complaints, but this seems to need some work.
> Aleksander, how did you run the sanitizer? I tried to build with clang 
> 4.0, with the -fsanitize=memory option, and ran "make 
> installcheck-parallel", but I didn't get any sanitizer errors out of it. 
> I did get some errors, from failing to load "regress.so", though:
> ERROR:  could not load library 
> "/home/heikki/git-sandbox-pgsql/master/src/test/regress/regress.so": 
> /home/heikki/git-sandbox-pgsql/master/src/test/regress/regress.so: 
> undefined symbol: __msan_va_arg_overflow_size_tls
> How did you do it?

It's quite simple actually [1][2]. I've just re-checked on Ubuntu 16.04
and Clang 3.8:

sudo apt-get install clang git make flex bison libreadline-dev \
  zlib1g-dev jade
git clone http://git.postgresql.org/git/postgresql.git
cd postgresql
CC=/usr/bin/clang CFLAGS="-fsanitize=memory -fPIE -pie" ./configure
make -j4 -s
MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.8 make check

Stacktraces are written to src/test/regress/log/initdb.log.

You can add `printf("%d\n", getpid())` and `sleep(1000)` calls somewhere
in main() procedure. It will give you some time to connect using debugger.
IIRC it's what I did.

[1] http://clang.llvm.org/docs/MemorySanitizer.html
[2] https://github.com/google/sanitizers/wiki/MemorySanitizer

Best regards,
Aleksander Alekseev

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to