Matthias T
09/28/2024, 10:39 AMStackOverlfowErrors
originating in the compose runtime code that handles Snapshots
.
I suspect that an integer overflow on the snapshot id causes the code to run into a StackOverflow
…
This of course also means my code is causing many Snapshots to be created, but (I think) this makes sense as I have a desktop compose app with an animated Tray
icon, and the application is running for long times.
Has anybody experienced similar? Could it be my compose usage that’s the fault here?Michael Paus
09/28/2024, 12:41 PMMatthias T
09/29/2024, 7:43 PMZach Klippenstein (he/him) [MOD]
09/30/2024, 4:40 PMMatthias T
09/30/2024, 5:08 PMSnapshotIdSet.set
(https://github.com/androidx/androidx/blob/androidx-main/compose/runtime/runtime/sr[…]Main/kotlin/androidx/compose/runtime/snapshots/SnapshotIdSet.kt)
So the stack trace does not show a lot of interesting calls besides the function.Arjan van Wieringen
09/30/2024, 6:26 PMMatthias T
09/30/2024, 6:43 PMInteger.MIN_VALUE
.
I also did the calculation on the time, and came to a similar conclusion as you did @Arjan van Wieringen.
That’s why I added the
Could it be my compose usage that’s the fault here?in the initial message. It’s just a lot of state changes to get to this overflow. (but I guess, even if my code is not performant, the StackOverflow should not happen in the compose runtime) This also brings one to the conclusion that the tray icon is probably not the only thing here 😄 So it’s likely I overdo it in the code, and that very inefficiently. Will try to get a walking skeleton to reproduce. Still waiting for the stack trace to pop up…
Zach Klippenstein (he/him) [MOD]
09/30/2024, 6:46 PMMatthias T
09/30/2024, 6:49 PMZach Klippenstein (he/him) [MOD]
09/30/2024, 6:50 PMMatthias T
09/30/2024, 6:51 PMMatthias T
10/01/2024, 8:19 AM