scalene icon indicating copy to clipboard operation
scalene copied to clipboard

SIGSEGV when using cv2 library

Open u1234x1234 opened this issue 1 year ago • 1 comments

Describe the bug When using cv2 library scalene crashes with error:

Scalene error: received signal SIGSEGV

scalene with versions <=1.5.9 works fine scalene versions 1.5.10, 1.5.11 produces this error.

To Reproduce

  1. Install opencv
pip install opencv-python
  1. Run the following code scalene --cli run.py
import cv2
import numpy as np

# make a test video or you can use any other video
writer = cv2.VideoWriter("1.mp4", cv2.VideoWriter_fourcc(*"mp4v"), 30, (100, 100))
for _ in range(100):
    writer.write(np.zeros((100, 100, 3), np.uint8))
writer.release()

cap = cv2.VideoCapture("1.mp4")
ret, frame = cap.read()  # crashes on this line: Scalene error: received signal SIGSEGV

Expected behavior No crash or a message that the code can not be profiled.

Desktop (please complete the following information):

  • OS: Linux 5.15.0-46-generic 49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Browser firefox
  • Version 1.5.10, 1.5.11

Additional context Thank you for the great tool.

u1234x1234 avatar Sep 17 '22 10:09 u1234x1234

  • Does not reproduce with latest repo version on Mac OS X.
  • Does reproduce with version 1.5.9 on Ubuntu ARM, Python 3.8.10, as well as 1.5.11 and on repo version.

We're on it, thanks for the report!

emeryberger avatar Sep 18 '22 22:09 emeryberger

I receive the same error in Ubuntu 22.04, opencv-python 4.5.5, Python 3.8.13 and scalene 1.5.13. Crashes at cap.read() with error Scalene error: received signal SIGSEGV

IamMohitM avatar Oct 14 '22 12:10 IamMohitM

Same issue. Fedora 36 Python 3.10.7 Opencv-python 4.5.4

hasnul avatar Oct 22 '22 03:10 hasnul