Status Update
Comments
ca...@digitalchargingsolutions.com <ca...@digitalchargingsolutions.com> #2
The TODO()
don't make a difference, sorry. I edited the method to have proper values in the stable AS, and tried to edit it again in AS canary and it freezes again.
Edit: AS Freezes in any file when I type R.drawable.
and the popup opens, can you please change the title?
km...@google.com <km...@google.com>
jb...@google.com <jb...@google.com>
an...@google.com <an...@google.com> #3
Thanks for providing logs. They indicate the freeze reports have been taken at the following path:
/Users/<username>/Library/Logs/Google/AndroidStudioPreview2023.1/threadDumps-freeze-20230811-105601-AI-231.9225.16.2311.10572941/
Could you provide those thread dumps, and/or any around the same time?
ca...@digitalchargingsolutions.com <ca...@digitalchargingsolutions.com> #4
Hi, sure, I've uploaded all thread dumps as a zip to the Drive folder, including the one you specified.
an...@google.com <an...@google.com> #5
Thanks for the thread dumps. I'm pasting the relevant threads below, but this helps identify that it's a regression due to commits d8564fd (ag/24154614) and c0629de (ag/24195203).
I'm going to disable that fix for Hedgehog, which should fix the freezing issue.
Event thread responding to a keystroke, waiting for write lock:
"AWT-EventQueue-0" prio=0 tid=0x0 nid=0x0 waiting on condition
java.lang.Thread.State: TIMED_WAITING
on com.intellij.openapi.application.impl.ReadMostlyRWLock@755c8fa3
at java.base@17.0.7/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@17.0.7/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.writeLock(ReadMostlyRWLock.java:292)
at com.intellij.openapi.application.impl.ApplicationImpl.startWrite(ApplicationImpl.java:1162)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:954)
at com.intellij.openapi.editor.impl.DefaultRawTypedHandler.execute(DefaultRawTypedHandler.java:49)
at com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler.execute(EditorFactoryImpl.java:317)
at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$2(TypedAction.java:200)
at com.intellij.openapi.editor.actionSystem.TypedAction$$Lambda$7468/0x00000008037b37d0.run(Unknown Source)
at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:28)
at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$3(TypedAction.java:199)
at com.intellij.openapi.editor.actionSystem.TypedAction$$Lambda$7467/0x00000008037b3110.run(Unknown Source)
at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:194)
at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:199)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1314)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1296)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3458)
at com.intellij.openapi.editor.impl.EditorImpl$7.keyTyped(EditorImpl.java:1130)
at java.desktop@17.0.7/java.awt.AWTEventMulticaster.keyTyped(Unknown Source)
...
Completion running inside a read lock, waiting on drawable renderer:
"ApplicationImpl pooled thread 982" prio=0 tid=0x0 nid=0x0 waiting on condition
java.lang.Thread.State: WAITING
on java.util.concurrent.CompletableFuture$Signaller@22e11857
at java.base@17.0.7/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@17.0.7/java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.base@17.0.7/java.util.concurrent.CompletableFuture$Signaller.block(Unknown Source)
at java.base@17.0.7/java.util.concurrent.ForkJoinPool.unmanagedBlock(Unknown Source)
at java.base@17.0.7/java.util.concurrent.ForkJoinPool.managedBlock(Unknown Source)
at java.base@17.0.7/java.util.concurrent.CompletableFuture.waitingGet(Unknown Source)
at java.base@17.0.7/java.util.concurrent.CompletableFuture.get(Unknown Source)
at com.android.tools.idea.rendering.GutterIconFactory.createXmlIcon(GutterIconFactory.java:140)
at com.android.tools.idea.rendering.GutterIconFactory.createIcon(GutterIconFactory.java:77)
at com.android.tools.idea.rendering.GutterIconCache.getIcon(GutterIconCache.java:82)
at com.android.tools.idea.res.completion.DrawableResourceLookupElement.renderElement(ResourceCompletionContributor.kt:84)
at com.intellij.codeInsight.lookup.LookupElementPresentation.renderElement(LookupElementPresentation.java:220)
at com.intellij.codeInsight.lookup.impl.LookupImpl.addItem(LookupImpl.java:266)
...
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1100)
at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:167)
at com.intellij.codeInsight.completion.AsyncCompletion.lambda$flushBatchResult$4(CompletionThreading.java:156)
...
Drawable renderer, waiting for a read lock (which it can't get, since the event thread is waiting for a write lock):
"ApplicationImpl pooled thread 969" prio=0 tid=0x0 nid=0x0 waiting on condition
java.lang.Thread.State: TIMED_WAITING
on com.intellij.openapi.application.impl.ReadMostlyRWLock@755c8fa3
at java.base@17.0.7/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@17.0.7/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.waitABit(ReadMostlyRWLock.java:166)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.startRead(ReadMostlyRWLock.java:130)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:874)
at com.android.tools.idea.configurations.ConfigurationForFile.calculateActivity(ConfigurationForFile.kt:49)
at com.android.tools.configurations.Configuration.getActivity(Configuration.java:316)
at com.android.tools.configurations.Configuration.computePreferredTheme(Configuration.java:1266)
at com.android.tools.configurations.Configuration.getTheme(Configuration.java:455)
at com.android.tools.configurations.Configuration.getResourceResolver(Configuration.java:1167)
at com.android.tools.rendering.RenderTask.renderDrawable(RenderTask.java:1187)
at com.android.tools.idea.rendering.DrawableRenderer.lambda$renderDrawable$1(DrawableRenderer.java:135)
at com.android.tools.idea.rendering.DrawableRenderer$$Lambda$14320/0x000000080649a8e8.apply(Unknown Source)
...
ca...@digitalchargingsolutions.com <ca...@digitalchargingsolutions.com> #6
FYI I tried this out with AS Nightly and it is not freezing. Your change was not applied there, right?
Android Studio Iguana | 2023.2.1 Nightly 2023-08-16
Build #AI-232.8660.185.2321.10671465, built on August 17, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
an...@google.com <an...@google.com> #7
Since I wrote
I'm leaving this bug open for the moment as we discuss next steps, but will likely resolve this bug as a duplicate of that one.
Description
When editing a specific file, AS Canary freezes.
In detail: The file contains two extension methods. One of them has a
when
clause with many cases, each being pre-filled withTODO()
.Steps to Reproduce:
TODO
tor.drawable.ic_example
in my case)It always shows the item completion popup, that stays empty, and the same moment it freezes.
I tried to create a repro project but it doesn't freeze there.
Logs & File:https://drive.google.com/drive/folders/1wwVAZwb6SeqsY-BSawp-mM5-9SdxUOgi?usp=sharing
AS/System:
With "Android Studio Giraffe | 2022.3.1" everything's working fine.