Issue with libarcher in the libomp-10-dev package
Joachim Protze
protze at itc.rwth-aachen.de
Fri May 15 16:36:30 BST 2020
Dear LLVM package maintainers,
I'm glad, that libarcher made it into a debian package. But
unfortunately it doesn't work.
The idea of Archer is to complement ThreadSanitizer and provide the
synchronization semantics for OpenMP. In a vanilla build of LLVM with
openmp, libarcher is loaded by the OpenMP runtime (libomp.so)
automatically and checks whether the TSan library is present in the
execution:
$ export ARCHER_OPTIONS=verbose=1
$ clang -fopenmp -fsanitize=thread red-norace.c -g
$ OMP_NUM_THREADS=2 ./a.out
Archer detected OpenMP application with TSan, supplying OpenMP
synchronization semantics
Sum: 4999950000
Using clang-10 from the package, there are several issues. First, the
archer library is not found as the library is not in the dl search path
$ clang-10 -fopenmp -fsanitize=thread red-norace.c -g
$ OMP_NUM_THREADS=2 ./a.out
... WARNING: ThreadSanitizer: data race ...
Creating a link in /lib/x86_64-linux-gnu should help for this.
The next issue (after I added the link):
$ OMP_NUM_THREADS=2 ./a.out
Archer detected OpenMP application without TSan stopping operation
... WARNING: ThreadSanitizer: data race ...
I could not figure out, why the archer library does not use the exported
dynamic symbols from the tsan runtime, which is statically linked into
the application:
$ readelf --dyn-syms a.out | grep RunningOnValgrind
529: 000000000048f6f0 18 FUNC GLOBAL DEFAULT 13
RunningOnValgrind
$ readelf --dyn-syms /usr/lib/llvm-10/lib/libarcher.so | grep
RunningOnValgrind
61: 0000000000002770 10 FUNC WEAK DEFAULT 12
RunningOnValgrind
$ readelf --dyn-syms /home/.../clang/10.0/lib/libarcher.so | grep
RunningOnValgrind
64: 0000000000002590 10 FUNC WEAK DEFAULT 12
RunningOnValgrind
I can successfully use clang-10 with my vanilla build of libarcher. So,
it seems like there is something funny going on with libarcher from the
deb package.
Finally, I'm not sure why the library should not be installed if
compiler and OpenMP runtime are installed. I can understand that
developers packages are not installed by default, but a compiler is
typically installed by developers?
Thanks in advance for looking into this.
Best
Joachim
--
Dipl.-Inf. Joachim Protze
IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074 Aachen (Germany)
Tel: +49 241 80- 24765
Fax: +49 241 80-624765
protze at itc.rwth-aachen.de
www.itc.rwth-aachen.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: red-norace.c
Type: text/x-csrc
Size: 180 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20200515/52af2e38/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5327 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20200515/52af2e38/attachment.bin>
More information about the Pkg-llvm-team
mailing list