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

Segmentation fault running example on Mac Big Sur #25

Closed
limsammy opened this issue Sep 30, 2021 · 2 comments
Closed

Segmentation fault running example on Mac Big Sur #25

limsammy opened this issue Sep 30, 2021 · 2 comments

Comments

@limsammy
Copy link

Hey, I'm having an odd issue.

Environment:

OS: macOS Big Sur 10.16 20G165 x86_64

$ uname -a
Darwin slim-Macbook.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64 i386 MacBookPro15,2 Darwin
$ xcode-select --version
xcode-select version 2384
$ python
Python 3.9.7 (default, Sep 14 2021, 16:22:39)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.version)
3.9.7 (default, Sep 14 2021, 16:22:39)
[Clang 12.0.5 (clang-1205.0.22.9)]
$ pip list
Package         Version
--------------- ---------
cycler          0.10.0
imageio         2.9.0
joblib          1.0.1
kiwisolver      1.3.2
llvmlite        0.37.0
matplotlib      3.4.3
networkx        2.6.3
numba           0.54.0
numpy           1.20.3
Pillow          8.3.2
pip             21.2.3
pyparsing       2.4.7
python-dateutil 2.8.2
PyWavelets      1.1.1
scikit-image    0.18.3
scikit-learn    1.0
scipy           1.7.1
setuptools      57.4.0
six             1.16.0
threadpoolctl   2.2.0
tifffile        2021.8.30

When I clone the repository and run the example notebook everything runs perfectly.

However when I try to copy the example code and run it standalone (or simply edit the notebook with an image of my own) I get a segmentation fault.

Any idea why this is happening? The segfault occurs with the example blazkowicz.jpg image too, even though it runs fine in the notebook on first run.

I am using Python 3.9.7 by the way. I've also tried installing all deps in both a virtual env as well as my global. On a macbook, do I need more resources?

EDIT: attempting to run the notebook again (specifically the first example with blazkowicz) causes the jupyter kernel to die.

Here is my stacktrace:

ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x112d2a0d0>(<Future finis...C: 1\r\n\r\n'>)
handle: <Handle <TaskWakeupMethWrapper object at 0x112d2a0d0>(<Future finis...C: 1\r\n\r\n'>)>
Traceback (most recent call last):
  File "/Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-4' coro=<HTTP1ServerConnection._server_request_loop() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/http1connection.py:823> wait_for=<Future finished result=b'GET /api/co...PC: 1\r\n\r\n'> cb=[IOLoop.add_future.<locals>.<lambda>() at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/ioloop.py:688]> while another task <Task pending name='Task-2' coro=<KernelManager._async_start_kernel() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/jupyter_client/manager.py:336>> is being executed.
ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x112f06ca0>(<Future finis...db1"\r\n\r\n'>)
handle: <Handle <TaskWakeupMethWrapper object at 0x112f06ca0>(<Future finis...db1"\r\n\r\n'>)>
Traceback (most recent call last):
  File "/Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-5' coro=<HTTP1ServerConnection._server_request_loop() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/http1connection.py:823> wait_for=<Future finished result=b'GET /kernel...9db1"\r\n\r\n'> cb=[IOLoop.add_future.<locals>.<lambda>() at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/ioloop.py:688]> while another task <Task pending name='Task-2' coro=<KernelManager._async_start_kernel() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/jupyter_client/manager.py:336>> is being executed.

Diving deeper into the actual pyxelate source with the example code and using a local copy of pyxelate codebase, I pinpointed the exact call that causes the segfault in the pyx module: It is the BayesianGaussianMixture.fit() method. The specific line in pyx.py is the super().fit(X) call on line 74


I also found a relevant issue regarding segfaults on the auto-sklearn repository: automl/auto-sklearn#688

Looks like there were some success using the the auto-sklearn docker container, but it does not appear pyxelate uses auto-sklearn, so I'm not sure if this docker container would fix the issue (I will attempt to run it in this container after posting).

@limsammy
Copy link
Author

Ok, I just ran the example in the auto-sklearn docker container and it works. Must be an issue with Big Sur.

@sedthh
Copy link
Owner

sedthh commented Dec 13, 2021

Thanks for the update.

@sedthh sedthh closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants