1

On my Google Play Console I've got some reports for an application (FYI, it also uses JNI). This is the backtrace:

  native: pc 00000000002c0536  /system/lib/libart.so (_ZN3artL16Unsafe_putDoubleEP7_JNIEnvP8_jobjectS3_xd+31)
  native: pc 0000000073bb9609  /data/dalvik-cache/arm/system@framework@boot.oat

I am not able to catch it with any crash reporting system (Google Analytics, Crashlytics) and of course have no clue on how to reproduce it.

Interestingly, the devices affected for most are the ones from Motorola Moto G series and mid-aged Samsung Galaxy's.

The problem looks like to be outside from my application but I still would like to know which part of my code causes it so I can try a workaround to make it also work on those devices. Is it possible to spot the problem without having physically the device?

Gradle.build

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 294
        versionName "1.6.268"
        vectorDrawables.useSupportLibrary = true
        externalNativeBuild {
            ndkBuild {
                arguments "APP_STL:=gnustl_static"
            }
        }
    }

    dexOptions {
        javaMaxHeapSize "12g"
        jumboMode true
    }

    applicationVariants.all { variant ->
        variant.resValue "string", "versionName", variant.versionName
    }

    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.releaseConfig
            externalNativeBuild {
                ndkBuild {
                    cFlags "-DDEBUG_MODE=0"
                }
            }
        }
        debug {
            debuggable true
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            externalNativeBuild {
                ndkBuild {
                    cFlags "-DDEBUG_MODE=1"
                }
            }
        }
    }

    externalNativeBuild {
        ndkBuild {
            path 'src/main/jni/Android.mk'
        }
    }
    return void
}

Gradle version is 2.3.3 and also Android Studio 2.3.3.

Digging inside the old crash report section of Google Play Console, I found that it displays the full native crash data:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
LineageOS Version: 'unknown'
Build fingerprint: 'samsung/j5lteub/j5lte:6.0.1/MMB29M/J500MUBU1BQH2:user/release-keys'
Revision: '5'
ABI: 'arm'
pid: 10935, tid: 11080, name: glide-source-th  >>> com. <<<
signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x902d8000
    r0 a4b3a670  r1 9385e5ec  r2 902d8000  r3 00000000
    r4 00000075  r5 70edc0cc  r6 902d8000  r7 00000000
    r8 00000063  r9 94903f00  sl 0000001b  fp 00000075
    ip b0052537  sp 9385e5e0  lr 73cc09a3  pc b0052536  cpsr 600d0030

backtrace:
    #00 pc 002c0536  /system/lib/libart.so (_ZN3artL16Unsafe_putDoubleEP7_JNIEnvP8_jobjectS3_xd+31)
    #01 pc 73cc09a1  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x283e000)

This would mean that it's not about my own code, not entirely at least, in fact you can see the process name is glide-source-th, yes, Glide. So much for today, I will keep it updated once I get in touch with Glide support (see GitHub issue).

fillobotto
  • 3,698
  • 5
  • 34
  • 58
  • On lollipop android OS 5.0.x--This appears to be a problem with Samsung extensions and zipalign -z (Zopfli compression). Remove the "-z" and the problem should go away. – Jon Goodwin Oct 14 '17 at 14:19
  • @JonGoodwin I'm not using zipalign – fillobotto Oct 14 '17 at 15:19
  • You have deliberately omitted the align step (zipalign) of a signed app ? Why on Earth would you do that ? – Jon Goodwin Oct 14 '17 at 20:43
  • @JonGoodwin I mean Zopfli. Does Android Studio apk signing process add -z by itself? If so, how to remove it? – fillobotto Oct 14 '17 at 20:59
  • Android Studio apk signing is indeed automatically aligned. You need to show your app build.gradle, I'm not a mind reader. – Jon Goodwin Oct 14 '17 at 21:46
  • @JonGoodwin done – fillobotto Oct 14 '17 at 22:43
  • I cannot find that "Zopfli" was ever in the default release build tools. It seems it was always a post build extra step. Might be nice to see gradle plugin version (in the top level build.gradle)[looks like this:- classpath 'com.android.tools.build:gradle:2.1.2']. Also the version of Android Studio you are using (some bugs reported with different combinations). buildTypes { release {zipAlignEnabled true} won't to any harm. Seems like it should be something else. A more complete back-trace would help. I guess you could manually align it to be sure, and also runzipalign -c -v 4 app.apk – Jon Goodwin Oct 15 '17 at 00:31
  • Everything in my setup is version 2.3.3. However the only affected OS is 7.X – fillobotto Oct 15 '17 at 19:17
  • Thread updated with some (neutral) news. – fillobotto Mar 24 '18 at 21:36

0 Answers0