Bug 446611 - Assertion error during semantic highlighting because of refresh during resource load
Summary: Assertion error during semantic highlighting because of refresh during resour...
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.7.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-10 07:22 EDT by Hendrik Eeckhaut CLA
Modified: 2014-10-10 09:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Eeckhaut CLA 2014-10-10 07:22:20 EDT
I saw this error in the Eclipse log. During semantic highlighting another resource is loaded which is out of sync. This results in a refresh and an assertion error. I have never seen this error in earlier versions of Xtext (or EMF?)

at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
	at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:134)
	at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:333)
	at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:85)
	at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:286)
	at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:118)
	at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:2282)
	at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1691)
	at org.eclipse.core.internal.resources.File.refreshLocal(File.java:333)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:205)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:525)
	at org.eclipse.xtext.resource.ExternalContentSupport$ExternalContentAwareURIHandler.createInputStream(ExternalContentSupport.java:69)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.xtext.resource.XtextResourceSet$1.createInputStream(XtextResourceSet.java:262)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at com.sigasi.hdt.shared.InterceptingResourceSet.demandLoadHelper(InterceptingResourceSet.java:21)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:211)
	at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:24)
	at com.sigasi.hdt.shared.InterceptingResourceSet.getResource(InterceptingResourceSet.java:26)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:220)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1473)
	at com.sigasi.hdt.vhdl.vhdl.impl.IdentifierPathElementImpl.getIdentifier(IdentifierPathElementImpl.java:69)
	at com.sigasi.hdt.vhdl.vhdl.impl.IdentifierPathElementImpl.eGet(IdentifierPathElementImpl.java:108)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998)
	at com.sigasi.hdt.vhdl.ui.editor.VhdlSemanticHighlightingCalculator.a(VhdlSemanticHighlightingCalculator.java:17)
	at com.sigasi.hdt.vhdl.ui.editor.VhdlSemanticHighlightingCalculator.provideHighlightingFor(VhdlSemanticHighlightingCalculator.java:50)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.MergingHighlightedPositionAcceptor.provideHighlightingFor(MergingHighlightedPositionAcceptor.java:51)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.reconcilePositions(HighlightingReconciler.java:138)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.modelChanged(HighlightingReconciler.java:346)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.notifyModelListeners(XtextDocument.java:182)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:432)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:131)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.unloadAffectedResourcesAndReparseDocument(DirtyStateEditorSupport.java:179)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.run(DirtyStateEditorSupport.java:158)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Sebastian Zarnekow CLA 2014-10-10 07:27:06 EDT
Could be caused by a new default (?) setting in Eclipse which triggers automatic refresh on access.
Comment 2 Sebastian Zarnekow CLA 2014-10-10 07:29:40 EDT
You don't happen to have a pattern that allows to reproduce this? Some step by step list?
Comment 3 Lieven Lemiengre CLA 2014-10-10 09:27:49 EDT
(In reply to Sebastian Zarnekow from comment #2)
> You don't happen to have a pattern that allows to reproduce this? Some step
> by step list?

This stacktrace was automatically collected at a client, we don't know how he triggered this.

The 'refreshLocal' is triggered when when a file was changed outside of eclipse & eclipse itself hasn't refreshed yet. So I would assume that to trigger the bug you would have to open the file, change a dependent file outside of eclipse (without automatic refresh) & then modify the file.

I don't understand why the 'refreshLocal' fails though, maybe something else happened concurrently.

Either way, I really dislike the behavior of 'PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream' it shouldn't refresh the resource at all.