Bug#961062: libmkl-rt: libmkl_rt.so should dlopen libiomp5.so with flag RTLD_GLOBAL

Celelibi celelibi at gmail.com
Tue May 19 19:39:50 BST 2020


Package: libmkl-rt
Version: 2020.1.217-2
Severity: normal

Dear Maintainer,

The library libmkl_rt.so seems to load libiomp5.so dynamically with a
call to dlopen that probably looks more-or-less like this:

dlopen("/usr/lib/x86_64-linux-gnu/libiomp5.so", RTLD_LAZY|RTLD_GLOBAL);

The use of the flag RTLD_GLOBAL place this library in the global scope
for the run-time symbol resolution.

This libiomp5 is provided by llvm and appear to try to be ABI-compatible
with the libgomp provided by gcc by defining the same symbols.

This may cause an issue when another library was linked against a
different version of libgomp. Some symbols might end up being
dynamically linked to libiomp5 and others to libgomp.

This happens in practice right now since for some OpenMP directives,
gcc-9 now generate calls to GOMP_loop_nonmonotonic_dynamic_next that
were calls to GOMP_loop_dynamic_next with gcc-8. Therefore, a library
compiled with gcc-9 and linked against libgomp would, at run time, have
its older symbols bound to libiomp5 while the newer would be bound to
the newer version of libgomp.

I guess the right thing to do fix this would be to not pollute the
global scope and always load libiomp5.so without the flag RTLD_GLOBAL.


Best regards,
Celelibi


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.6.0-1-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libmkl-rt depends on:
ii  debconf [debconf-2.0]                  1.5.74
ii  libatlas3-base [liblapack.so.3]        3.10.3-9
ii  libblas3 [libblas.so.3]                3.9.0-2
ii  libc6                                  2.30-4
ii  libgcc-5-dev                           5.5.0-12
ii  libgcc-6-dev                           6.5.0-1
ii  libgcc-7-dev                           7.5.0-5
ii  libgcc-8-dev                           8.4.0-3
ii  liblapack3 [liblapack.so.3]            3.9.0-2
ii  libmkl-locale                          2020.1.217-2
ii  libmkl-meta-computational              2020.1.217-2
ii  libmkl-meta-interface                  2020.1.217-2
ii  libmkl-meta-threading                  2020.1.217-2
ii  libomp-7-dev                           1:7.0.1-12
ii  libopenblas0-pthread [liblapack.so.3]  0.3.9+ds-1

libmkl-rt recommends no packages.

libmkl-rt suggests no packages.

-- debconf information:
* libmkl-rt/use-as-default-blas-lapack: true
* libmkl-rt/exact-so-3-selections: libblas.so.3, liblapack.so.3, libblas64.so.3, liblapack64.so.3,
  libmkl-rt/title:



More information about the debian-science-maintainers mailing list