Fatal signal 11 (SIGSEGV), code 1 when calling model.load()

username: Chame_call
cooked: <p>When starting the application I get the following output and app crashes:</p>
<pre><code class="lang-auto"> W/linker: libpytorch_jni.so: unused DT entry: type 0x6ffffffe arg 0x2f524
    libpytorch_jni.so: unused DT entry: type 0x6fffffff arg 0x3
    libfbjni.so: unused DT entry: type 0x6ffffffe arg 0x2e18c
W/linker: libfbjni.so: unused DT entry: type 0x6fffffff arg 0x2
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19006 (rg.pytorch.demo)
Process 19006 terminated.
</code></pre>
<pre><code class="lang-auto">My `build.gradle`:

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

repositories {
    jcenter()
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
}

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "org.pytorch.demo"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    def camerax_version = '1.0.0-alpha05'
    implementation "androidx.camera:camera-core:$camerax_version"
    implementation "androidx.camera:camera-camera2:$camerax_version"
    implementation 'com.google.android.material:material:1.0.0-beta01'


    implementation 'org.pytorch:pytorch_android:1.4.0-SNAPSHOT'
    implementation 'org.pytorch:pytorch_android_torchvision:1.4.0-SNAPSHOT'
    implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
}
</code></pre>
<p>What causes the crash?</p>

username: Chame_call
cooked: <p>The strangest thing that I already launched the app early.<br>
And as I have the previous built .apk I compared it with my new one.<br>
And they differ in sizes of libs (on the screen below), but when I replace my new libs in …/gradle/caches/… by older ones and build app in Android Studio they are replaced again.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/9/49a2ed8779febe7d911fb7a1ce164518f54a2cae.png" data-download-href="https://discuss.pytorch.org/uploads/default/49a2ed8779febe7d911fb7a1ce164518f54a2cae" title="Selection_035"><img src="https://discuss.pytorch.org/uploads/default/original/3X/4/9/49a2ed8779febe7d911fb7a1ce164518f54a2cae.png" alt="Selection_035" data-base62-sha1="avpVs2dc3uJoczocCMYQ4Vg3T4i" width="690" height="144" data-dominant-color="F2F2F2"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Selection_035</span><span class="informations">940×197 12.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: Chame_call
cooked: <p>So why app is built with different libs in different cases?</p>

username: Chame_call
cooked: <p>Is that possible that <code>pytorch_android_torchvision:1.4.0-SNAPSHOT</code> was updated and older version worked while current doesn’t…?</p>

username: David_Reiss
cooked: <p>This is a bug.  Fix is <a href="https://github.com/pytorch/pytorch/pull/31582">https://github.com/pytorch/pytorch/pull/31582</a> .  Should be available in the next nightly build.  Sorry for the trouble.</p>

username: Chame_call
cooked: <p>You mean I have to make correspond corrects like in <a href="http://here" rel="nofollow noopener">https://github.com/pytorch/pytorch/pull/31582/commits/25345223c6c6e5912f2d02894bf4475270ad1a12</a> ?</p>
<p>or vice versa??</p>

username: David_Reiss
cooked: <p>Oh, no.  Sorry.  I meant it is a bug in PyTorch, and that commit should fix it.  Please try again with the latest nightly release, without changing any of your code, and the problem should be gone.</p>

username: Chame_call
cooked: <p>thanks, problem has gone)</p>