Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI, TST: pre-release failures for scipy/interpolate/tests/test_rbfinterp.py #14732

Closed
tylerjereddy opened this issue Sep 15, 2021 · 32 comments
Closed
Labels
CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.interpolate
Milestone

Comments

@tylerjereddy
Copy link
Contributor

This failure is showing up all over the place for Azure Pipelines pre-release runs. I don't know if this is just a blip because of a bleeding edge dependency, but it seems like the test suite produces a segfault after getting to 10-20 % progress and produces a traceback like the one below the fold. The traceback is so ridiculously long that I'll just mention that scipy/interpolate/tests/test_rbfinterp.py", line 375 in test_pickleable shows up in there.

021-09-13T14:01:27.8800593Z ..................................Fatal Python error: Segmentation fault
2021-09-13T14:01:27.8801755Z 
2021-09-13T14:01:27.8804483Z Thread 0x00007fcb59a6a700 (most recent call first):
2021-09-13T14:01:27.8840916Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 400 in read
2021-09-13T14:01:27.8878458Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 432 in from_io
2021-09-13T14:01:27.8923939Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 967 in _thread_receiver
2021-09-13T14:01:27.8953482Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 220 in run
2021-09-13T14:01:27.8968135Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn
2021-09-13T14:01:27.8968990Z 
2021-09-13T14:01:27.8969615Z Current thread 0x00007fcb5c500740 (most recent call first):
2021-09-13T14:01:27.8984911Z   File "/home/vsts/work/1/s/build/testenv/lib/python3.9/site-packages/scipy/interpolate/tests/test_rbfinterp.py", line 375 in test_pickleable
2021-09-13T14:01:27.8998727Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/python.py", line 183 in pytest_pyfunc_call
2021-09-13T14:01:27.9036114Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:27.9037394Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:27.9038435Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:27.9039475Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/python.py", line 1641 in runtest
2021-09-13T14:01:27.9040539Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 162 in pytest_runtest_call
2021-09-13T14:01:27.9041568Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:27.9042598Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:27.9043618Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:27.9044631Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 255 in <lambda>
2021-09-13T14:01:27.9045653Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 311 in from_call
2021-09-13T14:01:27.9046690Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 254 in call_runtest_hook
2021-09-13T14:01:27.9047737Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 215 in call_and_report
2021-09-13T14:01:27.9048803Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 126 in runtestprotocol
2021-09-13T14:01:27.9049867Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
2021-09-13T14:01:27.9050898Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:27.9052265Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:27.9053313Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:27.9054353Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 89 in run_one_test
2021-09-13T14:01:27.9055398Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 72 in pytest_runtestloop
2021-09-13T14:01:27.9056434Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:27.9057455Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:27.9058465Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:27.9059480Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 323 in _main
2021-09-13T14:01:27.9061168Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 269 in wrap_session
2021-09-13T14:01:27.9063322Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
2021-09-13T14:01:27.9064356Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:27.9065181Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:27.9065987Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:27.9066802Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 246 in <module>
2021-09-13T14:01:27.9067633Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1084 in executetask
2021-09-13T14:01:27.9068470Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 220 in run
2021-09-13T14:01:27.9069320Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn
2021-09-13T14:01:27.9070197Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 267 in integrate_as_primary_thread
2021-09-13T14:01:27.9071060Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1060 in serve
2021-09-13T14:01:27.9071915Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1554 in serve
2021-09-13T14:01:27.9072416Z   File "<string>", line 8 in <module>
2021-09-13T14:01:27.9072803Z   File "<string>", line 1 in <module>
2021-09-13T14:01:31.7185684Z ...................................... [ 18%]
2021-09-13T14:01:33.9471894Z ......................Fatal Python error: Segmentation fault
2021-09-13T14:01:33.9472980Z 
2021-09-13T14:01:33.9475827Z Thread 0x00007fac1e72d700 (most recent call first):
2021-09-13T14:01:33.9511865Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 400 in read
2021-09-13T14:01:33.9548936Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 432 in from_io
2021-09-13T14:01:33.9590154Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 967 in _thread_receiver
2021-09-13T14:01:33.9625413Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 220 in run
2021-09-13T14:01:33.9639383Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn
2021-09-13T14:01:33.9640000Z 
2021-09-13T14:01:33.9642259Z Current thread 0x00007fac211c3740 (most recent call first):
2021-09-13T14:01:33.9657477Z   File "/home/vsts/work/1/s/build/testenv/lib/python3.9/site-packages/scipy/interpolate/tests/test_rbfinterp.py", line 375 in test_pickleable
2021-09-13T14:01:33.9671669Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/python.py", line 183 in pytest_pyfunc_call
2021-09-13T14:01:33.9684293Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:33.9699364Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:33.9700493Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:33.9701486Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/python.py", line 1641 in runtest
2021-09-13T14:01:33.9702507Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 162 in pytest_runtest_call
2021-09-13T14:01:33.9703467Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:33.9704427Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:33.9705595Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:33.9706529Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 255 in <lambda>
2021-09-13T14:01:33.9707488Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 311 in from_call
2021-09-13T14:01:33.9708463Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 254 in call_runtest_hook
2021-09-13T14:01:33.9709454Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 215 in call_and_report
2021-09-13T14:01:33.9710409Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 126 in runtestprotocol
2021-09-13T14:01:33.9711399Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
2021-09-13T14:01:33.9712390Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:33.9715682Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:33.9745464Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:33.9758706Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 89 in run_one_test
2021-09-13T14:01:33.9781599Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 72 in pytest_runtestloop
2021-09-13T14:01:33.9782740Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:33.9783714Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:33.9784696Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:33.9785642Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 323 in _main
2021-09-13T14:01:33.9786595Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 269 in wrap_session
2021-09-13T14:01:33.9787701Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
2021-09-13T14:01:33.9788675Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
2021-09-13T14:01:33.9789625Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
2021-09-13T14:01:33.9790557Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
2021-09-13T14:01:33.9791513Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/remote.py", line 246 in <module>
2021-09-13T14:01:33.9792482Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1084 in executetask
2021-09-13T14:01:33.9793428Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 220 in run
2021-09-13T14:01:33.9794406Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 285 in _perform_spawn
2021-09-13T14:01:33.9795417Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 267 in integrate_as_primary_thread
2021-09-13T14:01:33.9796405Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1060 in serve
2021-09-13T14:01:33.9797460Z   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1554 in serve
2021-09-13T14:01:33.9798098Z   File "<string>", line 8 in <module>
2021-09-13T14:01:33.9798601Z   File "<string>", line 1 in <module>
2021-09-13T14:02:04.1134287Z [gw1] node down: Not properly terminated
2021-09-13T14:02:16.2967625Z INTERNALERROR> Traceback (most recent call last):
2021-09-13T14:02:16.2969704Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 997, in _send
2021-09-13T14:02:16.2972387Z INTERNALERROR>     message.to_io(self._io)
2021-09-13T14:02:16.2973766Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 443, in to_io
2021-09-13T14:02:16.2974482Z INTERNALERROR>     io.write(header + self.data)
2021-09-13T14:02:16.2975389Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 409, in write
2021-09-13T14:02:16.2976118Z INTERNALERROR>     self._write(data)
2021-09-13T14:02:16.2976676Z INTERNALERROR> BrokenPipeError: [Errno 32] Broken pipe
2021-09-13T14:02:16.2977196Z INTERNALERROR> 
2021-09-13T14:02:16.2977769Z INTERNALERROR> During handling of the above exception, another exception occurred:
2021-09-13T14:02:16.2978346Z INTERNALERROR> 
2021-09-13T14:02:16.2978848Z INTERNALERROR> Traceback (most recent call last):
2021-09-13T14:02:16.2979771Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 269, in wrap_session
2021-09-13T14:02:16.2980481Z INTERNALERROR>     session.exitstatus = doit(config, session) or 0
2021-09-13T14:02:16.2981403Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/_pytest/main.py", line 323, in _main
2021-09-13T14:02:16.2982508Z INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
2021-09-13T14:02:16.2983463Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
2021-09-13T14:02:16.2984197Z INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
2021-09-13T14:02:16.2985145Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
2021-09-13T14:02:16.2985875Z INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2021-09-13T14:02:16.2987454Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
2021-09-13T14:02:16.2988292Z INTERNALERROR>     return outcome.get_result()
2021-09-13T14:02:16.2989675Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
2021-09-13T14:02:16.2990424Z INTERNALERROR>     raise ex[1].with_traceback(ex[2])
2021-09-13T14:02:16.2991335Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
2021-09-13T14:02:16.2992073Z INTERNALERROR>     res = hook_impl.function(*args)
2021-09-13T14:02:16.2992972Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/dsession.py", line 112, in pytest_runtestloop
2021-09-13T14:02:16.2993723Z INTERNALERROR>     self.loop_once()
2021-09-13T14:02:16.2995230Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/dsession.py", line 135, in loop_once
2021-09-13T14:02:16.2995776Z INTERNALERROR>     call(**kwargs)
2021-09-13T14:02:16.2996527Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/dsession.py", line 199, in worker_errordown
2021-09-13T14:02:16.2997163Z INTERNALERROR>     crashitem = self.sched.remove_node(node)
2021-09-13T14:02:16.2997938Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/scheduler/load.py", line 215, in remove_node
2021-09-13T14:02:16.2998643Z INTERNALERROR>     self.check_schedule(node)
2021-09-13T14:02:16.2999410Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/scheduler/load.py", line 188, in check_schedule
2021-09-13T14:02:16.2999988Z INTERNALERROR>     self._send_tests(node, num_send)
2021-09-13T14:02:16.3000760Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/scheduler/load.py", line 269, in _send_tests
2021-09-13T14:02:16.3001318Z INTERNALERROR>     node.send_runtest_some(tests_per_node)
2021-09-13T14:02:16.3002142Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/workermanage.py", line 284, in send_runtest_some
2021-09-13T14:02:16.3002747Z INTERNALERROR>     self.sendcommand("runtests", indices=indices)
2021-09-13T14:02:16.3003543Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/xdist/workermanage.py", line 300, in sendcommand
2021-09-13T14:02:16.3004106Z INTERNALERROR>     self.channel.send((name, kwargs))
2021-09-13T14:02:16.3004844Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 729, in send
2021-09-13T14:02:16.3005448Z INTERNALERROR>     self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
2021-09-13T14:02:16.3006258Z INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/execnet/gateway_base.py", line 1003, in _send
2021-09-13T14:02:16.3006853Z INTERNALERROR>     raise IOError("cannot send (already closed?)")
2021-09-13T14:02:16.3007329Z INTERNALERROR> OSError: cannot send (already closed?)
2021-09-13T14:02:16.3042855Z 
2021-09-13T14:02:16.3064907Z ============ 6569 passed, 6 skipped, 2 xfailed in 166.36s (0:02:46) ============
@tylerjereddy tylerjereddy added scipy.interpolate CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure labels Sep 15, 2021
@tupui
Copy link
Member

tupui commented Sep 21, 2021

@treverhines @serge-sans-paille could you help here? I am not sure if these are related to Cython or Pythran.

@tupui tupui added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Sep 21, 2021
@rgommers
Copy link
Member

I'm confused about why it's just the pre-release jobs. Could be an interaction between NumPy master and Pythran 0.10.0. It's crashing on the last line of:

    def test_pickleable(self):
        # Make sure we can pickle and unpickle the interpolant without any
        # changes in the behavior.
        seq = Halton(1, scramble=False, seed=np.random.RandomState())

        x = 3*seq.random(50)
        xitp = 3*seq.random(50)

        y = _1d_test_function(x)

        interp = self.build(x, y)

        yitp1 = interp(xitp)
        yitp2 = pickle.loads(pickle.dumps(interp))(xitp)

@ev-br
Copy link
Member

ev-br commented Sep 21, 2021

Is seed=np.random.RandomState()) deterministic?

@rgommers
Copy link
Member

It's not, thanks for pointing that out. That won't be the root cause of the segfaults, but we should fix it.

@rgommers
Copy link
Member

These are the two failing jobs:

image

They're very similar, the only differences are:

  • 32-bit vs 64-bit BLAS
  • Python 3.8 vs. 3.9
  • fast vs. full test mode

I'm inclined to get rid of the 32-bit BLAS with fast tests, it doesn't really add anything. That cuts things down to a single failure and makes the test suite more orthogonal.

rgommers added a commit to rgommers/scipy that referenced this issue Sep 21, 2021
See scipygh-14732 for context. The similarly named job
`prerelease_deps_64bit_blas` covers what we remove here. There are
other jobs that test with 32-bit BLAS on Linux. The job we leave runs
the full test suite, the one that is removed here the fast test suite.

This cuts down on CI time and also on duplicate failures.

[skip github]
rgommers added a commit to rgommers/scipy that referenced this issue Sep 21, 2021
xref scipygh-14732. This test is crashing most of the time in two CI
jobs, but not always. This doesn't fix the root cause, but should
make the test more reproducible.

[skip github]
@tupui
Copy link
Member

tupui commented Sep 22, 2021

Is seed=np.random.RandomState()) deterministic?

It's a leftover from switching to NumPy 1.17. It was needed to initialize QMCEngine. In this case it can be completely removed as it's not even used. scramble=False which means the sequence is deterministic.

I was too slow 😅 just saw it's merged. But it's fine.

@rgommers
Copy link
Member

Still crashing on one CI job, and I haven't yet been able to reproduce it locally with numpy master and pythran 0.10.0

tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Oct 4, 2021
* for about 3 weeks pre-release CI has been failing as described
in scipygh-14732

* I bisected the pre-release versions of Cython `3.x` that are
available on PyPI locally and found that the first version to
reproduced a sefault for the command below is `3.0a5`

`python runtests.py -t "scipy/interpolate/tests/test_rbfinterp.py" -- -n 2`

* so, pin the max Cython version to `<3.0a5` for now (pip should still
install stable release when `--pre` is not used in other Azure CI
entries

* obviously this is just a workaround--I'll open an upstream issue
to see if there are any suspicions about a possible bug or something
else we might do differently to avoid the segfault
@tylerjereddy
Copy link
Contributor Author

Looks like it is the pre-release version of Cython causing the problem--I did a careful bisection locally (clean build each time with different Cython version). For more details:

@rgommers
Copy link
Member

rgommers commented Oct 4, 2021

Avoided the failure now in CI, but leaving this open since we need to make sure it's fixed in Cython before the next release (or otherwise check the pinning for releases better, not just CI).

@rgommers rgommers added this to the 1.8.0 milestone Oct 4, 2021
@rgommers
Copy link
Member

rgommers commented Oct 4, 2021

Wait, >= 3.0a5 does not make much sense @tylerjereddy, 3.0a5 is over a year old. The most recent version is 3.0a9 which is from 21 July 2021. This must be due to the Pythran 0.10.0 release, which is from 14 Sep 2021. Or better, the interaction between the two - because the test mixes stats.qmc.Halton (which is implemented in Cython) with RBFInterpolator (which is written in Pythran.

We can probably fix the bug by getting rid of Halton or copying/converting its output to a regular numpy array. It's likely that Cython returns something with slightly fishy properties there.

Once we fix up the test, we can drop the Cython pin.

@serge-sans-paille
Copy link
Contributor

@rgommers anything I need to do there?

@rgommers
Copy link
Member

rgommers commented Oct 4, 2021

@rgommers anything I need to do there?

Maybe checking if there's a pickle-related change in Pythran 0.10.0 which could possibly choke on Cython-generated ndarray?

@tylerjereddy
Copy link
Contributor Author

Wait, >= 3.0a5 does not make much sense @tylerjereddy, 3.0a5 is over a year old. The most recent version is 3.0a9 which is from 21 July 2021.

@rgommers

To be fair, I was fully aware of the timeline when I was bisecting--my objective was to identify the alpha release of Cython that contained a feature that, when interacting with everything else, resulted in a segfault.

I figured it would be helpful to pin below the first segfaulting alpha release of Cython so that SciPy or upstream developers could have access to the subset of Cython changes involved in the interaction.

@rgommers
Copy link
Member

rgommers commented Oct 4, 2021

Okay good, I had completely missed that when merging your pinning PR. I do think filing a Cython issue may have been premature, since the issue is at least as likely to be in Pythran 0.10.0?

@tylerjereddy
Copy link
Contributor Author

@rgommers @serge-sans-paille and maybe @peterbell10 (?)

I did some more debugging, this time using the workflow below, and it points to a problem happening inside the Cython-generated ckdtree.cxx file. Is this getting closer to enough information to judge whether it is a Cython-generated C++ bug or if the data handoff to/from Pythran is the problem? Anything else you'd like me to step through/try in this environment?

  • gdb python
  • run runtests.py -t "scipy/interpolate/tests/test_rbfinterp.py"
Program received signal SIGSEGV, Segmentation fault.
__pyx_pf_5scipy_7spatial_7ckdtree_7cKDTree_22__setstate__ (__pyx_v_state=<optimized out>, __pyx_v_self=<optimized out>, this=<optimized out>) at scipy/spatial/ckdtree.cxx:18771
18771	  __pyx_t_18 = __pyx_f_5numpy_7ndarray_4size_size(__pyx_v_tree);

@tylerjereddy
Copy link
Contributor Author

tylerjereddy commented Oct 5, 2021

I reproduced segfault with a clean build of SciPy with pythran 0.9.12.post1, I'll test a few more versions with Cython pinned to 3.0.0a9 if I get time later

@tylerjereddy
Copy link
Contributor Author

tylerjereddy commented Oct 5, 2021

Well, in my hands pythran 0.9.12 still causes the segfault with latest Cython alpha, and that's the oldest Pythran we support so... cython problem?

@tylerjereddy
Copy link
Contributor Author

Let me see if I can find something in a recent NumPy change that would explain the timing...

@tylerjereddy
Copy link
Contributor Author

tylerjereddy commented Oct 5, 2021

Here is the result of a careful/painful bisection on NumPy commits with Pythran pinned to 0.10.0 and Cython to 3.0.0a9, identifying the first NumPy version that will participate in a SciPy (clean rebuild) segfault. Maybe @charris or @mattip / @seberg will have an idea if this need a NumPy or Cython-based fix.

6dff0c2f22b58b1d5d397fd8c4ab768a30d10499 is the first bad commit
commit 6dff0c2f22b58b1d5d397fd8c4ab768a30d10499
Author: Charles Harris <charlesr.harris@gmail.com>
Date:   Fri Sep 3 21:21:57 2021 -0600

    MAINT: Standardize header guards,
    
    This standardizes the header guards in numpy/core/include/numpy.
    The standard here is `<path>_<name>_H_` For instance, the file
    
    file: numpy/core/include/numpy/arrayobject.h
    guard: NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_
    
    Macro names can be up to 255 characters, so length is not a problem.
    
    This convention comes from the Google code style and keeps files with
    the same name but different locations from stepping on each other.

:040000 040000 cda62005f03d0b0fe560b20b2b83e2c507f89dd0 9948d28a17b72f3ef35cfd7f666243698503975a M	numpy

@da-woods
Copy link
Contributor

da-woods commented Oct 5, 2021

For reference it looks like the crash is happening on

cself.tree_buffer.resize(tree.size // sizeof(ckdtreenode))

while handling tree.size. (That doesn't mean that's the point where data originally gets corrupted of course).

The contents of __pyx_f_5numpy_7ndarray_4size_size doesn't look suspicious to me. The only thing that might be worth checking (maybe just by adding a manual check in ckdtree.pyx) is if tree is actually None - I don't think Cython would accept ndarray or None for tree but doesn't insert a None check before looking up its size. I'm not sure if that's a bug or not.

I haven't investigated in detail but two relevant things may have happened around Cython 3.0a5:

  1. The "inline property" feature that generates the access to (including .size) was modified significantly cython/cython@22a49f4#diff-3cece7436e1a2357257c0912575125e65e979f439672832fb3ea301a7aeaea74
  2. Maintenance of the Numpy pxd files was largely handed off Numpy (don't think this makes a huge difference though)

@tylerjereddy
Copy link
Contributor Author

Hmm, a few debug prints on tree before the segfault on size access:

tree before crash: [b'' b'' b'' ... b'' b'' b'']
type(tree) before crash: <class 'numpy.ndarray'>
tree.dtype: |S1
len(tree): 1080

@da-woods
Copy link
Contributor

da-woods commented Oct 5, 2021

Next thought - does np.import_array() (placed as soon as possible after cimport numpy) fix it? It's possible that PyArray_SIZE might require the Numpy API to be initialized whereas the old direct access intp PyArrayObject didn't.

If so it probably exposes a (minor) Cython bug - Cython now tries to auto-add np.import_array in-case you forget it. Perhaps the standardization of the header guards broke that though.


Edit: I'm increasingly sure that's it - Cython uses NPY_NDARRAYOBJECT_H as an indicator that the actual Numpy headers have been included when deciding to generate the code, and that's obviously been renamed.

I'll submit a fix to Cython. But in principle almost anywhere Scipy uses cimport numpy should be accompanied by a numpy.import_array() - Cython is making a best effort attempt to help you out but still thinks it's really your responsibility

@seberg
Copy link
Contributor

seberg commented Oct 5, 2021

Cython uses NPY_NDARRAYOBJECT_H as an indicator that the actual Numpy headers have been included

@charris seems like enough of a reason to revert the guard cleanup in that particular case (with a comment to fix it in 1-3 years)? Anyone wants to make a PR ;)?

@da-woods
Copy link
Contributor

da-woods commented Oct 5, 2021

I'll submit a PR to Scipy adding np.import_array() everywhere that it's missing later today.

@charris
Copy link
Member

charris commented Oct 5, 2021

@seberg If this is only Cython 3 prereleases I'd be more inclined to fix Cython first, it just needs an | defined .... Header guards are nominally private, but Cython does seem like a reasonable exception to that rule. I suppose we could define both guards for the time being.

@seberg
Copy link
Contributor

seberg commented Oct 5, 2021

I suppose we could define both guards for the time being.

Yeah, sounds good. I assume(d) older cython versions will also run into this issue and the .shape change here just is just one more component (using a function and not a macro).

@da-woods
Copy link
Contributor

da-woods commented Oct 5, 2021

Is there any other define we could look for that is part of a public API. We were just trying to look for some distinctive define to distinguish "real Numpy" from a user that's helpfully decided to call their own module "numpy"

@seberg
Copy link
Contributor

seberg commented Oct 5, 2021

@da-woods maybe NPY_VERSIONor NPY_FEATURE_VERSION would make sense (not quite sure what that is set)? But if this affects older cython versions, I think we should keep a define for NPY_NDARRAYOBJECT_H within numpy for now.

@da-woods
Copy link
Contributor

da-woods commented Oct 5, 2021

It should only be the Cython alpha releases (3.0a5 - whatever the next release is). Personally I'm fairly neutral on whether you should keep NPY_NDARRAYOBJECT_H - we still think users should call import_array() themselves - the attempt to do it ourself was really a best-effort attempt to avoid a few bug reports, so if it fails then it's no-one's fault.

@charris
Copy link
Member

charris commented Oct 5, 2021

See numpy/numpy#20042 for a NumPy fix.

@charris
Copy link
Member

charris commented Oct 5, 2021

@da-woods I think the new header guard is probably safer to use than the old one, the new name is less likely to be defined by random users. I made a PR, but if the problem only affects alpha Cython releases, I'd rather see it fixed upstream.

@tylerjereddy
Copy link
Contributor Author

Fixed by gh-14813, I'll try to backport parts of that instead of the Cython version pin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.interpolate
Projects
None yet
Development

No branches or pull requests

8 participants