Skip to content
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

Native crash while decoding contact qr code #319

Closed
code-schreiber opened this issue Feb 21, 2018 · 1 comment
Closed

Native crash while decoding contact qr code #319

code-schreiber opened this issue Feb 21, 2018 · 1 comment
Labels

Comments

@code-schreiber
Copy link

I found a native crash while decoding an specific image and can't figure out what exactly makes it happen. My assumption is that, because it is a contact qr code (VCARD), the information contained in the qr code is incomplete or corrupt in a way and android-vision doesn't cope with it well.

Tested on an emulator with API 27 x86, but originally experienced this same crash on a Nexus 9.

To reproduce

Dependency

implementation "com.google.android.gms:play-services-vision:11.8.0"

Code to detect

BarcodeDetector detector = new BarcodeDetector.Builder(context)
        .setBarcodeFormats(Barcode.QR_CODE | Barcode.PDF417 | Barcode.AZTEC)
        .build();
if (detector.isOperational()) {
    Frame frame = new Frame.Builder().setBitmap(bitmap).build();
    SparseArray<Barcode> detectedCodes = detector.detect(frame); // Crash
}

Bitmap being scanned
bugreport

Content of bitmap

BEGIN:VCARD
VERSION:3.0
N:Lastname;Firstname
FN: Firstname Lastname
URL:http://google.com
EMAIL:gmail@gmail.com
TEL;;TYPE=voice,cell:+1 123456
END:VCARD

This is the complete stacktrace

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 18309 (Thread-9), pid 17813 (com.example.app)

A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.1.0/OSM1.180201.007/4586646:userdebug/dev-keys'
A/DEBUG: Revision: '0'
A/DEBUG: ABI: 'x86'
A/DEBUG: pid: 17813, tid: 18309, name: Thread-9  >>> com.example.app <<<
A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
A/DEBUG: Cause: null pointer dereference
A/DEBUG:     eax 00000000  ebx 8d225f44  ecx 8a5404fc  edx 8ab87644
A/DEBUG:     esi 00000000  edi 8a5404f0
A/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
A/DEBUG:     eip 8d1d186d  ebp 0000000c  esp 89c7bf80  flags 00010296
A/DEBUG: backtrace:
A/DEBUG:     #00 pc 0000586d  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #01 pc 00010d82  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #02 pc 0002af17  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #03 pc 0002bf83  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #04 pc 000117b7  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #05 pc 00006334  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #06 pc 0000217a  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #07 pc 00003421  /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/x86/libbarhopper.so
A/DEBUG:     #08 pc 000100ea  /system/priv-app/PrebuiltGmsCore/app_chimera/m/oat/x86/DynamiteModulesA.odex (offset 0x10000)
A/DEBUG:     #09 pc 000317ff  [anon:libc_malloc:8d000000]
A/DEBUG:     #10 pc 00043bcf  /dev/ashmem/dalvik-main space (region space) (deleted) (offset 0x280000)
@pchx-zz pchx-zz added the Barcode label Mar 1, 2018
@pchx-zz
Copy link

pchx-zz commented Mar 1, 2018

Duplicate of #136.

@pchx-zz pchx-zz closed this as completed Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants