Android app crash- heap corruption detected by dlmalloc_real

General information about Neurotechnology and its software

Android app crash- heap corruption detected by dlmalloc_real

Postby cohnjarmack » Jun 19, 2017 06:25

Hi,

Using the app on my test tablet leads to it crashing with this stack trace:

Code: Select all
06-16 18:11:59.433 12762-12943/com.myapp A/libc: heap corruption detected by dlmalloc_real
06-16 18:11:59.433 12762-12943/com.myapp A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 12943 (AsyncTask #4)
06-16 18:11:59.539 266-266/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-16 18:11:59.539 266-266/? I/DEBUG: Build fingerprint: 'Lenovo/YT3-850M/YT3-850M:5.1.1/LMY47V/YT3-850M'
06-16 18:11:59.539 266-266/? I/DEBUG: Revision: '0'
06-16 18:11:59.539 266-266/? I/DEBUG: ABI: 'arm'
06-16 18:11:59.540 266-266/? I/DEBUG: pid: 12762, tid: 12943, name: AsyncTask #4  >>> com.myapp <<<
06-16 18:11:59.540 266-266/? I/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
06-16 18:11:59.596 266-266/? I/DEBUG: Abort message: 'heap corruption detected by dlmalloc_real'
06-16 18:11:59.597 266-266/? I/DEBUG:     r0 00000000  r1 0000328f  r2 00000006  r3 00000000
06-16 18:11:59.597 266-266/? I/DEBUG:     r4 a332ddd8  r5 00000006  r6 0000000b  r7 0000010c
06-16 18:11:59.597 266-266/? I/DEBUG:     r8 00000021  r9 b716dd40  sl 00000005  fp 00000006
06-16 18:11:59.597 266-266/? I/DEBUG:     ip 0000328f  sp a3328248  lr b6da3ac9  pc b6dc9d78  cpsr 600f0010
06-16 18:11:59.598 266-266/? I/DEBUG: backtrace:
06-16 18:11:59.598 266-266/? I/DEBUG:     #00 pc 00039d78  /system/lib/libc.so (tgkill+12)
06-16 18:11:59.598 266-266/? I/DEBUG:     #01 pc 00013ac5  /system/lib/libc.so (pthread_kill+52)
06-16 18:11:59.599 266-266/? I/DEBUG:     #02 pc 000146db  /system/lib/libc.so (raise+10)
06-16 18:11:59.599 266-266/? I/DEBUG:     #03 pc 00010e7d  /system/lib/libc.so (__libc_android_abort+36)
06-16 18:11:59.599 266-266/? I/DEBUG:     #04 pc 0000f534  /system/lib/libc.so (abort+4)
06-16 18:11:59.599 266-266/? I/DEBUG:     #05 pc 000121b3  /system/lib/libc.so (__libc_fatal+16)
06-16 18:11:59.599 266-266/? I/DEBUG:     #06 pc 00026961  /system/lib/libc.so (__bionic_heap_corruption_error+8)
06-16 18:11:59.599 266-266/? I/DEBUG:     #07 pc 00028167  /system/lib/libc.so (dlmalloc_real+2942)
06-16 18:11:59.600 266-266/? I/DEBUG:     #08 pc 0000f2d7  /system/lib/libc.so (malloc+10)
06-16 18:11:59.600 266-266/? I/DEBUG:     #09 pc 000456d9  /system/lib/libc++.so (_Znwj+16)
06-16 18:11:59.600 266-266/? I/DEBUG:     #10 pc 000a5c75  /system/lib/libart.so (_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEjjjjjjPKc+84)
06-16 18:11:59.600 266-266/? I/DEBUG:     #11 pc 000a5d59  /system/lib/libart.so (_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc+124)
06-16 18:11:59.600 266-266/? I/DEBUG:     #12 pc 001cb817  /system/lib/libart.so (_ZN3art3JNI9FindClassEP7_JNIEnvPKc+94)
06-16 18:11:59.601 266-266/? I/DEBUG:     #13 pc 000b41e3  /system/lib/libart.so (_ZN3art8CheckJNI9FindClassEP7_JNIEnvPKc+70)
06-16 18:11:59.601 266-266/? I/DEBUG:     #14 pc 00003abc  /data/app/com.myapp-2/lib/arm/libjnidispatch.so (throwByName+48)
06-16 18:11:59.601 266-266/? I/DEBUG:     #15 pc 00007750  /data/app/com.myapp-2/lib/arm/libjnidispatch.so (Java_com_sun_jna_Native_findSymbol+136)


biometricClient.identify triggers this consistently. It happens whether I call dispose on the objects or not. It works on my Samsung tablet, but crashes on my Lenovo. Any idea what could be the cause?

Thanks,
Cohn
cohnjarmack
 
Posts: 17
Joined: May 26, 2017 10:46

Re: Android app crash- heap corruption detected by dlmalloc_

Postby MartynasV » Jun 19, 2017 08:26

Hello,

Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
What exact Lenovo device you are using? What Android version does it have?

biometricClient.identify triggers this consistently. It happens whether I call dispose on the objects or not.

Are you able to reproduce this issue with any of our samples? If not, then send small test application, which would reproduce this issue, to support@neurotechnology.com(also provide detailed issue description and all requested information).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 242
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Android app crash- heap corruption detected by dlmalloc_

Postby cohnjarmack » Jun 19, 2017 10:00

Product revision number: 164281

The code which reproduces this:

Code: Select all
        biometricClient = new NBiometricClient();
        NSubject subject = new NSubject();
        NFinger finger = new NFinger();
        NBuffer srcPixels = NBuffer.fromArray(bytes);
        NImage image = NImage.fromMemory(srcPixels, NImageFormat.getJPEG());
        image.setHorzResolution(512);
        image.setVertResolution(512);
        image.setResolutionIsAspectRatio(false);
        finger.setImage(image);
        subject.getFingers().add(finger);
        if(id!=null) {
            subject.setId(id);
        }
       biometricClient.createTemplate(subject);


Here, I have loaded image into a byte array using:
Code: Select all
                        File file = new File(jpegFilePath);
         int size = (int) file.length();
         byte[] bytes = new byte[size];
         try {
            BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
            buf.read(bytes, 0, bytes.length);
            buf.close();
         } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }


The device model is in the stack trace - Lenovo/YT3-850M running lollipop LMY47V

Will send the sample application across if it is still required (Current application has a lot of other functionalities, and does not crash if the call to biometricClient is commented out.).

In the meantime, is there any wrong settings/library usage which could cause this?
cohnjarmack
 
Posts: 17
Joined: May 26, 2017 10:46

Re: Android app crash- heap corruption detected by dlmalloc_

Postby MartynasV » Jun 22, 2017 12:47

cohnjarmack wrote:Product revision number: 164281

The code which reproduces this:

Code: Select all
        biometricClient = new NBiometricClient();
        NSubject subject = new NSubject();
        NFinger finger = new NFinger();
        NBuffer srcPixels = NBuffer.fromArray(bytes);
        NImage image = NImage.fromMemory(srcPixels, NImageFormat.getJPEG());
        image.setHorzResolution(512);
        image.setVertResolution(512);
        image.setResolutionIsAspectRatio(false);
        finger.setImage(image);
        subject.getFingers().add(finger);
        if(id!=null) {
            subject.setId(id);
        }
       biometricClient.createTemplate(subject);


Here, I have loaded image into a byte array using:
Code: Select all
                        File file = new File(jpegFilePath);
         int size = (int) file.length();
         byte[] bytes = new byte[size];
         try {
            BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
            buf.read(bytes, 0, bytes.length);
            buf.close();
         } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }


The device model is in the stack trace - Lenovo/YT3-850M running lollipop LMY47V

Will send the sample application across if it is still required (Current application has a lot of other functionalities, and does not crash if the call to biometricClient is commented out.).

In the meantime, is there any wrong settings/library usage which could cause this?

Hello cohnjarmack,

I have failed to reproduce this issue, send small test application, which would reproduce this issue to support@neurotechnology.com(also provide detailed issue description).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 242
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 3 guests

cron