Native crashes on abort in developer console with Oreo (8.1)
Asked Answered
R

2

36

In the developer console I get more and more a native crash in abort. This occurs ONLY for android 8.1 device! Is anybody aware of a regression? Here is the backtrace:

   #00  pc 000000000001da4c  /system/lib64/libc.so (abort+112)
   #01  pc 0000000000007f7c  /system/lib64/liblog.so (__android_log_assert+312) 
   #02  pc 000000000006cff8  /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+324) 
   #03  pc 000000000006ad14  /system/lib64/libhwui.so (android::uirenderer::renderthread::OpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode)+72) 
   #04  pc 00000000000679ec  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::Surface*)+144) 
   #05  pc 00000000000703bc  /system/lib64/libhwui.so (android::uirenderer::renderthread::Bridge_initialize(android::uirenderer::renderthread::initializeArgs*)+16) 
   #06  pc 00000000000726c4  /system/lib64/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+24) 
   #07  pc 00000000000738d8  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+336) 
   #08  pc 0000000000011504  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+264) 
   #09  pc 00000000000a9830  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140) 
   #10  pc 0000000000069c94  /system/lib64/libc.so (__pthread_start(void*)+36) 
   #11  pc 000000000001eeec  /system/lib64/libc.so (__start_thread+68)

UPDATE: I guess the issue can be solved only by Google themselves :( Issue is tracked here https://issuetracker.google.com/issues/70259031
In the meantime, could someone already reproduce the issue or at least explain when the issue occurs? This would help to find a workaround!

Rarefied answered 26/1, 2018 at 8:14 Comment(15)
Hi. I have the same issues on my apps, did you find any solution?Slue
Great to hear, I'm not the only one ;) No, no solution and issue is still occuring :(Rarefied
JB Cha I started a bounty, hopefully we would get an answer :)Slue
we're going to need a lot more information to be able to help.Pointdevice
What are the missing information? I should be able to provide them as I have the exact same issueSlue
@ThomasThomas have you found anything? Or still facing this issue?Rarefied
I still have this issue in the reports.Slue
Fortunately I'm not the only one. I was going to get mad because of this crash report, glad it's not a problem of my code.Soraya
@Soraya I was thinking the same at the beginning. Unfortunately it does not seem to be a priority for Google :(Rarefied
Seriously, what's wrong with Google? Seems like there are tons of bugs they don't want to fix.Mombasa
are there any news about that?Cyndy
@Cyndy no, no news and no clue when Google will fix this. And I still don't know how to reproduce the issue. According to this comment: issuetracker.google.com/issues/70259031#comment30 issue could be due to too many open files. But that's not the case for me.Rarefied
We have the same problemOrientalize
Same problem hereGracie
Issue still appears (January 7, 2020)Oppenheimer
Z
4

that a Surface is being used hints for OpenGL ES and GLSurfaceView - which extends View.

a possible workaround might be to disable hardware acceleration for the views, which cause it to crash on Android 8.1 and 9.0 (as libhwui.so hints for) - because even if it gets fixed, any device not updated will still keep crashing. this can be done per View (see the documentation):

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
    mSurface.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

of course, this would result in sub-optimal performance; but still better than a crash.

Zamora answered 20/12, 2018 at 0:30 Comment(1)
Hii, where i need to add this lineRelive
F
4

Check out this answer:

tgkill - native error on Android 8.0 Samsung S8

It seems it might be related to Samsung S8 and Samsung S8+.

Basically, if you have an edit text in a dialog or dialog fragment, highlight the text and then close the dialog (or do an orientation change) this crash will occur.

To resolve the issue, I had to turn off hardwareAcceleration on the offending activities - this can be done in the manifest and will cause the activity to lag a bit.

   <activity android:name=".activities.CarDamageActivity"
           android:hardwareAccelerated="false" />

To help prevent the lag on OTHER devices, one can check the device model and if it is NOT a S8 or S8+, turn ON the hardware acceleration.

    String phoneMake =  Build.MANUFACTURER;
    String phoneModel =  Build.MODEL.toUpperCase();
    if (!(phoneMake.equalsIgnoreCase("samsung") && (phoneModel.startsWith("SM-G950")
            ||  phoneModel.startsWith("SM-G955")))) {
        window.setFlags(
                WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
                WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
    }
Fiftieth answered 23/1, 2019 at 8:9 Comment(2)
Disabling HW acceleration for the whole Activity is pointless, when it only affects a Surface.Zamora
I am getting this for instrumentation-tests on official API 28 Emulator (Android 9.0). And exactly after fixing Fragment dialog leak (by dismissing androidx Dialog in onPause callback). But I can not confirm anything Samsung related.Tidwell

© 2022 - 2024 — McMap. All rights reserved.