Search code examples
androidrenderscriptandroid-renderscript

Renderscript: Loading of ScriptC script failed


When the pre-launch report from Google comes in, there is 1 device (the Huawei Mate 9) that always has this crash: "Loading of ScriptC script failed". I have never had this issue on any other devices.

First, I get a native renderscript crash.

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'HUAWEI/MHA-L29/HWMHA:7.0/HUAWEIMHA-L29/C567B190:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 23408, tid: 23408, name: bcc  >>> /system/bin/bcc <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
x0   0000000000000000  x1   0000007bab3b6dc8  x2   0000007baac00000  x3   0000000000000005
x4   000000000000017c  x5   0000007baaf5d6b8  x6   0000007bab72a6be  x7   6871736eff736877
x8   0000000000000000  x9   0000007baba0c748  x10  000000000000017c  x11  0000000000000000
x12  0000007baba0c788  x13  0000000000000003  x14  000000000000000c  x15  2e8ba2e8ba2e8ba3
x16  0000007bad1b3e18  x17  0000007baca5521c  x18  0000000000000002  x19  0000007baba97fe8
x20  0000000000000000  x21  0000000000000000  x22  0000007bab3b6dc8  x23  0000007fe3f04078
x24  588d44aeb495b6a2  x25  0000007bab3b6dc8  x26  0000007baad7c890  x27  588d44aeb495b6a2
x28  0000007fe3f037c0  x29  0000007fe3f03670  x30  0000007bac9ff048
sp   0000007fe3f035a0  pc   0000007baca55258  pstate 0000000020000000
backtrace:
#00 pc 0000000000add258  /system/lib64/libLLVM.so (_ZN4llvm22AssumptionCacheTracker18getAssumptionCacheERNS_8FunctionE+60)
#01 pc 0000000000a87044  /system/lib64/libLLVM.so (_ZN4llvm14InlineFunctionENS_8CallSiteERNS_18InlineFunctionInfoEPNS_9AAResultsEb+21468)
#02 pc 0000000000039c4c  /vendor/lib64/libbccArm_v2.so (_ZN12rsTranslator29buildTranslatableFunctionListEPN4llvm6ModuleERNS0_9MapVectorIPNS0_8FunctionEN5RsAPI19rootFunctionProps_tENS0_8DenseMapIS5_jNS0_12DenseMapInfoIS5_EENS0_6detail12DenseMapPairIS5_jEEEENSt3__16vectorINSF_4pairIS5_S7_EENSF_9allocatorISI_EEEEEE+2344)
#03 pc 000000000003d0bc  /vendor/lib64/libbccArm_v2.so (_ZN12rsTranslator9translateEPN4llvm6ModuleES2_PFPvPKvPKcPmES5_+2448)
#04 pc 000000000003710c  /vendor/lib64/libbccArm_v2.so (_Z21translateModuleToMaliPN3bcc8RSScriptEPN4llvm6ModuleES4_+348)
#05 pc 0000000000067854  /system/lib64/libbcc.so (_ZN3bcc8RSScript11LinkRuntimeERS0_PKc+228)
#06 pc 000000000005cf78  /system/lib64/libbcc.so (_ZN3bcc16RSCompilerDriver13compileScriptERNS_8RSScriptEPKcS4_S4_S4_b+152)
#07 pc 000000000005df4c  /system/lib64/libbcc.so (_ZN3bcc16RSCompilerDriver17buildForCompatLibERNS_8RSScriptEPKcS4_S4_b+56)
#08 pc 00000000000054a4  /system/bin/bcc
#09 pc 000000000001a68c  /system/lib64/libc.so (__libc_init+88)
#10 pc 0000000000003f8c  /system/bin/bcc

And then I get the formal message that the loading failed (I load renderscript in a AsyncTask):

FATAL EXCEPTION: AsyncTask #1
Process: com.example.renderscripttest, PID: 23315
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:330)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:255)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
Caused by: android.support.v8.renderscript.RSRuntimeException: Loading of ScriptC script failed.
at android.support.v8.renderscript.ScriptC.<init>(ScriptC.java:61)
at com.example.renderscripttest.ScriptC_CalcScript.<init>(ScriptC_CalcScript.java:42)
at com.example.renderscripttest.ScriptC_CalcScript.<init>(ScriptC_CalcScript.java:34)
at com.example.renderscripttest.MainActivity.createScript(MainActivity.java:15660)
at com.example.renderscripttest.InitGPUThread.doInBackground(InitGPUThread.java:12)
at com.example.renderscripttest.InitGPUThread.doInBackground(InitGPUThread.java:5)
at android.os.AsyncTask$2.call(AsyncTask.java:316)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more

Here are my gradle settings:

compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId "com.example.renderscripttest"
    minSdkVersion 17
    targetSdkVersion 28
    versionCode 40
    versionName "1.1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
    renderscriptTargetApi 17
    renderscriptSupportModeEnabled true
}

How do I fix this?


Solution

  • I was getting crash reports with "Loading of ScriptC script failed." on Gigaset GS185 running Oreo 8.1

    After a long investigation we discovered that the error occurs only when the App is moved the SD card. Perhaps Google also installs Apps on external storage for testing? I think Android compiles RenderScript at runtime and probably that fails if the script is on a SD card.