Skip to content

Segfault in QRCodeDetector.detectAndDecodeCurved #22892

@jabdoa2

Description

@jabdoa2

System Information

OpenCV version: 4.2.0+dfsg-5 from Ubuntu 20.04 and 4.5.4 from Nix latest.
Operating System: Ubuntu 20.04 on AMD Ryzen 7 5700G
Python version: 3.8.10 from Ubuntu 20.04 and 3.10.8 from Nix latest.

Detailed description

We get a segmentation fault calling QRCodeDetector.detectAndDecodeCurved for some images:

$ PYTHONFAULTHANDLER=1 python3 crash_repo.py
Fatal Python error: Segmentation fault

Current thread 0x00007fd41ab83740 (most recent call first):
  File "/xxx/crash_repo.py", line 5 in <module>

Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, cv2 (total: 14)
Segmentation fault (core dumped)

This happens infrequently but with a given image it is 100% reproducible.

Seems similar to #19626 but they want a new issue over there.

Steps to reproduce

Run the following minimal code:

import cv2 as cv

img = cv.imread("last_qr.png")
qcd = cv.QRCodeDetector()
qcd.detectAndDecodeCurved(img)

This file triggers it: last_qr

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions