Issue 1:
scipy.linalg.eigvalsh() throws ValueError() for large matrices. The bug appears for arbitrary matrices.

However, it also shows up in trivial examples, such as a large identity matrix, and large diagonal matrices with random coefficients in [0,1].

Reproducing code example:

import numpy as np
import scipy.linalg as la

H=np.eye(6470)
#np.random.seed(0)
#H=np.diag(np.random.uniform(size=6470))
E=la.eigvalsh(H)

Error message:

Traceback (most recent call last):
File "example0.py", line 7, in <module>
E=la.eigvalsh(H)
File "/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py", line 734, in eigvalsh
check_finite=check_finite)
File "/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py", line 384, in eigh
iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value

Scipy/Numpy/Python version information:

0.19.1 1.13.0 sys.version_info(major=3, minor=6, micro=2, releaselevel='final', serial=0)

Issue 2:
Hello,

I am getting an error with large arrays when using scipy.linalg.eigvalsh:

>>> import numpy as np
>>> from scipy.linalg import eigvalsh
>>> eigvalsh(np.zeros((6143,6143)))
array([ 0., 0., 0., ..., 0., 0., 0.])
>>> eigvalsh(np.zeros((6144,6144)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py", line 684, in eigvalsh
check_finite=check_finite)
File "/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py", line 345, in eigh
iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value

The issue seems close to #5401, but refers to another LAPACK function. It is a pure effect of size, since 6143 * 6143 is ok, but 6144 * 6144 is not. 6144 = 3 * (2**11) is big, but not that big. I have no problem on my macbook, with an older scipy (0.14.0), I think it's a LAPACK bug.

Version I'm using;

scipy version 0.18.1

numpy version 1.11.1

Python 2.7.12

Anaconda 4.2.0 (64-bit)

openSUSE 13.2 (Harlequin)

>>> scipy.__config__.show()
lapack_opt_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/users/gauthe/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/users/gauthe/anaconda2/include']
blas_opt_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/users/gauthe/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/users/gauthe/anaconda2/include']
openblas_lapack_info:
NOT AVAILABLE
lapack_mkl_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/users/gauthe/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/users/gauthe/anaconda2/include']
blas_mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/users/gauthe/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/users/gauthe/anaconda2/include']
mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/users/gauthe/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/users/gauthe/anaconda2/include']