-
Notifications
You must be signed in to change notification settings - Fork 5.8k
We chat QR Scan crashes with certain images. #3150
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
Comments
i have the same experience in my opinion opencv build options matter here Thread 1 received signal SIGSEGV, Segmentation fault. |
FYI if you compile opencv just without any other options like below, without TBB without openGL etc... cmake -D CMAKE_BUILD_TYPE=RELEASE |
Thank you for the advice, it could be a temporary workaround, however we need to compile several flags for our applications. |
/cc @dddzg |
Just in order to let you know, these are the flags we are using. Version is 4.5.4 as I've stated before.
|
@alalek I managed to reproduce this crash is on my dev machine. Using the latest git commit from opencv/opencv@b2e20a8 and 3b5a558 the demo crashes immediately if compiled with |
…h -ffast_math. fix opencv#3150
I was able to reproduce the issue with current 4.x (pre-4.8.0) with Fast Math option enabled in debug mode only. Release works well. Stack is corrupted:
and the proposed patch with Nans does not fix it, but hides something else. |
With fast-math option compiler expects that floats could not be NaNs and makes related optimizations. |
To avoid |
System information (version)
Detailed description
I've implemented the WeChat QR Code Scanner in a similar fashion to the one included in guides such as this one and this one (C++ implementations). The QR scanner seems to work in general, but we have noticed occasions where the process just crashes silently. After launching the script in debugging mod we have cached the following errors:
Object "/usr/local/lib/libopencv_wechat_qrcode.so.4.5", at 0x7fae230675ca, in cv::wechat_qrcode::WeChatQRCode::detectAndDecode[abi:cxx11](cv::_InputArray const&, cv::_OutputArray const&)
Object "/usr/local/lib/libopencv_wechat_qrcode.so.4.5", at 0x7fae23066fdb, in cv::wechat_qrcode::WeChatQRCode::Impl::decode[abi:cxx11](cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >&, std::vector<cv::Mat, std::allocator<cv::Mat> >&)
Thread 1 "qr_scan" received signal SIGSEGV, Segmentation fault. 0x00007ffff7cc1097 in zxing::qrcode::Detector::sizeOfBlackWhiteBlackRun(int, int, int, int) () from target:/usr/local/lib/libopencv_wechat_qrcode.so.4.5
Steps to reproduce
For reproducing, you can use the scanner method

detectAndDecode
with the following image. We have found that this image manages to crash the scanner:The text was updated successfully, but these errors were encountered: