<p dir="auto">There are 7 tests in tests/linalg_tests.py that fail on Mac with scipy vesion 1.4.1 installed.</p>
<p dir="auto">The tests are:<br>
'tests/linalg_test.py::NumpyLinalgTest::testEigvals_shape=complex64[50,50]'<br>
'tests/linalg_test.py::NumpyLinalgTest::testPinv_shape=complex64[7,10000]'<br>
'tests/linalg_test.py::ScipyLinalgTest::testLuFactor_n=complex64[200,200]'<br>
'tests/linalg_test.py::ScipyLinalgTest::testExpm_n=complex64[50,50]'<br>
'tests/linalg_test.py::NumpyLinalgTest::testInv_shape=float32[200,200]'<br>
'tests/linalg_test.py::NumpyLinalgTest::testPinv_shape=float32[7,10000]'<br>
'tests/linalg_test.py::ScipyLinalgTest::testExpm_n=float32[50,50]'</p>
<p dir="auto">The failure is</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="worker 'gw2' crashed while running 'tests/linalg_test.py::NumpyLinalgTest::testEigvals_shape=complex64[50,50]'"><pre class="notranslate"><code class="notranslate">worker 'gw2' crashed while running 'tests/linalg_test.py::NumpyLinalgTest::testEigvals_shape=complex64[50,50]'
</code></pre></div>
<p dir="auto">A longer stack trace is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Fatal Python error: Bus error

Thread 0x000070000693a000 (most recent call first):
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 400 in read
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 432 in from_io
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 967 in _thread_receiver
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 220 in run
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 285 in _perform_spawn

Thread 0x0000000106b4d5c0 (most recent call first):
  File &quot;/Users/necula/Source/jax/jax/interpreters/xla.py&quot;, line 731 in _value
  File &quot;/Users/necula/Source/jax/jax/interpreters/xla.py&quot;, line 826 in __array__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/numpy/core/_asarray.py&quot;, line 85 in asarray
  File &quot;/Users/necula/Source/jax/jax/test_util.py&quot;, line 682 in assertAllClose
  File &quot;/Users/necula/Source/jax/jax/test_util.py&quot;, line 727 in _CompileAndCheck
  File &quot;/Users/necula/Source/jax/tests/linalg_test.py&quot;, line 994 in testExpm
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/absl/testing/parameterized.py&quot;, line 263 in bound_param_test
  File &quot;/Users/necula/homebrew/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py&quot;, line 628 in run
  File &quot;/Users/necula/homebrew/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py&quot;, line 676 in __call__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/unittest.py&quot;, line 207 in runtest
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 117 in pytest_runtest_call
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py&quot;, line 187 in _multicall
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 81 in &lt;lambda&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 87 in _hookexec
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py&quot;, line 289 in __call__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 192 in &lt;lambda&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 220 in from_call
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 192 in call_runtest_hook
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 167 in call_and_report
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 87 in runtestprotocol
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py&quot;, line 72 in pytest_runtest_protocol
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py&quot;, line 187 in _multicall
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 81 in &lt;lambda&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 87 in _hookexec
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py&quot;, line 289 in __call__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py&quot;, line 85 in run_one_test
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py&quot;, line 71 in pytest_runtestloop
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py&quot;, line 187 in _multicall
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 81 in &lt;lambda&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 87 in _hookexec
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py&quot;, line 289 in __call__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py&quot;, line 235 in _main
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py&quot;, line 191 in wrap_session
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py&quot;, line 228 in pytest_cmdline_main
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py&quot;, line 187 in _multicall
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 81 in &lt;lambda&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py&quot;, line 87 in _hookexec
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py&quot;, line 289 in __call__
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py&quot;, line 250 in &lt;module&gt;
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 1084 in executetask
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 220 in run
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 285 in _perform_spawn
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 267 in integrate_as_primary_thread
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 1060 in serve
  File &quot;/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py&quot;, line 1554 in serve
  File &quot;&lt;string&gt;&quot;, line 8 in &lt;module&gt;
  File &quot;&lt;string&gt;&quot;, line 1 in &lt;module&gt;
[gw0] node down: Not properly terminated
f
replacing crashed worker gw0"><pre class="notranslate"><code class="notranslate">Fatal Python error: Bus error

Thread 0x000070000693a000 (most recent call first):
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 400 in read
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 432 in from_io
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 967 in _thread_receiver
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 220 in run
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn

Thread 0x0000000106b4d5c0 (most recent call first):
  File "/Users/necula/Source/jax/jax/interpreters/xla.py", line 731 in _value
  File "/Users/necula/Source/jax/jax/interpreters/xla.py", line 826 in __array__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/numpy/core/_asarray.py", line 85 in asarray
  File "/Users/necula/Source/jax/jax/test_util.py", line 682 in assertAllClose
  File "/Users/necula/Source/jax/jax/test_util.py", line 727 in _CompileAndCheck
  File "/Users/necula/Source/jax/tests/linalg_test.py", line 994 in testExpm
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/absl/testing/parameterized.py", line 263 in bound_param_test
  File "/Users/necula/homebrew/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628 in run
  File "/Users/necula/homebrew/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 676 in __call__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/unittest.py", line 207 in runtest
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 117 in pytest_runtest_call
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 81 in &lt;lambda&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 87 in _hookexec
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py", line 289 in __call__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 192 in &lt;lambda&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 220 in from_call
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 192 in call_runtest_hook
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 167 in call_and_report
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 87 in runtestprotocol
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/runner.py", line 72 in pytest_runtest_protocol
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 81 in &lt;lambda&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 87 in _hookexec
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py", line 289 in __call__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py", line 85 in run_one_test
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py", line 71 in pytest_runtestloop
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 81 in &lt;lambda&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 87 in _hookexec
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py", line 289 in __call__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py", line 235 in _main
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py", line 191 in wrap_session
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/_pytest/main.py", line 228 in pytest_cmdline_main
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 81 in &lt;lambda&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/manager.py", line 87 in _hookexec
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/pluggy/hooks.py", line 289 in __call__
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/xdist/remote.py", line 250 in &lt;module&gt;
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 1084 in executetask
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 220 in run
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 267 in integrate_as_primary_thread
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 1060 in serve
  File "/Users/necula/.virtualenvs/jax/lib/python3.7/site-packages/execnet/gateway_base.py", line 1554 in serve
  File "&lt;string&gt;", line 8 in &lt;module&gt;
  File "&lt;string&gt;", line 1 in &lt;module&gt;
[gw0] node down: Not properly terminated
f
replacing crashed worker gw0
</code></pre></div>
<p dir="auto">I will disable the tests for now.</p>
<p dir="auto">I'm not exactly sure <em>why</em> this happens, being unfamiliar with the internal architecture, but on MacOS with Python 3.6.8, the following code segfaults if scipy 1.2.1 is installed (the version that comes by default when you <code class="notranslate">pip install jax jaxlib</code>):</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import jax.random as random
import jax.scipy.linalg as linalg

key = random.PRNGKey(42)
# For some reason, matrices smaller than (50, 50) or so do not trigger segfaults
X = random.normal(key, (500, 500))
A = X @ X.T  # Drawn from standard Wishart distribution
linalg.cholesky(A)
print(&quot;Success!&quot;)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">jax</span>.<span class="pl-s1">random</span> <span class="pl-k">as</span> <span class="pl-s1">random</span>
<span class="pl-k">import</span> <span class="pl-s1">jax</span>.<span class="pl-s1">scipy</span>.<span class="pl-s1">linalg</span> <span class="pl-k">as</span> <span class="pl-s1">linalg</span>

<span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s1">random</span>.<span class="pl-v">PRNGKey</span>(<span class="pl-c1">42</span>)
<span class="pl-c"># For some reason, matrices smaller than (50, 50) or so do not trigger segfaults</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-s1">key</span>, (<span class="pl-c1">500</span>, <span class="pl-c1">500</span>))
<span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-v">X</span> @ <span class="pl-v">X</span>.<span class="pl-v">T</span>  <span class="pl-c"># Drawn from standard Wishart distribution</span>
<span class="pl-s1">linalg</span>.<span class="pl-en">cholesky</span>(<span class="pl-v">A</span>)
<span class="pl-en">print</span>(<span class="pl-s">"Success!"</span>)</pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -W ignore test.py      
zsh: bus error  python -W ignore test.py"><pre class="notranslate"><code class="notranslate">$ python -W ignore test.py      
zsh: bus error  python -W ignore test.py
</code></pre></div>
<p dir="auto">If I roll back to Scipy 1.1.0, everything works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -W ignore test.py 
Success!"><pre class="notranslate"><code class="notranslate">$ python -W ignore test.py 
Success!
</code></pre></div>
<p dir="auto">This is a great project by the way--thanks for working on it!</p>
<p dir="auto">Edit: after further digging, I found the following in the the Scipy 1.2 release notes:</p>
<blockquote>
<p dir="auto">scipy.linalg.lapack now exposes the LAPACK routines using the Rectangular Full Packed storage (RFP) for upper triangular, lower triangular, symmetric, or Hermitian matrices; the upper trapezoidal fat matrix RZ decomposition routines are now available as well.</p>
</blockquote>
<p dir="auto">Perhaps this has something to do with it?</p>
<p dir="auto">Even more edits: yet more digging has revealed <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="406164520" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/9751" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/9751/hovercard" href="https://github.com/scipy/scipy/issues/9751">scipy/scipy#9751</a>, which hints that this might be caused by a specific (old) version of XCode. I will report back once XCode is upgraded.</p>