-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rare crashes in buffer list's RecyclerView
#512
Comments
some thoughts & ideas:
what seems to help is; moving also, another related issue might be some stuck rows. they are usually semi transparent so must've been abandoned in the process of animation. the animation itself got canceled, but the view wasn't removed or recycled or anything and it just stays there. probably another manifestation of the underlying issue also, the last crash was mentioned in #459 |
fixes #512 hopefully this will get rid of the following bugs, although i have no idea why RelativeLayout was a problem: java.lang.NullPointerException: Attempt to read from field 'android.view.View androidx.recyclerview.widget.RecyclerView$ViewHolder.itemView' on a null object reference at androidx.recyclerview.widget.DefaultItemAnimator.runPendingAnimations(DefaultItemAnimator.java:157) at androidx.recyclerview.widget.RecyclerView$2.run(RecyclerView.java:589) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967) at android.view.Choreographer.doCallbacks(Choreographer.java:791) at android.view.Choreographer.doFrame(Choreographer.java:722) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940) java.lang.IllegalArgumentException: view is not a child, cannot hide android.widget.RelativeLayout{b13601 VFE...C.. ......ID 0,981-539,1066 #7f08004e app:id/bufferlist_item_container} at androidx.recyclerview.widget.ChildHelper.unhide(ChildHelper.java:352) at androidx.recyclerview.widget.RecyclerView$Recycler.getScrapOrHiddenOrCachedHolderForPosition(RecyclerView.java:6393) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5896) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924) at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3336) at android.view.View.measure(View.java:25086) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481) at android.view.View.measure(View.java:25086) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6872) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1204) at android.widget.LinearLayout.onMeasure(LinearLayout.java:723) at android.view.View.measure(View.java:25086) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6872) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:146) at android.view.View.measure(View.java:25086) java.lang.RuntimeException: trying to unhide a view that was not hiddenandroid.widget.TextView{74540c2 VFED..C.. ........ 0,807-196,859} at androidx.recyclerview.widget.ChildHelper.unhide(ChildHelper.java:355) at androidx.recyclerview.widget.RecyclerView$Recycler.getScrapOrHiddenOrCachedHolderForPosition(RecyclerView.java:6393) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5896) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517) at androidx.recyclerview.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1331) at androidx.recyclerview.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1075) at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:1832) at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5067) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967) at android.view.Choreographer.doCallbacks(Choreographer.java:791) at android.view.Choreographer.doFrame(Choreographer.java:722) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940) java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 14(offset:-1).state:15 androidx.recyclerview.widget.RecyclerView{9dd3ee8 VFED.V... ......ID 0,0-539,957 #7f0800e7 app:id/recycler}, adapter:com.ubergeek42.WeechatAndroid.adapters.BufferListAdapter@c99d850, layout:com.ubergeek42.WeechatAndroid.views.FullScreenDrawerLinearLayoutManager@b49aa49, context:com.ubergeek42.WeechatAndroid.WeechatActivity@89ce4b9 at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5923) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3875) at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3639) at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1888) at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5044) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967) at android.view.Choreographer.doCallbacks(Choreographer.java:791) at android.view.Choreographer.doFrame(Choreographer.java:722) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
the issue might happen a tad more rarely now but still exists |
apparently this issue affects buffer fragment's
|
there are a few very rare bugs related to buffer list's
RecyclerView
and its item animator. these bugs has been present in the app for a long time. it is possible to reproduce them, but it takes a bit of effort, even then it's not reliable and can take tens of minutes to reproduce. i could not reproduce these bugs in isolated environment.at this time my best guess is some obscure race condition in the library code. for the first bug to manifest, apparently you have to trigger a change animation, which is then ended by subsequent animation:
DefaultItemAnimator.runPendingAnimations()
then schedules animation using the deleted view holder, which leads to a crash:the holder in question comes from
mPendingChanges
. i gather it shouldn't be there as it must've been removed by something around the call toendChangeAnimationIfNecessary
. so theRecyclerView
is in some bad state. i think this underlying issue causes the other crashes as well.in order of the frequency of appearance, these are:
(ignore the fact that it's a
TextView
above, notbufferlist_item_container
)These can be triggered on current search & master branches by simulating rapid buffer list changes by using this and perhaps by having the following in
WeechatActivity.onHotlistSelected()
:The text was updated successfully, but these errors were encountered: