Bug#693269: liblapack-dev: Some routines produce incorrect results in multithreaded environment

Victor Liu vkl at stanford.edu
Wed Nov 14 22:14:53 UTC 2012


Package: liblapack-dev
Version: 3.3.1-1
Severity: normal
Tags: upstream

Dear Maintainer,

When writing code that uses Lapack as well as threads (pthreads or OpenMP),
certain routines, like the nonsymmetric eigensolver, produce incorrect results
due to statically allocated arrays. The Lapack source uses large local arrays
which are deemed by gfortran (by default) to be too large to allocate on the
stack, leading to statically allocated variables which are corrupted when
multiple threads write to them. Adding the "-frecursive" flag to the
compilation flags would force gfortran to always allocate the arrays on the
stack. The problem along with code to reproduce it has been listed in this
forum post:
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=1930

The most ideal solution to the problem would be to modify the code to not use
huge local arrays, but the API makes it impossible for several routines.
Therefore, the use of compilation flags is a more immediate, but less elegant,
fix.

While I do not expect the addition of the flag to cause any side effects, there
are a number of potential concerns. FIrst, more stack space will be used by the
library. However, it will only be about a factor of 2 greater than the current
situation, since the default variable size limit is 32KB, and the largest
arrays in Lapack are around 64KB, and process stack size limits are in the
range of several MB. Second, if this bug is fixed in Debian and its
derivatives, porting scientific code that is affected by this bug to other
systems may lead to confusion if the bug still exists with other
platforms/compilers.



-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 'precise')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-23-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages liblapack-dev depends on:
ii  libatlas-base-dev [libblas-3gf.so]  3.8.4-3build1
ii  libblas-dev [libblas-3gf.so]        1.2.20110419-2ubuntu1
ii  liblapack3gf                        3.3.1-1
ii  libopenblas-dev [libblas-3gf.so]    0.1alpha2.2-3

liblapack-dev recommends no packages.

liblapack-dev suggests no packages.

-- no debconf information



More information about the debian-science-maintainers mailing list