signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.69k stars 6.17k forks source link

Signal crashes when changing from vertical to horizontal view with keyboard open. #6045

Closed lazlolazlolazlo closed 6 years ago

lazlolazlolazlo commented 7 years ago

I have:


Bug description

Signal hangs and then crashes if I switch from vertical to horizontal view with the keyboard open.

Steps to reproduce

Actual result: Signal hangs and crashes. Expected result: Signal switches between vertical and horizontal mode.

Device info

Device: motorola XT1021 Android version: 4.4.4 Signal version: 3.26.2

Link to debug log

adb logcat: https://gist.github.com/anonymous/55f564648f0fe510c718fa11d6d0b202

2-4601 commented 7 years ago
W/EmojiProvider(21425): java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
W/EmojiProvider(21425):     at java.util.concurrent.FutureTask.report(FutureTask.java:93)
W/EmojiProvider(21425):     at java.util.concurrent.FutureTask.get(FutureTask.java:163)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.util.ListenableFutureTask.callback(ListenableFutureTask.java:84)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.util.ListenableFutureTask.addListener(ListenableFutureTask.java:60)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.components.emoji.EmojiProvider.getEmojiDrawable(EmojiProvider.java:102)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.components.emoji.EmojiProvider.emojify(EmojiProvider.java:80)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.components.emoji.EmojiTextView.setText(EmojiTextView.java:39)
W/EmojiProvider(21425):     at android.widget.TextView.setText(TextView.java:3646)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.ConversationItem.setBodyText(ConversationItem.java:286)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.ConversationItem.bind(ConversationItem.java:194)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.ConversationAdapter.onBindItemViewHolder(ConversationAdapter.java:151)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.ConversationAdapter.onBindItemViewHolder(ConversationAdapter.java:61)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.database.CursorRecyclerViewAdapter.onBindViewHolder(CursorRecyclerViewAdapter.java:147)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6279)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6312)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5258)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5521)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5363)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5359)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2141)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1525)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1488)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:560)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3506)
W/EmojiProvider(21425):     at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2969)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
W/EmojiProvider(21425):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
W/EmojiProvider(21425):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:823)
W/EmojiProvider(21425):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.onMeasure(QuickAttachmentDrawer.java:242)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutCompat.measureChildBeforeLayout(LinearLayoutCompat.java:1377)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutCompat.measureHorizontal(LinearLayoutCompat.java:1023)
W/EmojiProvider(21425):     at android.support.v7.widget.LinearLayoutCompat.onMeasure(LinearLayoutCompat.java:553)
W/EmojiProvider(21425):     at org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout.onMeasure(KeyboardAwareLinearLayout.java:82)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
W/EmojiProvider(21425):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
W/EmojiProvider(21425):     at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
W/EmojiProvider(21425):     at android.view.View.measure(View.java:16521)
W/EmojiProvider(21425):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
W/EmojiProvider(21425):     at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:393
I/InputDispatcher( 1970): Application is not responding: AppWindowToken{4274c408 token=Token{41df1468 ActivityRecord{41d2d4d8 u0 org.thoughtcrime.securesms/.ConversationActivity t43}}} - Window{42482128 u0 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity}.  It has been 5006.9ms since event, 5005.4ms since wait started.  Reason: Waiting because the focused window has not finished processing the input events that were previously delivered to it.
I/WindowManager( 1970): Input event dispatching timed out sending to org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity.  Reason: Waiting because the focused window has not finished processing the input events that were previously delivered to it.
W/InputDispatcher( 1970): Asynchronous input event injection timed out.
I/Process ( 1970): Sending signal. PID: 21425 SIG: 3
2-4601 commented 7 years ago

I can NOT reproduce this with: Motorola Moto G4 Play Signal 3.26.2 Android 6.0.1

sbaum commented 7 years ago

