Search Unity

Crash on Android with signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000000f0

Discussion in 'Android' started by ercion, Sep 23, 2017.

  1. ercion

    ercion

    Joined:
    Aug 15, 2016
    Posts:
    73
  2. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    I faced this issue again.
    In this case was because of the rewarded and close callback from the Admob SDK.
    Admob SDK callbacks might get called from another thread if Multithreaded Rendering is Active on PlayerSettings.
    If you order your UI or something graphic related from a thread that isnt the main thread it will crash.
    So, if you modify any Graphic from an Admob Callback you might get this error.

    Of course it can happen for other reasons. But in my case was because of a miss-use of these Callbacks.
    Fixes:
    A. Disable Multithreaded Rendering as stated in another response
    or
    B. Instead of calling the UI from the Callback, start a Coroutine, wait one frame ( "yield return null") then call the UI. Coroutine will the switch to the main thread.

    I have tested both, and both works. (In my case).
    Hope it helps.
     
    ilmario, erenaydin and p0w1nd like this.
  3. dreyyy07

    dreyyy07

    Joined:
    May 7, 2017
    Posts:
    8
    I got a similar crash every time I launched my app.

    Caused by java.lang.Error
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000071f1f99ff8

    I tried clearing the app cache an then data, the app now launches properly.
     
    MD_Reptile likes this.
  4. shadowthunder24

    shadowthunder24

    Joined:
    Jun 19, 2019
    Posts:
    8
    I had the same problem and I think I've figured out a way of solving it in my case:

    Usually when we download a Unity Editor we also end up using the SDK, NDK and JDK that are installed through the Unity Hub via 'Add Modules'.

    I have come to realise during my time dealing with hours and hours of problems ranging from this current issue to 'Strip Engine Code' not working and AdSize.SmartBanner chucking an error and crashing the app during launch, these problems are coming from the NDK and SDK that are installed via Unity Editor 'Add Modules'.

    Yes, I am saying that Unity provides buggy NDK and SDK package installs that lead to build errors and even issues inside the Google Play Console running tests which can lead to a native crash such as the signal 11 (SIGSEGV).

    How I solved the problem?

    I simply downloaded the SDK and NDK directly from their original source and override the SDK and NDK in which Unity would use if you were to download it from there. So go to Edit > Preferences > External Tools and replace the SDK and NDK with the ones you manually had to download.

    Hopefully this helps some of you.
     
    Marcos-Elias likes this.
  5. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    This solution worked for me on Unity 2019.1.9f1 while building IL2CPP and gettings the "signal 11 (SIGSEGV)" error in ADB logcat.

    I just cleared the apps data and cache (which made little sense, as it was recently reinstalled, but apparently that does not clear the data) in the app settings, and then the app began working just fine! Thanks for the solution!
     
  6. Bibzball

    Bibzball

    Joined:
    Sep 26, 2015
    Posts:
    21
    Damn, thank you SO MUCH!
    I can't believe reinstalling does not clear the data.
     
    timurkarijob and MD_Reptile like this.
  7. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I wanted to follow up here and mention a more permanent fix.

    If your app is crashing after an update of the unity editor, and requires you to delete app cache and data before the app will launch - the solution is to create an android manifest (or edit an existing one) like this:

    Code (XML):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.    package="com.YourAppPackage.NameHere>
    4.    <application
    5.        android:allowBackup="false"
    6.        android:fullBackupContent="false"
    7.        <activity android:name=".MainActivity">
    8.            <intent-filter>
    9.                <action android:name="android.intent.action.MAIN" />
    10.                <category android:name="android.intent.category.LAUNCHER" />
    11.            </intent-filter>
    12.        </activity>
    13.    </application>
    14. </manifest>
    The important lines are android:allowBackup="false" and android:fullBackupContent="false". I assumed this would prevent playerprefs from carrying over to the new version - but it does still keep playerprefs. This prevents the crash on startup without the user needing to clear app data or cache!

    The "AndroidManifest.xml" file will need to be inside the "Plugins" folder of your project!
     
  8. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Using Unity 2018.3.14 turning off multi-threaded rendering worked for me, app was crashing just on Pixel 2 and 3 phones with Android 9.0

    Unfortunately this fix only worked for one app.... others still crashing despite all efforts

    Turns out the issue was building in Gradle and applying the recommended Gradle plugin update. NOT doing that update fixed the problem for Android 9.0 devices.
     
    Last edited: Oct 1, 2019
  9. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I was getting this error on many devices - always a user who had already had the app installed and updated after I migrated from 2018.x to 2019.x and never new users. It must be something to do with the cache / data of the app not being compatible I suppose.
     
    leni8ec likes this.
  10. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    Same man i reported bug i think it is related to sdk or ndk do you use 2019.3.0b4?
     
  11. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    2019.2.3f1 and just downloaded 2019.2.6f1 - can't recall the version of 2018 I was using before moving to 2019, but my advice is that anybody who doesn't have to update an android project from 2018 to 2019 for any major reason is to stick with 2018 and instead just start new projects on 2019 to avoid any possible issues there.
     
  12. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I found my problem. It was about custom shader. I changed fallback as Urp shaders fallback which is "Hidden/InternalErrorShader" and i was using fixed4 then i changed fixed4 to float4 now it works. I don't know what has fixed that but i was using clip function as this way clip(x.a - _Cutoff); then i changed it to clip(x.a < _Cutoff ? -1 : 1); i don't know which one fixed it but no more crash.
    Edit:I think i was wrong it's all about shader variant problem. So if your game gives this crash just renew shader variant then build it again.
     
    Last edited: Oct 7, 2019
  13. Bryarey

    Bryarey

    Joined:
    Aug 24, 2014
    Posts:
    25
    Thanks, it`s a great idea to add such dev manifest, only need to not forget to remove it before release :)
    Also I has to slightly modify it, because I`m using google services, which declares that variables as true:
    Code (XML):
    1.  
    2. <manifest   xmlns:android = "http://schemas.android.com/apk/res/android"
    3.             xmlns:tools="http://schemas.android.com/tools"
    4.             package="com.YourAppPackage.NameHere">
    5.    
    6. <application
    7.     tools:replace="android:allowBackup"
    8.     android:allowBackup="false"
    9.     android:fullBackupContent="false">
    10.  
     
  14. homerwang

    homerwang

    Joined:
    Nov 20, 2019
    Posts:
    1
    In my environment, Unity 2018.3.8f1
    I had same issue on a few models of Android phones since previous release.
    Multithreaded Rendering is unchecked through the project lifetime
    Previously I build and upload to Google Play Store with APK format, this issue happed since I started to upload with AAB format.
    I solved this issue by:
    uncheck "Split APKs by target architecture (Experimental)
     
  15. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    I'm encountering this same issue. Google led me here.
    My game crashes when back from Admob rewarded ad (which calls a callback and this callback has UI stuff). I tried solution B and it works for me. Thanks a lot!!

    Unity 2018.4.23f1
     
    MD_Reptile likes this.
  16. LandonC

    LandonC

    Joined:
    Dec 20, 2012
    Posts:
    83
    In my case, I am using Google Play Service to do cloud saves. Saving Player Prefs right after GooglePlay plugin Authenticated caused the error. The error disappeared once Player Prefs is saved in later frames.
     
    erenaydin likes this.