Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDEA dead lock when resources folder is removed before generation #1160

Closed
alisevych opened this issue Oct 14, 2022 · 1 comment
Closed

IDEA dead lock when resources folder is removed before generation #1160

alisevych opened this issue Oct 14, 2022 · 1 comment
Assignees
Labels
ctg-bug Issue is a bug status-verified Bug fix is verified

Comments

@alisevych
Copy link
Member

alisevych commented Oct 14, 2022

Description

IDEA dead lock when resources folder is removed before generation.
In IDEA log there is the exception in open or create folder method.

To Reproduce

  1. Run the 'UTBotJava' project in IntelliJ Idea
  2. Delete test resources folder in utbot-samples module (in Project view)
  3. Use plugin to generate tests for StringExamples f.e.

Expected behavior

Test resource folder is supposed to be recreated for the SARIF report.

Actual behavior

After test generation is finished and test classes are being painted, IDEA comes into dead lock. Only kill process helps.

Visual proofs (screenshots, logs, images)

There is the following exception in idea.log

2022-10-13 17:16:24,499 [ 465238]   INFO - #c.i.u.i.RootChangesLogger - New rootsChanged event for "utbot" project with partial rescanning with trace_hash = 423762346:
java.lang.Throwable
	at com.intellij.util.indexing.RootChangesLogger.info(RootChangesLogger.java:27)
	at com.intellij.util.indexing.EntityIndexingServiceImpl.logRootChanges(EntityIndexingServiceImpl.java:108)
	at com.intellij.util.indexing.EntityIndexingServiceImpl.indexChanges(EntityIndexingServiceImpl.java:87)
	at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.synchronizeRoots(ProjectRootManagerComponent.java:299)
	at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.fireRootsChangedEvent(ProjectRootManagerComponent.java:212)
	at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.fireRootsChanged(ProjectRootManagerImpl.java:477)
	at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$1.fireRootsChanged(ProjectRootManagerImpl.java:137)
	at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$1.fireRootsChanged(ProjectRootManagerImpl.java:134)
	at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:108)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.watcher.RootsChangeWatcher$1.fireRootsChangeEvent(RootsChangeWatcher.kt:177)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.watcher.RootsChangeWatcher$1.fireRootsChangeEvent$default(RootsChangeWatcher.kt:166)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.watcher.RootsChangeWatcher$1$prepareChange$2.afterVfsChange(RootsChangeWatcher.kt:120)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.afterVfsChange(AsyncEventSupport.java:133)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport$1.after(AsyncEventSupport.java:65)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:649)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:625)
	at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:470)
	at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:259)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:425)
	at jdk.proxy2/jdk.proxy2.$Proxy192.after(Unknown Source)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.fireAfterEvents(PersistentFSImpl.java:1218)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvent(PersistentFSImpl.java:851)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.createChildDirectory(PersistentFSImpl.java:510)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildDirectory(VirtualFileSystemEntry.java:364)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:383)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:373)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:373)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:373)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:373)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:373)
	at com.intellij.openapi.vfs.VfsUtil.createDirectoryIfMissing(VfsUtil.java:357)
	at org.utbot.intellij.plugin.sarif.SarifReportIdea$createAndSave$1.invoke(SarifReportIdea.kt:31)
	at org.utbot.intellij.plugin.sarif.SarifReportIdea$createAndSave$1.invoke(SarifReportIdea.kt:31)
	at org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt$sam$com_intellij_openapi_util_Computable$0.compute(ApplicationUtils.kt)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$13(ApplicationImpl.java:1032)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1011)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1032)
	at org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt.runWriteAction(ApplicationUtils.kt:20)
	at org.utbot.intellij.plugin.sarif.SarifReportIdea.createAndSave(SarifReportIdea.kt:31)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$saveSarifReport$$inlined$executeCommand$default$1.run(actions.kt:14)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at org.utbot.intellij.plugin.generator.CodeGenerationController.saveSarifReport(CodeGenerationController.kt:808)
	at org.utbot.intellij.plugin.generator.CodeGenerationController.access$saveSarifReport(CodeGenerationController.kt:73)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$generateCodeAndReport$1$1$1$2$1.run(CodeGenerationController.kt:616)
	at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$$inlined$invokeLater$1.run(ApplicationUtils.kt:94)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
	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)

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3

Additional context

Originally posted by @alisevych in #1125 (comment)

@alisevych
Copy link
Member Author

Fixed by #1151 - to verify

@alisevych alisevych added the ctg-bug Issue is a bug label Oct 14, 2022
@alisevych alisevych self-assigned this Oct 14, 2022
Repository owner moved this from Todo to Done in UTBot Java Dec 1, 2022
@alisevych alisevych added the status-verified Bug fix is verified label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug status-verified Bug fix is verified
Projects
Archived in project
Development

No branches or pull requests

1 participant