2

My users get this error 1k times per day. I have no idea where to start. I have checked first ~20 pages of Google on anything related to this and all questions on stackoverflow, none have helped me.

I am not using NDK in my app.

These crashes are happening on all devices and all android versions.

Here is the trace i got from Crashylitics:

        Crashed: Thread
    0  libc.so                        0x400af440 (Missing)
    1  (Missing)                      0x43d61d16 (Missing)
    2  (Missing)                      0x54f1affe (Missing)
    3  libandroid_runtime.so          0x40207325 (Missing)
    4  (Missing)                      0x42c8dbff (Missing)
    5  (Missing)                      0x54f1affe (Missing)
    6  (Missing)                      0x4cb2154e (Missing)
    7  libdvm.so                      0x41799b0e (Missing)
    8  (Missing)                      0x420397e6 (Missing)
    9  (Missing)                      0x43199276 (Missing)
    10 libdvm.so                      0x417caf4b (Missing)
    11 (Missing)                      0x4e5cdd19 (Missing)
    12 libandroid_runtime.so          0x402072ed (Missing)
    13 (Missing)                      0x4cdfe0b6 (Missing)
    14 libdvm.so                      0x417de65d (Missing)
    15 (Missing)                      0x41d7f41a (Missing)
    16 (Missing)                      0x43199276 (Missing)
    17 (Missing)                      0x42c8dc96 (Missing)
    18 (Missing)                      0x42c8dc96 (Missing)
    19 libdvm.so                      0x417f8a99 (Missing)
    20 (Missing)                      0x420127b6 (Missing)
    21 (Missing)                      0x42c8dc96 (Missing)
    22 libdvm.so                      0x417a60da (Missing)
    23 (Missing)                      0x43199276 (Missing)
    24 (Missing)                      0x4e1ef73e (Missing)
    25 (Missing)                      0x420397e6 (Missing)
    26 libdvm.so                      0x41799c7e (Missing)
    27 (Missing)                      0x43199276 (Missing)
    28 libdvm.so                      0x417a2eea (Missing)
    29 (Missing)                      0x43199276 (Missing)
    30 libdvm.so                      0x417aa4f2 (Missing)
    31 libdvm.so                      0x417aa4a2 (Missing)
    32 libdvm.so                      0x417a79d6 (Missing)
    33 (Missing)                      0x4cabeeae (Missing)
    34 (Missing)                      0x4dcb376e (Missing)
    35 libdvm.so                      0x417de657 (Missing)
    36 libc.so                        0x400e0032 (Missing)
    37 libdvm.so                      0x417d2b73 (Missing)
    38 libdvm.so                      0x417ee4d3 (Missing)
    39 libdvm.so                      0x4181a08a (Missing)
    40 (Missing)                      0x4cabeeae (Missing)
    41 libdvm.so                      0x417de67b (Missing)
    42 libdvm.so                      0x4181a08a (Missing)
    43 (Missing)                      0x4cabeeae (Missing)
    44 libdvm.so                      0x417d2c53 (Missing)
    45 libdvm.so                      0x417d2b73 (Missing)
    46 libdvm.so                      0x417d2b73 (Missing)
    47 libc.so                        0x400965b2 (Missing)
    48 libc.so                        0x400ae94c (Missing)
    49 libbinder.so                   0x4017facd (Missing)
    50 libbinder.so                   0x4017b90f (Missing)
    51 libc.so                        0x4009dfee (Missing)
    52 libc.so                        0x4009717a (Missing)
    53 libbinder.so                   0x401823f5 (Missing)
    54 libbinder.so                   0x40182461 (Missing)
    55 libbinder.so                   0x4017b771 (Missing)
    56 libgui.so                      0x4030bde9 (Missing)
    57 (Missing)                      0x4200ffff (Missing)
    58 libutils.so                    0x4012b813 (Missing)
    59 libandroid_runtime.so          0x401fb9c7 (Missing)
    60 (Missing)                      0x4cb1d75e (Missing)
    61 libdvm.so                      0x41799b0e (Missing)
    62 (Missing)                      0x4203610e (Missing)
    63 libdvm.so                      0x417caf4b (Missing)
    64 (Missing)                      0x4e5cd841 (Missing)
    65 libandroid_runtime.so          0x401fb9e1 (Missing)
    66 (Missing)                      0x4cb25316 (Missing)
    67 libdvm.so                      0x417de65d (Missing)
    68 (Missing)                      0x4e974c1e (Missing)
    69 (Missing)                      0x42b96456 (Missing)
    70 (Missing)                      0x4265745a (Missing)
    71 (Missing)                      0x42657456 (Missing)
    72 libdvm.so                      0x417d047b (Missing)
    73 (Missing)                      0x4e336b84 (Missing)
    74 (Missing)                      0x4203610e (Missing)
    75 libdvm.so                      0x41799c7e (Missing)
    76 libdvm.so                      0x417a2eea (Missing)
    77 libdvm.so                      0x417aa4f2 (Missing)
    78 libdvm.so                      0x417aa4a2 (Missing)
    79 libdvm.so                      0x417a79d6 (Missing)
    80 (Missing)                      0x42029446 (Missing)
    81 (Missing)                      0x4ea60b86 (Missing)
    82 (Missing)                      0x4cac55e6 (Missing)
    83 (Missing)                      0x41d67ffe (Missing)
    84 (Missing)                      0x426568a6 (Missing)
    85 (Missing)                      0x4cb96676 (Missing)
    86 (Missing)                      0x4265693a (Missing)
    87 (Missing)                      0x42656862 (Missing)
    88 libdvm.so                      0x417de993 (Missing)
    89 (Missing)                      0x4200e2a6 (Missing)
    90 (Missing)                      0x42656926 (Missing)
    91 (Missing)                      0x42656926 (Missing)
    92 libdvm.so                      0x417f8a99 (Missing)
    93 (Missing)                      0x4200ee8e (Missing)
    94 (Missing)                      0x42656926 (Missing)
    95 libdvm.so                      0x417a60da (Missing)
    96 (Missing)                      0x426568a6 (Missing)
    97 (Missing)                      0x42074fa6 (Missing)

UPD: Here is my app gradle:

    buildscript {
        repositories {
            maven { url 'https://maven.fabric.io/public' }
        }

        dependencies {
            classpath 'io.fabric.tools:gradle:1.+'
        }
    }
    //noinspection GradleCompatible
    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'

    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
    apply plugin: 'io.fabric'

    android {
        dexOptions {
            javaMaxHeapSize "4g"
        }
        signingConfigs {
        }
        compileSdkVersion 25
        buildToolsVersion '25.0.2'
        defaultConfig {
            multiDexEnabled true
            minSdkVersion 15
            targetSdkVersion 25
        }
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            debug {
                ext.enableCrashlytics = false
            }
        }

        productFlavors {
            normal {
                applicationId "xxx"
                versionCode 1
                versionName "1"
            }
        }

        packagingOptions {
            exclude 'META-INF/ASL2.0'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/MANIFEST.MF'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/license'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/notice'
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
        compile "org.jetbrains.anko:anko-common:$anko_version"
        compile group: 'com.pubnub', name: 'pubnub-gson', version: '4.14.0'
        compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.0'
        compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.0'

        //    compile 'com.google.android.gms:play-services-analytics:10.0.0'
    //    compile 'com.google.android.gms:play-services-gcm:10.0.0

    //    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    //    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'

        compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
            transitive = true;
        }
        compile('com.crashlytics.sdk.android:crashlytics-ndk:2.0.1@aar') {
            transitive = true;
        }

        compile 'com.parse.bolts:bolts-tasks:1.4.0'
        compile 'com.parse:parse-android:1.16.3'
        compile 'com.appsflyer:af-android-sdk:4.8.5'
        compile 'com.android.installreferrer:installreferrer:1.0'
        compile 'com.flurry.android:analytics:6.4.2'
        compile 'com.android.support:multidex:1.0.1'
        compile 'com.android.support:preference-v7:25.3.1'
        compile 'com.android.support:appcompat-v7:25.3.1'
        compile 'com.android.support:design:25.3.1'
        compile 'com.github.chrisbanes:PhotoView:1.2.6'
        compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
        compile 'com.google.code.gson:gson:2.8.1'
        compile 'com.vdurmont:emoji-java:3.3.0'
        compile 'com.scottyab:aescrypt:0.0.1'
        compile 'io.branch.sdk.android:library:1.14.5'
        compile 'com.google.android.gms:play-services-analytics:11.0.4'
        compile 'com.google.android.gms:play-services-gcm:11.0.4'
        compile 'com.otaliastudios:cameraview:1.4.1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
    }

    apply plugin: 'com.google.gms.google-services'

    crashlytics {
        enableNdk true
    }
lxknvlk
  • 2,744
  • 1
  • 27
  • 32

2 Answers2

1

Without having access to the source I can't be certain, but in AOSP we almost always saw these errors as a result of casts which were undefined behavior (described in Should I worry about the alignment during pointer casting?).

Some ARM instructions will fault on unaligned loads. These instructions are also faster than those that can be used for an unaligned load. If the compiler believes the load will be aligned, it will generate the faster code. If the load then isn't actually aligned, you'll get the fault you're seeing here.

These can be tricky to track down, but typically the problem is as shown in the other question I linked: there's a character buffer somewhere that is being cast to some other more strictly aligned type of data. You should be able to find it based on the crash dump.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79
0

I have found the problem. I tracked it by checking in which version did these crashes appear, and what i have added in that version. No other way found for tracking such problem.

The problem was i used one weird method to avoid OutOfMemory exceptions, that tried to use the sd card as ram in certain conditions. I suppose on devices without external sd card this was a problem.

lxknvlk
  • 2,744
  • 1
  • 27
  • 32