Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/777 on 2008-11-04 by @pv, assigned to unknown.

The Lapack tests in Scipy 6f2abae produce two failures on 32-bit Ubuntu intrepid, atlas3-sse.

======================================================================
FAIL: test_lapack.test_all_lapack
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../nose/case.py", line 182, in runTest
self.test(*self.arg)
File ".../scipy/lib/lapack/tests/esv_tests.py", line 41, in check_syevr
assert_array_almost_equal(w,exact_w)
File ".../numpy/testing/utils.py", line 311, in assert_array_almo
st_equal
header='Arrays are not almost equal')
File ".../numpy/testing/utils.py", line 296, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal

(mismatch 33.3333333333%)
x: array([-0.66992444, 0.48769444, 9.18222618], dtype=float32)
y: array([-0.66992434, 0.48769389, 9.18223045])

======================================================================
FAIL: test_lapack.test_all_lapack
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../nose/case.py", line 182, in runTest
self.test(*self.arg)
File ".../scipy/lib/lapack/tests/esv_tests.py", line 66, in check_syevr_irange
assert_array_almost_equal(w,exact_w[rslice])
File ".../numpy/testing/utils.py", line 311, in assert_array_almost_equal
header='Arrays are not almost equal')
File ".../testing/utils.py", line 296, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal

(mismatch 33.3333333333%)
x: array([-0.66992444, 0.48769444, 9.18222618], dtype=float32)
y: array([-0.66992434, 0.48769389, 9.18223045])
----------------------------------------------------------------------

I wonder why are the results in float32...

Issue 2:
I have found that lstsq is sometimes unexpectedly throwing an exception; this is causing major problems because it's used in things like sklearn's LinearRegression class. I've included below a particular very simplified repro, but there appear to be an unpredictable but somewhat widespread set of circumstances that can trigger this bug.

Reproducing code example:

import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import lstsq

n = 9 # doesn't repro for n<=8

# Generate covariates and outcomes
X = np.arange(n).reshape(-1,1)
Y = X

# plot anything with dashed lines (doesn't repro with default line style!)
plt.plot([1,2], [3,4], '--')

lstsq(X,Y)

Error message

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
12 plt.plot([1,2], [3,4], '--')
13
---> 14 lstsq(X,Y)

c:\Users\kebatt\source\repos\ProjectAliceCore\automl_venv\lib\site-packages\scipy\linalg\basic.py in lstsq(a, b, cond, overwrite_a, overwrite_b, check_finite, lapack_driver)
1222 if info < 0:
1223 raise ValueError('illegal value in %d-th argument of internal %s'
-> 1224 % (-info, lapack_driver))
1225 resids = np.asarray([], dtype=x.dtype)
1226 if m > n:

ValueError: illegal value in 4-th argument of internal None

Scipy/Numpy/Python version information:

1.5.2 1.19.2 sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)

I am running Windows 10 version 2004, so I assume this is at least somewhat related to numpy/numpy#16744, #12747, etc., but the manifestation is different.