Assigned
Status Update
Comments
lp...@google.com <lp...@google.com>
al...@jetbrains.com <al...@jetbrains.com> #2
The problem also exists with SnapshotStateList
.
The root cause is that Snapshot.advanceGlobalSnapshot
takes Snapshot.lock
and then (via overwriteUnusedRecordsLocked
and then StateListStateRecord.assign
) tries to take SnapshotStateList.sync
.
But SnapshotStateList.add
first takes SnapshotStateList.sync
and then (via conditionalUpdate
and then Snapshot.writeable
) tries to take Snapshot.lock
.
al...@google.com <al...@google.com> #3
Triage notes: Needs investigation.
Description
Jetpack Compose version:
Jetpack Compose component(s) used: 1.4.1
Android Studio Build: 2022.1.1
Kotlin version: 1.8.0
Hi, it seems that SnapshotStateMap contains code succeptible to a deadlock. When running the example code the UI freezes and a thread dump indicates that both the
Main
and theDefaultDispatcher
are blocked.Steps to Reproduce or Code Sample to Reproduce: