-
Notifications
You must be signed in to change notification settings - Fork 336
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
Runtime crash on Android #63
Comments
I have the same problem. The problem happens in zxing when the library is doing "throw" exception. I tried to compile my project with the -fexceptions without success. Any idees? |
When I use the .pri in my project, I obtain the problem described above, the application crash on the first "throw" done by zxing (not QZXing). So I tried to compile the library as share library and now my application don't crash anymore. I really can't explain this, so if somebody has an idea, I am interested. |
Hello every one, |
hello @jrlopezvila could you provide a sample project with OpenCV and QZXing where i could work on? |
http://fromsmash.com/88bd188d-9ade-11e8-b1ff-06d04ae87646 you can download a test proyect from this link. This is a simple proyect that decode Qr and works fine. But if you include the opencv.pri that now is commented in the .pro file the application crash. It's very extrange becouse seems like when zxing throws a exception this is not catched. |
@jrlopezvila |
Hi @ftylitak |
By default exceptions in native code on Android is not allowed. All exceptions generate SIGABRT during throw. Zxing uses exceptions for driving program, for example when no code is detected, it throws an exception. These settings in pro file works for me:
|
Thanks a lot, works for me to |
I have found this post after having a similar problem on android with qt: how could I implement a multiple barcode reader using QZXing on Android. Let´s say add functionality for decoding 10 barcodes on single frame? I already tried to combine opencv for barcode detection (which works great) and QZXing for decoding, but it keeps showing me the same error "Fatal signal 6 (SIGABRT), code -6 in tid 2091 (QtThread)" that @jrlopezvila already described. How did you managed to solve the problem?? I already added these settings CONFIG+=exceptions but that didn´t make any better, my app keeps crashing!! |
By the way, this happens when I use decodeImage from QZXing project on a segmented QImage containing QR or barcode pattern... |
@jrlopezvila or @f-sys , could you please share yor .pro with me? |
I'm sorry @DanteMigoni1986 I've been very busy. When I've tested my project it seemed to work but now I have tried it again and it is failing me too. |
for you to use QZXing you must load it as a shared library because it utilizing threads , the reason for the crash is because the app is running on the main thread, in other words the app is doing a lot of work on it's main thread |
As a shred library it will only be loaded when necessary, please close the issue |
This has nothing to do with compiler flags |
Hello everyone,
I use the QZxing library with openCV in my application. It works fine on Linux, macOS and Android x86, but unfortunately not on Android ARMv7, it fails with the next error
F libc : Fatal signal 6 (SIGABRT), code -6 in tid 29269 (ThreadQrReader)
This crash happens when openCV has detected QR code and propagate it to the QZXing library. If QR, then QZXing library tries to decode QImage with QR and crashes (not always but in 80-90%).
I tried to narrow the problem context and started to use only decoder for QR - DecoderFormat_QR_CODE. So, it helped a bit but still I have some crashes on decoding.
Then I done another test and fully removed openCV library from my application. I use prepared images (with correct QR codes and some images without QR or corrupted QR) and pass the to a QZXing library. All works fine, when image doesn't contain QR or QR corrupted the QZXing library returns empty string - which is nice, otherwise it returns decoded text.
So, my assumption that openCV and QZXing library works unstable on Android ARMv7 and I don't know how to fix it.
I thought that the problem can be in emitting exceptions from QZXing lib, but I can't prove it and not sure why it works fine on Android x86.
The text was updated successfully, but these errors were encountered: