[llvm-bugs] [Bug 45945] New: libarcher does not work in the libomp-10-dev package

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 15 09:05:20 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45945

            Bug ID: 45945
           Summary: libarcher does not work in the libomp-10-dev package
           Product: Packaging
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: deb packages
          Assignee: unassignedbugs at nondot.org
          Reporter: protze at itc.rwth-aachen.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 23494
  --> https://bugs.llvm.org/attachment.cgi?id=23494&action=edit
Example OpenMP code with no data race, but false positive report in absense of
Archer

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 (as also
mentioned in bug 45909)
$ 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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200515/49881384/attachment.html>


More information about the llvm-bugs mailing list