Skip to content
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

Repeated crashing/bricked app #2105

Closed
idk-r-n opened this issue Dec 26, 2023 · 12 comments · Fixed by #2163
Closed

Repeated crashing/bricked app #2105

idk-r-n opened this issue Dec 26, 2023 · 12 comments · Fixed by #2163
Assignees
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@idk-r-n
Copy link

idk-r-n commented Dec 26, 2023

Steps to reproduce

After being a member of a room that was massively spammed, the app repeatedly crashed on launch. I am unable to to send a bug report from within the app.

type: crash
osVersion: google/oriole/oriole:14/UQ1A.231205.015/2023121200:user/release-keys
package: io.element.android.x:40004000
process: io.element.android.x
processUptime: 548 + 180 ms
installer: com.android.vending

java.lang.IllegalArgumentException: Can't represent a size of 652911 in Constraints
	at kotlin.UByte$Companion.bitsNeedForSize(SourceFile:41)
	at kotlin.UByte$Companion.createConstraints-Zbe2FdA$ui_unit_release(SourceFile:18)
	at kotlin.random.RandomKt.Constraints(SourceFile:27)
	at kotlin.random.RandomKt.Constraints$default(SourceFile:25)
	at _COROUTINE._BOUNDARY.finalConstraints-tfFHcEY(SourceFile:55)
	at androidx.compose.foundation.text.modifiers.MultiParagraphLayoutCache.layoutText-K40F9xA(SourceFile:15)
	at androidx.compose.foundation.text.modifiers.MultiParagraphLayoutCache.intrinsicHeight(SourceFile:19)
	at androidx.compose.foundation.text.modifiers.TextAnnotatedStringNode.maxIntrinsicHeight(SourceFile:9)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicHeight(SourceFile:8)
	at androidx.compose.ui.layout.MeasuringIntrinsics$DefaultIntrinsicMeasurable.measure-BRTryo0(SourceFile:132)
	at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(SourceFile:1)
	at androidx.compose.ui.unit.Density$-CC.$default$maxIntrinsicHeight(SourceFile:25)
	at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.maxIntrinsicHeight(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicHeight(SourceFile:8)
	at androidx.compose.ui.layout.MeasuringIntrinsics$DefaultIntrinsicMeasurable.measure-BRTryo0(SourceFile:132)
	at androidx.compose.foundation.layout.PaddingNode.measure-3p2s80s(SourceFile:33)
	at androidx.compose.ui.unit.Density$-CC.$default$maxIntrinsicHeight(SourceFile:25)
	at androidx.compose.foundation.layout.PaddingNode.maxIntrinsicHeight(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicHeight(SourceFile:8)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.maxIntrinsicHeight(SourceFile:10)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:80)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:44)
	at androidx.compose.foundation.layout.OffsetKt.access$intrinsicSize(SourceFile:262)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:116)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:85)
	at androidx.compose.foundation.layout.RowColumnMeasurePolicy.maxIntrinsicHeight(SourceFile:28)
	at androidx.compose.ui.node.InnerNodeCoordinator.maxIntrinsicHeight(SourceFile:19)
	at androidx.compose.ui.layout.MeasuringIntrinsics$DefaultIntrinsicMeasurable.measure-BRTryo0(SourceFile:132)
	at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(SourceFile:97)
	at androidx.compose.ui.unit.Density$-CC.$default$maxIntrinsicHeight(SourceFile:25)
	at androidx.compose.foundation.layout.FillNode.maxIntrinsicHeight(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicHeight(SourceFile:8)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.maxIntrinsicHeight(SourceFile:10)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:69)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:33)
	at androidx.compose.foundation.layout.OffsetKt.access$intrinsicSize(SourceFile:155)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:111)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:80)
	at androidx.compose.foundation.layout.RowColumnMeasurePolicy.maxIntrinsicWidth(SourceFile:28)
	at androidx.compose.ui.node.InnerNodeCoordinator.maxIntrinsicWidth(SourceFile:19)
	at androidx.compose.ui.layout.MeasuringIntrinsics$DefaultIntrinsicMeasurable.measure-BRTryo0(SourceFile:101)
	at androidx.compose.foundation.layout.PaddingNode.measure-3p2s80s(SourceFile:33)
	at androidx.compose.ui.unit.Density$-CC.$default$maxIntrinsicWidth(SourceFile:25)
	at androidx.compose.foundation.layout.PaddingNode.maxIntrinsicWidth(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicWidth(SourceFile:8)
	at androidx.compose.ui.layout.MeasuringIntrinsics$DefaultIntrinsicMeasurable.measure-BRTryo0(SourceFile:101)
	at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(SourceFile:97)
	at androidx.compose.ui.unit.Density$-CC.$default$maxIntrinsicWidth(SourceFile:25)
	at androidx.compose.foundation.layout.FillNode.maxIntrinsicWidth(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.maxIntrinsicWidth(SourceFile:8)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.maxIntrinsicWidth(SourceFile:10)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:75)
	at androidx.compose.foundation.ScrollState$Companion$Saver$1.invoke(SourceFile:39)
	at androidx.compose.foundation.layout.OffsetKt.access$intrinsicSize(SourceFile:155)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:114)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:83)
	at androidx.compose.foundation.layout.RowColumnMeasurePolicy.minIntrinsicHeight(SourceFile:28)
	at androidx.compose.ui.node.InnerNodeCoordinator.minIntrinsicHeight(SourceFile:19)
	at androidx.compose.foundation.layout.IntrinsicHeightNode.calculateContentConstraints-l58MMJ0(SourceFile:10)
	at androidx.compose.foundation.layout.IntrinsicSizeModifier.measure-3p2s80s(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.foundation.layout.PaddingNode.measure-3p2s80s(SourceFile:33)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(SourceFile:97)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.foundation.layout.SizeNode.measure-3p2s80s(SourceFile:117)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(SourceFile:97)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.runtime.Pending$keyMap$2.invoke(SourceFile:153)
	at androidx.compose.runtime.Pending$keyMap$2.invoke(SourceFile:84)
	at kotlin.ULong$Companion.observe(SourceFile:59)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SourceFile:52)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SourceFile:163)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(SourceFile:3)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(SourceFile:109)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(SourceFile:101)
	at androidx.compose.ui.Modifier$-CC.m(SourceFile:2)
	at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(SourceFile:60)
	at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1$measuredItemProvider$1.getAndMeasure(SourceFile:21)
	at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(SourceFile:762)
	at androidx.navigation.compose.DialogHostKt$DialogHost$1$2$2.invoke-0kLqBqw(SourceFile:59)
	at androidx.navigation.compose.DialogHostKt$DialogHost$1$2$2.invoke(SourceFile:352)
	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SourceFile:74)
	at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(SourceFile:38)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke-3p2s80s(SourceFile:43)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:96)
	at androidx.compose.ui.layout.LayoutModifierImpl.measure-3p2s80s(SourceFile:8)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke-3p2s80s(SourceFile:10)
	at androidx.compose.material.ComposableSingletons$ScaffoldKt$lambda-3$1.invoke(SourceFile:99)
	at androidx.compose.ui.layout.LayoutModifierImpl.measure-3p2s80s(SourceFile:8)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(SourceFile:1)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.foundation.layout.PaddingValuesModifier.measure-3p2s80s(SourceFile:118)
	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(SourceFile:11)
	at androidx.compose.runtime.Pending$keyMap$2.invoke(SourceFile:153)
	at androidx.compose.runtime.Pending$keyMap$2.invoke(SourceFile:84)
	at kotlin.ULong$Companion.observe(SourceFile:59)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SourceFile:52)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SourceFile:163)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(SourceFile:3)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(SourceFile:109)
	at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(SourceFile:55)
	at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded(SourceFile:129)
	at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(SourceFile:59)
	at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(SourceFile:32)
	at androidx.compose.ui.node.Owner$-CC.measureAndLayout$default(SourceFile:4)
	at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(SourceFile:14)
	at android.view.View.draw(View.java:23903)
	at android.view.View.updateDisplayListIfDirty(View.java:22767)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4543)
	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4516)
	at android.view.View.updateDisplayListIfDirty(View.java:22723)
	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694)
	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700)
	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798)
	at android.view.ViewRootImpl.draw(ViewRootImpl.java:5144)
	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4835)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4011)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2650)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9526)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1343)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1352)
	at android.view.Choreographer.doCallbacks(Choreographer.java:952)
	at android.view.Choreographer.doFrame(Choreographer.java:882)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1326)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8216)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:49)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)

Outcome

What did you expect?

The app to load.

What happened instead?

The app crashed.

Your phone model

Pixel 6

Operating system version

Android 14 - GrapheneOS - UQ1A.231205.015.2023121200

Application version and app store

version 0.4.0 io.element.android.x versionCode 40004000

Homeserver

matrix.org

Will you send logs?

Yes

Are you willing to provide a PR?

Yes

@idk-r-n idk-r-n added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Dec 26, 2023
@jmartinesp jmartinesp added S-Critical Prevents work, causes data loss and/or has no workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Dec 26, 2023
@jmartinesp
Copy link
Member

Sadly, the logs won't tell us anything about where this crash originates, only that it's caused by some wrong constraints being passed to a text measuring operation, but that could be done either by us or automatically by the Compose UI components.

At least we know it's happening on boot, so it's probably related to the room list screen or the pin/lockscreen, @idk-r-n do you have a pin or biometric unlock set up for the app?

The log mentions a LazyList but also a DialogHost, if that can be a clue.

@idk-r-n
Copy link
Author

idk-r-n commented Dec 26, 2023

@jmartinesp there is no lock of any kind set.

@idk-r-n
Copy link
Author

idk-r-n commented Dec 26, 2023

I can see the dialog to send a crash report, but the app crashes before I can even press "yes".

@idk-r-n
Copy link
Author

idk-r-n commented Dec 26, 2023

I should note that the standard client with an account on a different server does not crash even though the same rooms were joined

@jmartinesp
Copy link
Member

I've tried several things to try to trigger this behaviour, but sadly I could not reproduce it. Could you provide the id/alias of the room that was spammed, if it's public?

@jmartinesp there is no lock of any kind set.

Thanks, we can discard this part of the app then.

I can see the dialog to send a crash report, but the app crashes before I can even press "yes".

Can you see the room list screen (or some placeholder of it) behind? A video could be useful too, if you can record one.

I should note that the standard client with an account on a different server does not crash even though the same rooms were joined

When you say 'the standard client' do you mean Element Android or Element X Android, but the stable version?

@jmartinesp
Copy link
Member

It seems like it could be a Compose issue: https://issuetracker.google.com/issues/305978186

@idk-r-n
Copy link
Author

idk-r-n commented Dec 28, 2023

@jmartinesp
It was a GrapheneOS room.

The app says "offline" because I temporarily revoked network access in order to troubleshoot.
https://github.com/element-hq/element-x-android/assets/111711873/753282f7-d0d3-4fff-b94c-1c8c1684ca78

Yes I meant im.vector.app

@jmartinesp
Copy link
Member

@jmartinesp It was a GrapheneOS room.

Thanks! Do you remember which GrapheneOS room it was, in case it's a public room? Maybe I can find the offending message like this.

In any case, given #2105 (comment) it seems like this is a Compose issue. We might be able to mitigate it by setting a max length for the string we use for the last message info in the room list, since the issue comes from trying to measure a text that's way too large (in either width or height) to fit in Compose Constraints class.

@jmartinesp
Copy link
Member

Also, if you don't want to wait until this is fixed, deleting the app and reinstalling should solve the issue, if I'm not mistaken. This is probably caused by the last message displayed in the room list, and this is cached (which is why it's crashing for you every time you launch the app), but with a fresh start this should no longer be an issue.

@idk-r-n
Copy link
Author

idk-r-n commented Dec 29, 2023

Thanks! Do you remember which GrapheneOS room it was, in case it's a public room? Maybe I can find the offending message like this.

It was a public room, possibly the main one. I can try to find a permalink to messages around the same time.

This is probably caused by the last message displayed in the room list, and this is cached

I've tried clearing the cache multiple times, but it doesn't help. Do you know why this might be the case?

@jmartinesp
Copy link
Member

I've tried clearing the cache multiple times, but it doesn't help. Do you know why this might be the case?

Sorry, I just read your question. I think clearing the cache might be removing only image and file related cache, not the actual message list, which is stored in a DB by the Rust SDK. The only way to clear that is to clear the whole data of the app or reinstall if I'm not mistaken.

I was able to reproduce the issue by creating a fake last message for one of the rooms consisting in thousands of characters without any new lines between them. So we'll work around the issue for now by setting a max length to the text to display until it's fixed in the Jetpack Compose library.

@idk-r-n
Copy link
Author

idk-r-n commented Jan 17, 2024

@jmartinesp thanks for the fix it works great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants