BlurView icon indicating copy to clipboard operation
BlurView copied to clipboard

eightbitlab.com.blurview.RenderScriptBlur.blur ANR triggered by main thread waiting for too long

Open jasondem opened this issue 2 years ago • 5 comments

Please include:

  1. Library version version-2.0.3

  2. Device and OS version all devices OS version are android 11,such as Vivo 1901,Galaxy A50,Realme C12,CPH2239

  3. Detailed steps to reproduce the issue I don‘t konw how to reproduce it

  4. XML layout and code for BlurView setup

  5. Stacktrace in case of a crash image

jasondem avatar Aug 23 '23 06:08 jasondem

Provide the details required in the bug report. There's not much I can do without steps to reproduce

Dimezis avatar Aug 23 '23 07:08 Dimezis

It is a bottom navigationBar, I use BulrView to achieve the bottom navigation bar frosted-glass effect, anr place in 'RenderScriptBlur.blur', is frosted-glass rendering placed in other threads can solve this problem?

jasondem avatar Aug 23 '23 07:08 jasondem

main (native):tid=1 systid=19015 #00 pc 0x7550c libc.so (syscall + 28) #01 pc 0x1af800 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 148) #02 pc 0x669eb0 libart.so (art::GoToRunnable(art::Thread*) + 460) #03 pc 0x669ca0 libart.so (art::JniMethodEnd(unsigned int, art::Thread*) + 28) at android.renderscript.RenderScript.rsnScriptSetVarObj(Native method) at android.renderscript.RenderScript.nScriptSetVarObj(RenderScript.java:832) at android.renderscript.Script.setVar(Script.java:438) at android.renderscript.ScriptIntrinsicBlur.setInput(ScriptIntrinsicBlur.java:70) at eightbitlab.com.blurview.RenderScriptBlur.blur(RenderScriptBlur.java:69) at eightbitlab.com.blurview.PreDrawBlurController.blurAndSave(PreDrawBlurController.java:172) at eightbitlab.com.blurview.PreDrawBlurController.updateBlur(PreDrawBlurController.java:122) at eightbitlab.com.blurview.PreDrawBlurController$1.onPreDraw(PreDrawBlurController.java:50) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3451) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2257) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8796) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1161) at android.view.Choreographer.doCallbacks(Choreographer.java:983) at android.view.Choreographer.doFrame(Choreographer.java:908) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1146) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:263) at android.app.ActivityThread.main(ActivityThread.java:8292) at java.lang.reflect.Method.invoke(Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)

jasondem avatar Aug 23 '23 08:08 jasondem

I don't think it's BlurView's problem. Something is holding that lock libart waits on (WaitHoldingLocks). Most likely it's just an unlucky coincidence that the BlurView happens to execute the blur when the lock is busy, and the root cause is elsewhere.

Dimezis avatar Aug 23 '23 11:08 Dimezis

Thank you. I'll find out if it's caused by other places.

jasondem avatar Aug 24 '23 02:08 jasondem