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 when starting test #599

Closed
tedzards509 opened this issue Oct 23, 2021 · 5 comments
Closed

segmentation fault when starting test #599

tedzards509 opened this issue Oct 23, 2021 · 5 comments
Labels
dependency Something isn't working but it's because of a dependency distro: debian

Comments

@tedzards509
Copy link

tedzards509 commented Oct 23, 2021

ted@ted-laptop:~$ sudo howdy test

Opening a window with a test feed

Press ctrl+C in this terminal to quit
Click on the image to enable or disable slow mode

Segmentation fault

I had to manually configure my camera, however the face detection itself works with my config.

OS: Kubuntu
Kernel: 5.11.0-38-generic
Device: Lenovo ThinkPad E15 Gen 2 AMD

@boltgolt boltgolt added dependency Something isn't working but it's because of a dependency distro: debian labels Oct 24, 2021
@boltgolt
Copy link
Owner

That sounds like an issue with opencv or dlib, could you try reinstalling those or reinstalling howdy?

@tedzards509
Copy link
Author

I reinstalled opencv and ran pip3 opencv check which returned 'launchpadlib 1.10.13 requires testresources, which is not installed.` after reinstalling dlib there were no broken dependencies.

But even after intalling testresources the Segmentation fault persists.

@plafue
Copy link

plafue commented Dec 7, 2021

I could narrow the problem down to opencv (segfaults when calling namedWindow).

I believe that the opencv version used by howdy (provided by the distribution, i suppose) is hit by this bug opencv/opencv-python#572 . This is the test i run on my Pop_OS installation (builds upon ubuntu 20.04):

python3
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> cv.__version__
'4.5.4-dev'
>>> cv.__file__
'/usr/local/lib/python3.9/dist-packages/cv2/__init__.py'
>>> cv.namedWindow("test")
[1]    23573 segmentation fault (core dumped)  python3

When installing a newer version of opencv via pip and running the same commands as above, namedWindow does not segfault anymore.

≻  pip install --force-reinstall opencv-python==4.5.4.60
Defaulting to user installation because normal site-packages is not writeable
Collecting opencv-python==4.5.4.60
  Using cached opencv_python-4.5.4.60-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.3 MB)
Collecting numpy>=1.19.3
  Using cached numpy-1.21.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Installing collected packages: numpy, opencv-python
  Attempting uninstall: numpy
    Found existing installation: numpy 1.21.4
    Uninstalling numpy-1.21.4:
      Successfully uninstalled numpy-1.21.4
  Attempting uninstall: opencv-python
    Found existing installation: opencv-python 4.5.4.60
    Uninstalling opencv-python-4.5.4.60:
      Successfully uninstalled opencv-python-4.5.4.60
Successfully installed numpy-1.21.4 opencv-python-4.5.4.60
≻  python3
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> cv.__version__
'4.5.4'
>>> cv.__file__
'/home/plafue/.local/lib/python3.9/site-packages/cv2/__init__.py'
>>> cv.namedWindow("test")
# window appears, no segfault

I frankly don't know where /usr/local/lib/python3.9/dist-packages/cv2/__init__.py comes from or how is it installed (maybe i installed manually in the past? when installing other software?) - but it being a -dev version seems to be problematic. The seemingly related package python3-opencv is not defined as a dependency on the howdy deb package (i'm not that familiar with the python ecosystem and find all the packaging/dependency resolution confusing).

I forced installing the newer version system-wide (probably strongly not recommended, but YOLO - it is a bugfix version bump) via sudo pip install --force-reinstall opencv-python==4.5.4.60 and now howdy test works.

@boltgolt
Copy link
Owner

boltgolt commented Dec 8, 2021

Thanks for figuring that out @plafue!

@tedzards509
Copy link
Author

It works now so I guess this can be marked as closed. Thanks plafue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Something isn't working but it's because of a dependency distro: debian
Projects
None yet
Development

No branches or pull requests

3 participants