scalene
scalene copied to clipboard
SIGSEGV when using cv2 library
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
- Install opencv
pip install opencv-python
- 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.
- 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!
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
Same issue. Fedora 36 Python 3.10.7 Opencv-python 4.5.4