A friend of mine is experiencing the same problem. He's running some older version of CyanogenMod (Android 4.4.x) on his Samsung Galaxy S3. So this problem could be related to Android 4.4...

johanw666 commented 7 years ago

I can not reproduce this on a Sony Xperia Z1 Compact at stock 4.4.4.

moxie0 commented 7 years ago

Might have something to do with the recent changes to support image keyboards. I could turn that off for <= 5.0

lazlolazlolazlo commented 7 years ago

Unfortunately bbb8ac1 does not fix this issue. When the keyboard is opened and you rotate the phone only half of screen is used. After rotating back, Signal hangs.

signal-2017-01-18-092818

Could be something with the emoji drawer. After recent changes sometimes some of the emoji are missing. They reappear after restart.

moxie0 commented 7 years ago

oh, yeah looking at the log it's just an OOM. seems as if your device doesn't have enough memory to load the emoji pages, crazy

johanw666 commented 7 years ago

So we can reverse https://github.com/WhisperSystems/Signal-Android/commit/bbb8ac113ba0a516668b1166e2e0641af348e821 ?

nrizzio commented 7 years ago

I have the same problem, same steps to reproduce, but different exception and crash (not an OOM):

E/AndroidRuntime(20890): FATAL EXCEPTION: main
E/AndroidRuntime(20890): Process: org.thoughtcrime.securesms, PID: 20890
E/AndroidRuntime(20890): java.lang.IllegalStateException: couldn't move cursor to position -1
E/AndroidRuntime(20890):    at org.thoughtcrime.securesms.database.CursorRecyclerViewAdapter.getCursorAtPositionOrThrow(CursorRecyclerViewAdapter.java:181)
E/AndroidRuntime(20890):    at org.thoughtcrime.securesms.ConversationAdapter.getHeaderId(ConversationAdapter.java:296)
E/AndroidRuntime(20890):    at org.thoughtcrime.securesms.ConversationFragment$ConversationScrollListener.bindScrollHeader(ConversationFragment.java:491)
E/AndroidRuntime(20890):    at org.thoughtcrime.securesms.ConversationFragment$ConversationScrollListener.onScrolled(ConversationFragment.java:455)
E/AndroidRuntime(20890):    at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4541)
E/AndroidRuntime(20890):    at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3602)
E/AndroidRuntime(20890):    at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3265)
E/AndroidRuntime(20890):    at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3767)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.onLayout(QuickAttachmentDrawer.java:189)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.support.v7.widget.LinearLayoutCompat.setChildFrame(LinearLayoutCompat.java:1645)
E/AndroidRuntime(20890):    at android.support.v7.widget.LinearLayoutCompat.layoutHorizontal(LinearLayoutCompat.java:1634)
E/AndroidRuntime(20890):    at android.support.v7.widget.LinearLayoutCompat.onLayout(LinearLayoutCompat.java:1409)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
E/AndroidRuntime(20890):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(20890):    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(20890):    at android.view.View.layout(View.java:16916)
E/AndroidRuntime(20890):    at android.view.ViewGroup.layout(ViewGroup.java:5405)
E/AndroidRuntime(20890):    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2413)
E/AndroidRuntime(20890):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2122)
E/AndroidRuntime(20890):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1264)
E/AndroidRuntime(20890):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6942)
E/AndroidRuntime(20890):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
E/AndroidRuntime(20890):    at android.view.Choreographer.doCallbacks(Choreographer.java:590)
E/AndroidRuntime(20890):    at android.view.Choreographer.doFrame(

Let me know if this should go in a separate issue.

KarolTrzeszczkowski commented 7 years ago

The same bug, meizu m2 note with fleksy keyboard. My debug log: https://gist.github.com/751ad221d5e1cde237b22a2c30be1de5

haffenloher commented 7 years ago

@nrizzio @KarolTrzeszczkowski that's a different crash, looks like it's related to the new date headers.

automated-signal commented 6 years ago

GitHub Issue Cleanup: See #7598 for more information.