Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionOrion Poplawski
2015-01-06 03:27:15 UTC
+++ This bug was initially created as a clone of Bug #1172834 +++
Description of problem:
ATLAS xerbla exits on error. Numpy normally overrides that function, but that seems to no longer work in fedora 21.
How reproducible: Always
Steps to Reproduce:
charris@localhost [~]$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
** On entry to DLASCL parameter number 4 had an illegal value
charris@localhost [~]$
Expected results:
Raises an error and Python continues.
Additional info:
You might be building ATLAS with -Wl,-Bsymbolic-functions, which will cause the problem.
--- Additional comment from charles harris on 2014-12-10 16:15:15 EST ---
The numpy is locally built and linked to libtatlas. I note that Fedora numpy is linked to libsatlas, not sure why.
--- Additional comment from Frantisek Kluknavsky on 2014-12-12 08:31:08 EST ---
I can confirm the different behavior of numpy between f20 and f21. Problem does not seem to be in atlas, my mini-example with custom xerbla works fine, with both satlas and tatlas. Compiled with Makefile:
CC=gcc
F90=gfortran
test: main.o routines.o Makefile
$(CC) -o test main.o routines.o -lm -lgfortran -L/usr/lib64/atlas -ltatlas
%.o: %.c
$(CC) -Wall -O2 -g -c $< -o $@
%.o: %.f90
$(F90) -Wall -O2 -g -c $< -o $@
Call dgemm('','n',m,n,k,1.0,a,m,b,k,0.0,c,m) with wrong first parameter kills the process - default xerbla. With
subroutine xerbla(SRNAME, INFO)
CHARACTER*(*) SRNAME
INTEGER INFO
PRINT *, "Hello World!"
end subroutine xerbla
in routines.f90 it prints the hello message and process continues - successful override.
Maybe something changed in numpy?
I do not know why numpy is linked to serial and not threaded atlas in Fedora. One probable answer might be that threaded atlas is currently broken on architectures with weak cache coherency, or maybe because it can not detect the number of cores at runtime and to get real benefits you need to recompile atlas yourself, or maybe because someone wants to use numpy as a generic library and do his own parallelization. Many problems with threaded atlas for little benefit.
--- Additional comment from Orion Poplawski on 2014-12-12 22:36:07 EST ---
This because multiple numpy shared libraries are linked against atlas:
rpm -ql numpy | grep -F .so | while read so; do ldd $so | grep atlas && echo $so; done
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007fd169763000)
/usr/lib64/python2.7/site-packages/numpy/core/_dotblas.so
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f7135291000)
/usr/lib64/python2.7/site-packages/numpy/linalg/_umath_linalg.so
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f67f2df9000)
/usr/lib64/python2.7/site-packages/numpy/linalg/lapack_lite.so
But the xerbla_ override is not in _dotblas.so and that is getting loading first.
--- Additional comment from Orion Poplawski on 2014-12-12 22:48:27 EST ---
I've updated the upstream issue tracker:
https://github.com/numpy/numpy/issues/5362
Would have been nice to have mentioned that link in the original report.
--- Additional comment from charles harris on 2014-12-19 20:13:23 EST ---
PR https://github.com/numpy/numpy/pull/5382 for numpy fixes this, but you will probably need to fix the fedora version of numpy yourself. All that seems to be needed is to move the linalg import in numpy/__init__.py before the import of core. The fix *does not work* if site.cfg is used for the setup instead of being automatically detected as by PR https://github.com/numpy/numpy/pull/5364.
--- Additional comment from charles harris on 2014-12-19 20:22:52 EST ---
NVM, still broken, needs work.
--- Additional comment from charles harris on 2014-12-24 14:01:40 EST ---
See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but the same fix is needed for the 1.8.2 that is in Fedora.
--- Additional comment from marcindulak on 2015-01-02 09:23:06 EST ---
(In reply to charles harris from comment #7)
> See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but
> the same fix is needed for the 1.8.2 that is in Fedora.
the problem is present also on RHEL7: numpy-1.7.1-10.el7.x86_64
Hi Orion,
using commit [1] for the numpy/core/blasdot/python_xerbla.c and numpy/core/setup.py, I get the following:
python
Python 2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
(array([ nan]), array([ nan]), 1, array([ nan]))
>>>
Is this expected behaviour? Your expected behaviour is to raise an error, in this case the result is "(array([ nan]), array([ nan]), 1, array([ nan]))" containing nan. Is this still OK?
[1] https://github.com/numpy/numpy/commit/f0b2dd7d5151878f2b4b3ea20ff551b27243f27d
I would have expected:
>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 1867, in lstsq
0, work, lwork, iwork, 0)
ValueError: On entry to DLASCL parameter number 4 had an illegal value
>>>
@Jan Chaloupka
Use site.cfg with
[DEFAULT]
library_dirs = /usr/lib64
include_dirs = /usr/include
# Atlas
# -----
# Atlas is an open source optimized implementation of the BLAS and Lapack
# routines. Numpy will try to build against Atlas by default when available in
# the system library dirs. To build numpy against a custom installation of
# Atlas you can add an explicit section such as the following. Here we assume
# that Atlas was configured with ``prefix=/opt/atlas``.
#
[atlas]
library_dirs = /usr/lib64/atlas
include_dirs = /usr/include
atlas_libs = tatlas
lapack_libs = tatlas
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2018:0659