Skip to content

Fix improper use of sub-monitor in Workspace.write()#1795

Merged
ptziegler merged 1 commit intoeclipse-platform:masterfrom
ptziegler:sub-monitor-in-workspace
Mar 31, 2025
Merged

Fix improper use of sub-monitor in Workspace.write()#1795
ptziegler merged 1 commit intoeclipse-platform:masterfrom
ptziegler:sub-monitor-in-workspace

Conversation

@ptziegler
Copy link
Contributor

SubMonitor.split() should not be called without providing any ticks, which might happen if the map of to-be-created files is empty. Given that the called method is private and only called from this method, the empty check can simply be pulled up.

@ptziegler
Copy link
Contributor Author

!ENTRY org.eclipse.core.runtime 2 0 2025-03-29 13:51:52.240
!MESSAGE Attempted to create a child without providing it with any ticks
!STACK 0
java.lang.Throwable
	at org.eclipse.core.runtime.SubMonitor.logProblem(SubMonitor.java:1196)
	at org.eclipse.core.runtime.SubMonitor.newChild(SubMonitor.java:910)
	at org.eclipse.core.runtime.SubMonitor.split(SubMonitor.java:1121)
	at org.eclipse.core.runtime.SubMonitor.split(SubMonitor.java:1028)
	at org.eclipse.core.internal.resources.Workspace.write(Workspace.java:2832)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.flushBatch(BatchImageBuilder.java:433)
	at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:508)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:358)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:309)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:442)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:250)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:373)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:118)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:311)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:217)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2025

Test Results

 1 598 files   - 1   1 598 suites   - 1   1h 31m 1s ⏱️ + 5m 0s
 4 173 tests ±0   4 150 ✅ +1   23 💤 ±0  0 ❌  - 1 
11 998 runs   - 3  11 832 ✅  - 2  166 💤 ±0  0 ❌  - 1 

Results for commit f762d79. ± Comparison against base commit eca8380.

♻️ This comment has been updated with latest results.

SubMonitor.split() should not be called without providing any ticks,
which might happen if the map of to-be-created files is empty. Given
that the called method is private and only called from this method, the
empty check can simply be pulled up.
@ptziegler ptziegler force-pushed the sub-monitor-in-workspace branch from 1d6f4cf to f762d79 Compare March 31, 2025 06:31
@ptziegler
Copy link
Contributor Author

The memory leak on Windows is unrelated and Linux/MacOS are looking fine. Merging.

@ptziegler ptziegler merged commit deeead8 into eclipse-platform:master Mar 31, 2025
17 of 18 checks passed
@ptziegler ptziegler deleted the sub-monitor-in-workspace branch March 31, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant