3
21
Fork
You've already forked zigbrains
2

IDE freeze during refactoring #3

Closed
opened 2026年02月17日 23:49:39 +01:00 by vivraan · 11 comments

I have been having trouble with the Zigbrains crashing and paralysing the IDE whenever I instate a refactor that the plugin cannot account for. I dutifully collect the thread dump and keep going. These crashes are reproducible.

What's the best way to report these kinds of crashes? Should I forward the dumps here or a private email address?

I have been having trouble with the Zigbrains crashing and paralysing the IDE whenever I instate a refactor that the plugin cannot account for. I dutifully collect the thread dump and keep going. These crashes are reproducible. What's the best way to report these kinds of crashes? Should I forward the dumps here or a private email address?

you can post the thread dumps here, however, refactoring is handled by ZLS through LSP4IJ, so it's probably not caused by ZigBrains directly, but the lsp4ij plugin

you can post the thread dumps here, however, refactoring is handled by ZLS through LSP4IJ, so it's probably not caused by ZigBrains directly, but the lsp4ij plugin
Author
Copy link
Here we go...

About:

CLion 2025.3.1Build #CL-253.29346.141, built on December 18, 2025; skipped licence infoRuntime version: 21.0.9+1-b1163.86 amd64 (JCEF 137.0.17)VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.Toolkit: sun.awt.windows.WToolkitWindows 11.0.NET Core v9.0.11 x64 (Server GC)GC: G1 Young Generation, G1 Concurrent GC, G1 Old GenerationMemory: 16384MCores: 16Registry: actionSystem.update.actions.warn.dataRules.on.edt=false debugger.new.tool.window.layout=true vcs.log.index.enable=true run.processes.with.pty=TRUE ide.experimental.ui=true llm.show.ai.promotion.window.on.start=falseNon-Bundled Plugins: com.falsepattern.zigbrains (29.0.0-253) com.redhat.devtools.lsp4ij (0.19.2) ; skipped other plugin entries

The attached logs appears after this code – I can't copy the buffer of CLion in its crashed state, but I included the scrollbar to indicate where error squiggles show (I know error squiggles are inconsistent):

image

###### Here we go... About: ```ahk CLion 2025年3月1日 Build #CL-253.29346.141, built on December 18, 2025 ; skipped licence info Runtime version: 21.0.9+1-b1163.86 amd64 (JCEF 137.0.17) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.awt.windows.WToolkit Windows 11.0 .NET Core v9.0.11 x64 (Server GC) GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 16384M Cores: 16 Registry: actionSystem.update.actions.warn.dataRules.on.edt=false debugger.new.tool.window.layout=true vcs.log.index.enable=true run.processes.with.pty=TRUE ide.experimental.ui=true llm.show.ai.promotion.window.on.start=false Non-Bundled Plugins: com.falsepattern.zigbrains (29.0.0-253) com.redhat.devtools.lsp4ij (0.19.2) ; skipped other plugin entries ``` The attached logs appears after this code – I can't copy the buffer of CLion in its crashed state, but I included the scrollbar to indicate where error squiggles show (I know error squiggles are inconsistent): ![image](/attachments/3de1cdcd-c904-4718-b5ad-e1dbbc518681)
Author
Copy link

Happy to triage this for different crashes.

Happy to triage this for different crashes.

from what i can see in the thread dumps, zigbrains is getting stuck while initializing the LSP after an lsp4ij call to the builder.
and this is caused by a zig env call never returning properly
i'll look into this more later today, but zigbrains is likely using the wrong thread pool somewhere and starving the IDE which causes a deadlock.

from what i can see in the thread dumps, zigbrains is getting stuck while initializing the LSP after an lsp4ij call to the builder. and this is caused by a `zig env` call never returning properly i'll look into this more later today, but zigbrains is likely using the wrong thread pool somewhere and starving the IDE which causes a deadlock.
FalsePattern changed title from (削除) Question: How best to report sudden crashes (削除ここまで) to IDE freeze during refactoring 2026年02月25日 20:59:31 +01:00

Should be fixed in 29.0.1.

I rewired some of the threading code so the affected part of the logic is now running on an IO thread pool (64 max thread count instead of # of cpu threads), and i also added a 1 second timeout to the spot where the deadlock can happen, so in the worst case, the LSP will just throw a timeout error instead of taking down the whole IDE.

Should be fixed in 29.0.1. I rewired some of the threading code so the affected part of the logic is now running on an IO thread pool (64 max thread count instead of # of cpu threads), and i also added a 1 second timeout to the spot where the deadlock can happen, so in the worst case, the LSP will just throw a timeout error instead of taking down the whole IDE.

I'll leave the issue open for now, if it no longer happens for the next few days, you can close it

I'll leave the issue open for now, if it no longer happens for the next few days, you can close it
Author
Copy link

Sounds like a plan. I'll test these and revert.

Sounds like a plan. I'll test these and revert.
Author
Copy link

IDE error from 29.0.1, maybe this is the error you are looking for? It appears on launch.
Had to restart twice as a previous error stopped Zigbrains.

com.intellij.diagnostic.PluginException:Thisthreadholdsareadlockwhiletryingtoinvokeamodalprogress.Modalprogressesareallowedonlyunderwrite-intentlockbecausetheyneedtopreventbackgroundwriteactions.Considermovingthismodalprogressoutof`readAction`[Plugin:com.falsepattern.zigbrains]
	at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル.invokeSuspend(EditorNotificationsImpl.kt:285)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
Caused by:java.lang.IllegalStateException:Thisthreadholdsareadlockwhiletryingtoinvokeamodalprogress.Modalprogressesareallowedonlyunderwrite-intentlockbecausetheyneedtopreventbackgroundwriteactions.Considermovingthismodalprogressoutof`readAction`
	at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:363)
	at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:205)
	at com.falsepattern.zigbrains.lsp.notification.ZigEditorNotificationProvider.collectNotificationData$lambda0ドル(ZigEditorNotificationProvider.kt:90)
	at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル2ドル.invokeSuspend$lambda0ドル(EditorNotificationsImpl.kt:266)
	at com.intellij.openapi.application.ActionsKt.runReadAction$lambda0ドル(actions.kt:25)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runReadAction(NestedLocksThreadingSupport.kt:856)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:1064)
	at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:25)
	at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル2ドル.invokeSuspend(EditorNotificationsImpl.kt:265)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at com.intellij.openapi.application.TransactionGuardImpl2ドル.run(TransactionGuardImpl.java:224)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda4ドル(NonBlockingFlushQueue.kt:358)
	at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:294)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent(NonBlockingFlushQueue.kt:357)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.flushNow(NonBlockingFlushQueue.kt:305)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.FLUSH_NOW$lambda0ドル(NonBlockingFlushQueue.kt:167)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue4ドル.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue4ドル.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:664)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:517)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda0ドル0ドル0ドル(IdeEventQueue.kt:333)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda1ドル(IdeEventQueue.kt:1065)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1065)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda0ドル(IdeEventQueue.kt:331)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:371)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
IDE error from 29.0.1, maybe this is the error you are looking for? It appears on launch. Had to restart twice as a previous error stopped Zigbrains. ```termcap com.intellij.diagnostic.PluginException: This thread holds a read lock while trying to invoke a modal progress.Modal progresses are allowed only under write-intent lock because they need to prevent background write actions.Consider moving this modal progress out of `readAction` [Plugin: com.falsepattern.zigbrains] at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル.invokeSuspend(EditorNotificationsImpl.kt:285) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762) Caused by: java.lang.IllegalStateException: This thread holds a read lock while trying to invoke a modal progress.Modal progresses are allowed only under write-intent lock because they need to prevent background write actions.Consider moving this modal progress out of `readAction` at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:363) at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:205) at com.falsepattern.zigbrains.lsp.notification.ZigEditorNotificationProvider.collectNotificationData$lambda0ドル(ZigEditorNotificationProvider.kt:90) at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル2ドル.invokeSuspend$lambda0ドル(EditorNotificationsImpl.kt:266) at com.intellij.openapi.application.ActionsKt.runReadAction$lambda0ドル(actions.kt:25) at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runReadAction(NestedLocksThreadingSupport.kt:856) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:1064) at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:25) at com.intellij.ui.EditorNotificationsImpl$updateEditors$job1ドル2ドル.invokeSuspend(EditorNotificationsImpl.kt:265) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) at com.intellij.openapi.application.TransactionGuardImpl2ドル.run(TransactionGuardImpl.java:224) at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda4ドル(NonBlockingFlushQueue.kt:358) at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:294) at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent(NonBlockingFlushQueue.kt:357) at com.intellij.openapi.application.impl.NonBlockingFlushQueue.flushNow(NonBlockingFlushQueue.kt:305) at com.intellij.openapi.application.impl.NonBlockingFlushQueue.FLUSH_NOW$lambda0ドル(NonBlockingFlushQueue.kt:167) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781) at java.desktop/java.awt.EventQueue4ドル.run(EventQueue.java:728) at java.desktop/java.awt.EventQueue4ドル.run(EventQueue.java:722) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:664) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:517) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda0ドル0ドル0ドル(IdeEventQueue.kt:333) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda1ドル(IdeEventQueue.kt:1065) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1065) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda0ドル(IdeEventQueue.kt:331) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:371) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) ```
FalsePattern stopped working 2026年04月02日 21:24:29 +02:00
14 minutes 20 seconds

That plugin exception should be fixed in 30.0.0

That plugin exception should be fixed in 30.0.0
Author
Copy link

Will test and report here!

Will test and report here!
Author
Copy link

Looks okay, no further logs or errors so far. Will close this issue with this comment.

Looks okay, no further logs or errors so far. Will close this issue with this comment.
Sign in to join this conversation.
No Branch/Tag specified
master
rewrite-3
0.17-compat
251
252
253
dev
241
242
243
feat/use-var-intent
feat/parser-reimpl
experimental
30.0.1
30.0.0
29.1.0
29.0.1
29.0.0
28.3.0
28.2.2
28.2.1
28.2.0
28.1.0
28.0.0
27.3.1
27.3.0
27.2.1
27.2.0
27.1.1
27.1.0
27.0.0
26.3.2
26.3.1
26.3.0
26.2.1
26.2.0
26.1.0
26.0.2
26.0.1
26.0.0
25.5.1
25.5.0
25.4.2
25.4.1
25.4.0
25.3.0
25.2.0
25.1.0
25.0.2
25.0.1
24.0.1
24.0.0
23.1.2
23.1.1
23.1.0
23.0.2
23.0.1
23.0.0
22.0.1
22.0.0
21.1.0
21.0.0
20.3.0
20.2.2
20.2.1
20.2.0
20.1.3
20.1.2
20.1.1
20.1.0
20.0.4
20.0.3
20.0.2
20.0.1
20.0.0
19.3.0-232
19.3.0-233
19.3.0-241
19.3.0-242
19.3.0
19.2.0
19.1.0
19.0.0
18.1.0
18.0.0
17.3.1-dev001
17.3.0
17.2.0
17.1.0
17.0.0
16.1.3
16.1.2
16.1.1
16.1.0
16.0.0
16.0.0-pre2
16.0.0-pre1
15.2.0-241
15.2.0-233
15.2.0-232
15.2.0
15.1.1-241
15.1.1-233
15.1.1-232
15.1.1
15.1.0-241
15.1.0-233
15.1.0-232
15.1.0
15.0.3-241
15.0.3-233
15.0.3-232
15.0.3
15.0.2-241
15.0.2-233
15.0.2-232
15.0.2
15.0.1-241
15.0.1-233
15.0.1-232
15.0.1
15.0.0-241
15.0.0-233
15.0.0-232
15.0.0
14.5.0-241
14.5.0-233
14.5.0-232
14.5.0-231
14.5.0
14.4.0-241
14.4.0-233
14.4.0-232
14.4.0-231
14.4.0
14.3.0-233
14.3.0-232
14.3.0-231
14.3.0
14.2.0-233
14.2.0-232
14.2.0-231
14.2.0
14.1.0-233
14.1.0-232
14.1.0-231
14.1.0
14.0.1-233
14.0.1-232
14.0.1-231
14.0.1
14.0.0-233
14.0.0-232
14.0.0-231
14.0.0
13.2.0-233
13.2.0-232
13.2.0-231
13.2.0
13.1.1-233
13.1.1-232
13.1.1-231
13.1.1
13.1.0-233
13.1.0-232
13.1.0-231
13.1.0
13.0.1-233
13.0.1-232
13.0.1-231
13.0.1
13.0.0-233
13.0.0-232
13.0.0-231
13.0.0
12.1.0-pre01
12.0.0
11.1.0
11.0.0
0.9.0
0.8.1
0.8.0
0.7.0
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.1
0.3.0
0.2.0
0.10.0
0.1.0
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Fixed
The bug has been fixed.
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Total time spent: 3 hours 14 minutes
FalsePattern
3 hours 14 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FalsePattern/zigbrains#3
Reference in a new issue
FalsePattern/zigbrains
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?