Skip to content

IntelliJ Crashing - potentially due to variance in output formatting #2283

@singerbj

Description

@singerbj

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: 0.0.64
- IDE: IntelliJ 2023.2.4
- Model: meta-llama-Meta-Llama-3.1-70B-Instruct-awq
- config.json:
  
{
  "models": [
    {
      "title": "Chat",
      "model": "meta-llama-Meta-Llama-3.1-70B-Instruct-awq",
      "provider": "openai",
      "apiKey": "<API_KEY>",
      "apiBase": "<API_BASE>",
      "contextLength": 16000,
      "maxTokens": 4096,
      "systemMessage": "Don't hallucinate."
    }
  ],
  "tabAutocompleteModel": {
    "title": "Tab Autocomplete Model",
    "provider": "openai",
    "model": "deepseek-ai-deepseek-coder-6.7b-base-awq",
    "apiKey": "<API_KEY>",
    "apiBase": "<API_BASE>",
    "completionOptions": {
      "presencePenalty": 1.1,
      "frequencyPenalty": 1.1
    }
  },
  "allowAnonymousTelemetry": false
}

Description

At a certain point, the output of the model in use with Continue starts looking like this in IntelliJ:

image

This could just be hallucination from our model...but ultimately through debugging, it seems that the variance in fonts shown above causes the editor to crash.

Heapdump: https://file.io/TWQ3wnTrnehZ

A place to look is between:

AWT-EventQueue-0
and
DefaultDispatcher-worker-14

It seems he plugin is flooding the eventqueue with events. There are 1700 in there waiting to be processed, but I think something is spinning them out and keeping the queue flooded, that's why my IDE seizes up.

Here are some relevant stacktraces:

It looks like it is hanging while trying to dispose a window:

DefaultDispatcher-worker-14
  at java.lang.Object.wait(J)V (Object.java(Native Method))
  at java.lang.Object.wait()V (Object.java:338)
  at java.awt.EventQueue.invokeAndWait(Ljava/lang/Object;Ljava/lang/Runnable;)V (EventQueue.java:1387)
  at java.awt.Window.doDispose()V (Window.java:1254)
  at java.awt.Window.dispose()V (Window.java:1191)
  at com.intellij.ui.jcef.HwFacadeHelper.removeNotify()V (HwFacadeHelper.java:230)
  at com.intellij.ui.jcef.HwFacadeJPanel.removeNotify()V (HwFacadeJPanel.java:25)
  at com.intellij.ui.BalloonImpl$MyComponent.removeNotify()V (BalloonImpl.java:1988)
  at java.awt.Container.remove(I)V (Container.java:1235)
  at javax.swing.JLayeredPane.remove(I)V (JLayeredPane.java:248)
  at java.awt.Container.lambda$remove$1(Ljava/awt/Component;)V (Container.java:1293)
  at java.awt.Container$$Lambda$888+0x00000008009c42b8.run()V ()
  at sun.awt.SunToolkit.lambda$performWithTreeLock$1(Ljava/lang/Runnable;)V (SunToolkit.java:2139)
  at sun.awt.SunToolkit$$Lambda$400+0x0000000800377a80.run()V ()
  at sun.awt.SunToolkit.performOnMainThreadIfNeeded(Ljava/lang/Runnable;)V (SunToolkit.java:2164)
  at sun.awt.SunToolkit.performWithTreeLock(Ljava/lang/Runnable;)V (SunToolkit.java:2137)
  at java.awt.Container.remove(Ljava/awt/Component;)V (Container.java:1289)
  at com.intellij.ui.BalloonImpl.show(Lcom/intellij/util/ui/PositionTracker;Lcom/intellij/ui/BalloonImpl$AbstractPosition;)V (BalloonImpl.java:566)
  at com.intellij.ui.BalloonImpl.show(Lcom/intellij/ui/awt/RelativePoint;Lcom/intellij/ui/BalloonImpl$AbstractPosition;)V (BalloonImpl.java:450)
  at com.intellij.ui.BalloonImpl.show(Lcom/intellij/ui/awt/RelativePoint;Lcom/intellij/openapi/ui/popup/Balloon$Position;)V (BalloonImpl.java:421)
  at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient.showMessage(Ljava/lang/String;)V (IdeProtocolClient.kt:971)
  at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient$handleMessage$1.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; (IdeProtocolClient.kt:586)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Ljava/lang/Object;)V (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run()V (DispatchedTask.kt:106)
  at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run()V (LimitedDispatcher.kt:115)
  at kotlinx.coroutines.scheduling.TaskImpl.run()V (Tasks.kt:100)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(Lkotlinx/coroutines/scheduling/Task;)V (CoroutineScheduler.kt:584)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(Lkotlinx/coroutines/scheduling/Task;)V (CoroutineScheduler.kt:793)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker()V (CoroutineScheduler.kt:697)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run()V (CoroutineScheduler.kt:684)

This one makes it look like there is a live lock happening with the chat plugin. It appears the overuse of changing fonts is the cause of this.

AWT-EventQueue-0
  at java.awt.Component.setFont(Ljava/awt/Font;)V (Component.java:1966)
  at java.awt.Container.setFont(Ljava/awt/Font;)V (Container.java:1780)
  at javax.swing.JComponent.setFont(Ljava/awt/Font;)V (JComponent.java:2810)
  at javax.swing.LookAndFeel.installColorsAndFont(Ljavax/swing/JComponent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V (LookAndFeel.java:213)
  at javax.swing.plaf.basic.BasicPanelUI.installDefaults(Ljavax/swing/JPanel;)V (BasicPanelUI.java:82)
  at javax.swing.plaf.basic.BasicPanelUI.installUI(Ljavax/swing/JComponent;)V (BasicPanelUI.java:67)
  at javax.swing.JComponent.setUI(Ljavax/swing/plaf/ComponentUI;)V (JComponent.java:733)
  at javax.swing.JPanel.setUI(Ljavax/swing/plaf/PanelUI;)V (JPanel.java:153)
  at javax.swing.JPanel.updateUI()V (JPanel.java:129)
  at javax.swing.JPanel.<init>(Ljava/awt/LayoutManager;Z)V (JPanel.java:89)
  at javax.swing.JPanel.<init>(Z)V (JPanel.java:112)
  at javax.swing.JPanel.<init>()V (JPanel.java:120)
  at com.intellij.ui.jcef.HwFacadeHelper$4.<init>(Lcom/intellij/ui/jcef/HwFacadeHelper;)V (HwFacadeHelper.java:188)
  at com.intellij.ui.jcef.HwFacadeHelper.activateIfNeeded(Ljava/util/List;)V (HwFacadeHelper.java:188)
  at com.intellij.ui.jcef.HwFacadeHelper$2.componentResized(Ljava/awt/event/ComponentEvent;)V (HwFacadeHelper.java:142)
  at java.awt.Component.processComponentEvent(Ljava/awt/event/ComponentEvent;)V (Component.java:6483)
  at java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V (Component.java:6437)
  at java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V (Container.java:2266)
  at java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V (Component.java:5027)
  at java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V (Container.java:2324)
  at java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V (Component.java:4855)
  at java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V (EventQueue.java:794)
  at java.awt.EventQueue$3.run()Ljava/lang/Void; (EventQueue.java:739)
  at java.awt.EventQueue$3.run()Ljava/lang/Object; (EventQueue.java:733)
  at java.security.AccessController.executePrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/lang/Class;)Ljava/lang/Object; (AccessController.java:776)
  at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (AccessController.java:399)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object; (ProtectionDomain.java:86)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (ProtectionDomain.java:97)
  at java.awt.EventQueue$4.run()Ljava/lang/Void; (EventQueue.java:766)
  at java.awt.EventQueue$4.run()Ljava/lang/Object; (EventQueue.java:764)
  at java.security.AccessController.executePrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/lang/Class;)Ljava/lang/Object; (AccessController.java:776)
  at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (AccessController.java:399)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object; (ProtectionDomain.java:86)
  at java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V (EventQueue.java:763)
  at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(Ljava/awt/AWTEvent;)V (IdeEventQueue.kt:690)
  at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(Lcom/intellij/ide/IdeEventQueue;Ljava/awt/AWTEvent;)V (IdeEventQueue.kt:593)
  at com.intellij.ide.IdeEventQueue$$Lambda$512+0x00000008005d0690.run()V ()
  at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(Ljava/lang/Runnable;)V (ApplicationImpl.java:1485)
  at com.intellij.ide.IdeEventQueue._dispatchEvent(Ljava/awt/AWTEvent;)V (IdeEventQueue.kt:593)
  at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(Lcom/intellij/ide/IdeEventQueue;Ljava/awt/AWTEvent;)V (IdeEventQueue.kt:67)
  at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute()Ljava/lang/Void; (IdeEventQueue.kt:369)
  at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute()Ljava/lang/Object; (IdeEventQueue.kt:368)
  at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(Lcom/intellij/openapi/util/ThrowableComputable;)Ljava/lang/Object; (CoreProgressManager.java:787)
  at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke()V (IdeEventQueue.kt:368)
  at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke()Ljava/lang/Object; (IdeEventQueue.kt:363)
  at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(Lkotlin/jvm/functions/Function0;)V (IdeEventQueue.kt:997)
  at com.intellij.ide.IdeEventQueueKt$$Lambda$505+0x00000008005c87d0.run()V ()
  at com.intellij.openapi.application.TransactionGuardImpl.performActivity(ZLjava/lang/Runnable;)V (TransactionGuardImpl.java:105)
  at com.intellij.ide.IdeEventQueueKt.performActivity(Ljava/awt/AWTEvent;Lkotlin/jvm/functions/Function0;)V (IdeEventQueue.kt:997)
  at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(Lcom/intellij/ide/IdeEventQueue;Ljava/awt/AWTEvent;ZLjava/awt/AWTEvent;Lcom/intellij/diagnostic/EventWatcher;Ljava/lang/Runnable;Ljava/lang/Class;J)V (IdeEventQueue.kt:363)
  at com.intellij.ide.IdeEventQueue$$Lambda$501+0x00000008005c4268.run()V ()
  at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(Ljava/lang/Runnable;)V (ApplicationImpl.java:861)
  at com.intellij.ide.IdeEventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V (IdeEventQueue.kt:405)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(I)V (EventDispatchThread.java:207)
  at java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V (EventDispatchThread.java:128)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V (EventDispatchThread.java:117)
  at java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V (EventDispatchThread.java:113)
  at java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V (EventDispatchThread.java:105)
  at java.awt.EventDispatchThread.run()V (EventDispatchThread.java:92)

To reproduce

We think....

  1. Use a model that starts to hallucinate, causing rapid variance in text formatting (like pictured above)
  2. Have enough variance that the plugin crashes :(

Log output

core.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chatRelates to chat interfaceide:jetbrainsRelates specifically to JetBrains extensionkind:bugIndicates an unexpected problem or unintended behaviorstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions