Bug 2217862

Summary: python38:3.8 - numpy FTBFS - TestCond.test_nan failed on x86_64
Product: Red Hat Enterprise Linux 8 Reporter: Lumír Balhar <lbalhar>
Component: numpyAssignee: Charalampos Stratakis <cstratak>
Status: VERIFIED --- QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.9CC: cstratak, nforro, torsava
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lumír Balhar 2023-06-27 10:06:19 UTC
Description of problem:
When rebulding python38 module for RHEL 8, numpy fails to build from source with:

=================================== FAILURES ===================================
______________________________ TestCond.test_nan _______________________________
self = <numpy.linalg.tests.test_linalg.TestCond object at 0x7fffa7e705b0>
    def test_nan(self):
        # nans should be passed through, not converted to infs
        ps = [None, 1, -1, 2, -2, 'fro']
        p_pos = [None, 1, 2, 'fro']
    
        A = np.ones((2, 2))
        A[0,1] = np.nan
        for p in ps:
>           c = linalg.cond(A, p)
A          = array([[ 1., nan],
       [ 1.,  1.]])
p          = None
p_pos      = [None, 1, 2, 'fro']
ps         = [None, 1, -1, 2, -2, 'fro']
self       = <numpy.linalg.tests.test_linalg.TestCond object at 0x7fffa7e705b0>
numpy/linalg/tests/test_linalg.py:770: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<__array_function__ internals>:5: in cond
    ???
numpy/linalg/linalg.py:1740: in cond
    s = svd(x, compute_uv=False)
<__array_function__ internals>:5: in svd
    ???
numpy/linalg/linalg.py:1648: in svd
    s = gufunc(a, signature=signature, extobj=extobj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
err = 'invalid value', flag = 8
    def _raise_linalgerror_svd_nonconvergence(err, flag):
>       raise LinAlgError("SVD did not converge")
E       numpy.linalg.LinAlgError: SVD did not converge
err        = 'invalid value'
flag       = 8
numpy/linalg/linalg.py:106: LinAlgError
= 1 failed, 10151 passed, 69 skipped, 173 deselected, 18 xfailed, 1 xpassed in 73.21 seconds =



Version-Release number of selected component (if applicable):
numpy-1.17.3-6

Steps to Reproduce:
1. Scratch build python38 module for RHEL 8.

Additional info:
We need to rebuild the module to be able to ship a CVE fix in one of its components so this is kinda important for us.

Comment 2 Charalampos Stratakis 2023-07-17 23:08:11 UTC
Upstream skips the test: https://github.com/numpy/numpy/pull/18943/files

I've backported the patch.