Issue 1:
There are 7 tests in tests/linalg_tests.py that fail on Mac with scipy vesion 1.4.1 installed.

The tests are:

'tests/linalg_test.py::NumpyLinalgTest::testEigvals_shape=complex64[50,50]'

'tests/linalg_test.py::NumpyLinalgTest::testPinv_shape=complex64[7,10000]'

'tests/linalg_test.py::ScipyLinalgTest::testLuFactor_n=complex64[200,200]'

'tests/linalg_test.py::ScipyLinalgTest::testExpm_n=complex64[50,50]'

'tests/linalg_test.py::NumpyLinalgTest::testInv_shape=float32[200,200]'

'tests/linalg_test.py::NumpyLinalgTest::testPinv_shape=float32[7,10000]'

'tests/linalg_test.py::ScipyLinalgTest::testExpm_n=float32[50,50]'

The failure is

worker 'gw2' crashed while running 'tests/linalg_test.py::NumpyLinalgTest::testEigvals_shape=complex64[50,50]'

A longer stack trace is:

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 <lambda>
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 <lambda>
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 <lambda>
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 <lambda>
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 <lambda>
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 <module>
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 "<string>", line 8 in <module>
File "<string>", line 1 in <module>
[gw0] node down: Not properly terminated
f
replacing crashed worker gw0

I will disable the tests for now.

Issue 2:
I'm not exactly sure why 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 pip install jax jaxlib):

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("Success!")

Output:

$ python -W ignore test.py
zsh: bus error python -W ignore test.py

If I roll back to Scipy 1.1.0, everything works:

$ python -W ignore test.py
Success!

This is a great project by the way--thanks for working on it!

Edit: after further digging, I found the following in the the Scipy 1.2 release notes:

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.

Perhaps this has something to do with it?

Even more edits: yet more digging has revealed scipy/scipy#9751, which hints that this might be caused by a specific (old) version of XCode. I will report back once XCode is upgraded.