intellij-platform-gradle-plugin icon indicating copy to clipboard operation
intellij-platform-gradle-plugin copied to clipboard

buildSearchableOptions crashes due to PHP plugin

Open chylex opened this issue 2 years ago • 5 comments

What happened?

Hi! I have a dependency on PHP 232.9921.55 (and many other IntelliJ Ultimate plugins): https://github.com/chylex/IntelliJ-Rainbow-Brackets/tree/build-searchable-options/build.gradle.kts

When I try to build the plugin, it fails due to buildSearchableOptions. The log below blames PHP.

Relevant log output or stack trace

Searchable options index builder completed
2023-10-04 07:03:08,782 [  15728] SEVERE - #c.i.o.u.ObjectTree - Memory leak detected: 'newDisposable' (class com.intellij.openapi.util.Disposer$1) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

java.lang.RuntimeException: Memory leak detected: 'newDisposable' (class com.intellij.openapi.util.Disposer$1) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

	at com.intellij.openapi.util.ObjectNode.assertNoChildren(ObjectNode.java:45)
	at com.intellij.openapi.util.ObjectTree.assertIsEmpty(ObjectTree.java:218)
	at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:278)
	at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:272)
	at com.intellij.openapi.application.impl.ApplicationImpl.disposeContainer(ApplicationImpl.java:223)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$doExit$5(ApplicationImpl.java:660)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.computeWithSpanIgnoreThrows(trace.kt:73)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.computeWithSpanThrows(TraceUtil.java:18)
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:646)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$exit$3(ApplicationImpl.java:598)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	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:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
	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)
Caused by: java.lang.Throwable
	at com.intellij.openapi.util.ObjectNode.<init>(ObjectNode.java:24)
	at com.intellij.openapi.util.ObjectNode.findOrCreateChildNode(ObjectNode.java:140)
	at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:51)
Caused by: java.lang.Throwable

	at com.intellij.openapi.util.Disposer.register(Disposer.java:161)
	at com.intellij.ui.EditorTextFieldCellRenderer.<init>(EditorTextFieldCellRenderer.java:72)
	at com.intellij.ui.EditorTextFieldCellRenderer.<init>(EditorTextFieldCellRenderer.java:64)
	at com.intellij.database.settings.DatabaseSettingsOther$createForeignKeysTable$renderer$1.<init>(DatabaseSettingsOther.kt:172)
	at com.intellij.database.settings.DatabaseSettingsOther.createForeignKeysTable(DatabaseSettingsOther.kt:172)
	at com.intellij.database.settings.DatabaseSettingsOther.createPanel(DatabaseSettingsOther.kt:48)
	at com.intellij.openapi.options.DslConfigurableBase$panel$1.compute(BoundConfigurable.kt:35)
	at com.intellij.openapi.options.DslConfigurableBase$panel$1.compute(BoundConfigurable.kt:30)
	at com.intellij.openapi.util.ClearableLazyValue.getValue(ClearableLazyValue.java:43)
	at com.intellij.openapi.options.DslConfigurableBase.createComponent(BoundConfigurable.kt:43)
	at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:181)
	at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:72)
	at com.intellij.ide.ui.search.TraverseUIStarter.lambda$startup$0(TraverseUIStarter.java:117)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	... 28 more
2023-10-04 07:03:08,783 [  15729] SEVERE - #c.i.o.u.ObjectTree - IntelliJ IDEA 2023.2.2  Build #IU-232.9921.47
2023-10-04 07:03:08,784 [  15730] SEVERE - #c.i.o.u.ObjectTree - JDK: 17.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2023-10-04 07:03:08,784 [  15730] SEVERE - #c.i.o.u.ObjectTree - OS: Windows 10
2023-10-04 07:03:08,784 [  15730] SEVERE - #c.i.o.u.ObjectTree - Memory leak detected: 'com.intellij.ui.GotItTooltip@7cbe7e7d' (class com.intellij.ui.GotItTooltip) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

java.lang.RuntimeException: Memory leak detected: 'com.intellij.ui.GotItTooltip@7cbe7e7d' (class com.intellij.ui.GotItTooltip) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

	at com.intellij.openapi.util.ObjectNode.assertNoChildren(ObjectNode.java:45)
	at com.intellij.openapi.util.ObjectTree.assertIsEmpty(ObjectTree.java:218)
	at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:278)
	at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:272)
	at com.intellij.openapi.application.impl.ApplicationImpl.disposeContainer(ApplicationImpl.java:223)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$doExit$5(ApplicationImpl.java:660)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.computeWithSpanIgnoreThrows(trace.kt:73)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.computeWithSpanThrows(TraceUtil.java:18)
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:646)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$exit$3(ApplicationImpl.java:598)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	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:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
	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)
Caused by: java.lang.Throwable
	at com.intellij.openapi.util.ObjectNode.<init>(ObjectNode.java:24)
	at com.intellij.openapi.util.ObjectNode.findOrCreateChildNode(ObjectNode.java:140)
	at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:51)
	at com.intellij.openapi.util.Disposer.register(Disposer.java:161)
	at com.intellij.ui.GotItTooltip.show(GotItTooltip.kt:319)
	at com.jetbrains.php.debug.PhpDebugConfigInstruction.addAction(PhpDebugConfigInstruction.java:36)
	at com.jetbrains.php.debug.PhpDebugConfigInstructionsPanel.<init>(PhpDebugConfigInstructionsPanel.java:41)
	at com.jetbrains.php.debug.PhpDebugConfigInstructionsPanel.createExternalPreConfig(PhpDebugConfigInstructionsPanel.java:78)
	at com.jetbrains.php.debug.PhpDebugConfigInstructionsPanel.createZeroConfigurationInstructions(PhpDebugConfigInstructionsPanel.java:70)
	at com.jetbrains.php.debug.PhpDebugConfigurableForm.<init>(PhpDebugConfigurableForm.java:69)
	at com.jetbrains.php.debug.PhpDebugConfigurable.createComponent(PhpDebugConfigurable.java:43)
	at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:181)
	at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:72)
	at com.intellij.ide.ui.search.TraverseUIStarter.lambda$startup$0(TraverseUIStarter.java:117)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	... 28 more
2023-10-04 07:03:08,786 [  15732] SEVERE - #c.i.o.u.ObjectTree - IntelliJ IDEA 2023.2.2  Build #IU-232.9921.47
2023-10-04 07:03:08,786 [  15732] SEVERE - #c.i.o.u.ObjectTree - JDK: 17.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2023-10-04 07:03:08,786 [  15732] SEVERE - #c.i.o.u.ObjectTree - OS: Windows 10
2023-10-04 07:03:08,787 [  15733] SEVERE - #c.i.o.u.ObjectTree - Plugin to blame: PHP version: 232.9921.55

Steps to reproduce

  1. Clone this branch https://github.com/chylex/IntelliJ-Rainbow-Brackets/tree/build-searchable-options
  2. Run downloadExtraIdes task (downloads CLion and Rider dependencies since those don't come as IntelliJ Ultimate plugins)
  3. Run buildSearchableOptions task

Gradle IntelliJ Plugin version

1.15.0

Gradle version

8.3

Operating System

Windows

Link to build, i.e. failing GitHub Action job

No response

chylex avatar Oct 04 '23 05:10 chylex

Interestingly, if I run the buildSearchableOptions task again after it fails, it's flagged as up-to-date and the build succeeds. However, that's not workable on CI where the build folder is cleaned every time.

chylex avatar Oct 04 '23 05:10 chylex

Thanks for reporting, @chylex! I reproduced the issue, however, it depends not on the Gradle IntelliJ Plugin but most likely PHP plugin. I passed this issue to the relevant team.

hsz avatar Oct 05 '23 19:10 hsz

Is it necessary for the buildSearchableOptions task to scan other plugins' configuration, or at least could it handle errors in other plugins so that it doesn't prevent my plugin from building?

chylex avatar Oct 07 '23 08:10 chylex

The buildSearchableOptions task runs an Ant task which is built-in the IDE — this is why it runs an IDE instance in headless mode. Unfortunately, it is implemented in a way that all loaded plugins are processed. Therefore, it products multiple jar output files, and we pick the one related to the current plugin.

hsz avatar Oct 07 '23 12:10 hsz

I was mistaken, the issue does not cause the task to crash, it's just IntelliJ reporting the task as failed even though it actually succeeded.

chylex avatar Oct 15 '23 12:10 chylex

All memory leaks were addressed on the IntelliJ Platform side.

hsz avatar Jul 13 '24 18:07 hsz