Bug 418554 - IOException("Unexpected end of stream") on classpath:/org/eclipse/xtext/Xtext.xtextbin
Summary: IOException("Unexpected end of stream") on classpath:/org/eclipse/xtext/Xtext...
Status: REOPENED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-02 17:24 EDT by Ed Willink CLA
Modified: 2013-10-11 09:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2013-10-02 17:24:45 EDT
M2 and earlier.

When starting up a nested Eclipse with IOException breakpoints I regularly get the trace below. looks like the protocol for binary EMF files is slightly different.

Thread [Worker-5] (Suspended (exception IOException))	
	owns: Object  (id=1338)	
	owns: GrammarProvider  (id=1339)	
	owns: Class<T> (com.google.inject.internal.InternalInjectorCreator) (id=1317)	
	owns: Collections$SynchronizedMap<K,V>  (id=1340)	
	owns: ResourceServiceProviderDescriptor  (id=1341)	
	owns: ClusteringBuilderState  (id=1342)	
	XMLResourceImpl$1(BinaryResourceImpl$EObjectInputStream).fill() line: 2695	
	XMLResourceImpl$1(BinaryResourceImpl$EObjectInputStream).readByte() line: 2685	
	XMLResourceImpl$1(BinaryResourceImpl$EObjectInputStream).readCompressedInt() line: 2822	
	XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>) line: 219	
	XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518	
	XMIResourceImpl(ResourceImpl).load(Map<?,?>) line: 1297	
	SynchronizedXtextResourceSet(ResourceSetImpl).demandLoad(Resource) line: 259	
	SynchronizedXtextResourceSet(ResourceSetImpl).demandLoadHelper(Resource) line: 274	
	SynchronizedXtextResourceSet(XtextResourceSet).getResource(URI, boolean) line: 201	
	SynchronizedXtextResourceSet.getResource(URI, boolean) line: 26	
	BaseEPackageAccess.loadResource(String, XtextResourceSet) line: 52	
	BaseEPackageAccess.loadGrammarFile(String, XtextResourceSet) line: 44	
	GrammarProvider.getGrammar(Object) line: 60	
	TerminalsGrammarAccess.internalFindGrammar(GrammarProvider) line: 37	
	TerminalsGrammarAccess.<init>(GrammarProvider) line: 33	
	NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native method]	
	NativeConstructorAccessorImpl.newInstance(Object[]) line: 57	
	DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 45	
	Constructor<T>.newInstance(Object...) line: 525	
	DefaultConstructionProxyFactory$1.newInstance(Object...) line: 85	
	ConstructorInjector<T>.construct(Errors, InternalContext, Class<?>, boolean) line: 85	
	ConstructorBindingImpl$Factory<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 254	
	ProviderToInternalFactoryAdapter$1.call(InternalContext) line: 46	
	InjectorImpl.callInContext(ContextualCallable<T>) line: 1031	
	ProviderToInternalFactoryAdapter<T>.get() line: 40	
	Scopes$1$1.get() line: 65	
	InternalFactoryToProviderAdapter<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 40	
	SingleParameterInjector<T>.inject(Errors, InternalContext) line: 38	
	SingleParameterInjector<T>.getAll(Errors, InternalContext, SingleParameterInjector<?>[]) line: 62	
	ConstructorInjector<T>.construct(Errors, InternalContext, Class<?>, boolean) line: 84	
	ConstructorBindingImpl$Factory<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 254	
	ProviderToInternalFactoryAdapter$1.call(InternalContext) line: 46	
	InjectorImpl.callInContext(ContextualCallable<T>) line: 1031	
	ProviderToInternalFactoryAdapter<T>.get() line: 40	
	Scopes$1$1.get() line: 65	
	InternalFactoryToProviderAdapter<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 40	
	FactoryProxy<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 54	
	SingleFieldInjector.inject(Errors, InternalContext, Object) line: 53	
	MembersInjectorImpl<T>.injectMembers(T, Errors, InternalContext, boolean) line: 110	
	ConstructorInjector<T>.construct(Errors, InternalContext, Class<?>, boolean) line: 94	
	ConstructorBindingImpl$Factory<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 254	
	ProviderToInternalFactoryAdapter$1.call(InternalContext) line: 46	
	InjectorImpl.callInContext(ContextualCallable<T>) line: 1031	
	ProviderToInternalFactoryAdapter<T>.get() line: 40	
	Scopes$1$1.get() line: 65	
	InternalFactoryToProviderAdapter<T>.get(Errors, InternalContext, Dependency<?>, boolean) line: 40	
	InternalInjectorCreator$1.call(InternalContext) line: 204	
	InternalInjectorCreator$1.call(InternalContext) line: 198	
	InjectorImpl.callInContext(ContextualCallable<T>) line: 1024	
	InternalInjectorCreator.loadEagerSingletons(InjectorImpl, Stage, Errors) line: 198	
	InternalInjectorCreator.injectDynamically() line: 179	
	InternalInjectorCreator.build() line: 109	
	Guice.createInjector(Stage, Iterable<Module>) line: 95	
	Guice.createInjector(Iterable<Module>) line: 72	
	Guice.createInjector(Module...) line: 62	
	Activator(Activator).createInjector(String) line: 67	
	Activator(Activator).getInjector(String) line: 55	
	XtextExecutableExtensionFactory.getInjector() line: 26	
	XtextExecutableExtensionFactory(AbstractGuiceAwareExecutableExtensionFactory).create() line: 49	
	ConfigurationElement.createExecutableExtension(String) line: 262	
	ConfigurationElementHandle.createExecutableExtension(String) line: 55	
	ResourceServiceProviderDescriptor.get(URI, String) line: 39	
	ResourceServiceProviderRegistryImpl$InternalData.getServiceProvider(URI, String) line: 40	
	ResourceServiceProviderRegistryImpl.getResourceServiceProvider(URI, String) line: 77	
	ResourceServiceProviderRegistryImpl.getResourceServiceProvider(URI) line: 93	
	UriValidator.isValid(URI, IStorage) line: 27	
	Storage2UriMapperJavaImpl$1.getURI(IJarEntryResource, PackageFragmentRootWalker$TraversalState) line: 217	
	Storage2UriMapperJavaImpl$1(SourceAttachmentPackageFragmentRootWalker<T>).handle(IJarEntryResource, TraversalState) line: 279	
	Storage2UriMapperJavaImpl$1(PackageFragmentRootWalker<T>).traverse(IJarEntryResource, boolean, TraversalState) line: 100	
	Storage2UriMapperJavaImpl$1(PackageFragmentRootWalker<T>).traverse(IPackageFragment, boolean, TraversalState) line: 88	
	Storage2UriMapperJavaImpl$1(PackageFragmentRootWalker<T>).traverse(IPackageFragmentRoot, boolean) line: 65	
	Storage2UriMapperJavaImpl$1(SourceAttachmentPackageFragmentRootWalker<T>).traverse(IPackageFragmentRoot, boolean) line: 168	
	Storage2UriMapperJavaImpl.initializeData(IPackageFragmentRoot) line: 230	
	Storage2UriMapperJavaImpl.getCachedData(IPackageFragmentRoot) line: 169	
	Storage2UriMapperJavaImpl.updateCache(IJavaProject) line: 323	
	Storage2UriMapperJavaImpl.initializeCache() line: 357	
	ClusteringBuilderState(AbstractBuilderState).load() line: 62	
	ClusteringBuilderState(AbstractBuilderState).ensureLoaded() line: 69	
	ClusteringBuilderState(AbstractBuilderState).getAllResourceDescriptions() line: 89	
	JdtToBeBuiltComputer(ToBeBuiltComputer).doRemoveProject(IProject, IProgressMonitor) line: 56	
	JdtToBeBuiltComputer(ToBeBuiltComputer).removeProject(IProject, IProgressMonitor) line: 52	
	JdtToBeBuiltComputer.removeProject(IProject, IProgressMonitor) line: 78	
	ProjectOpenedOrClosedListener.scheduleRemoveProjectJob(IProject) line: 125	
	ProjectOpenedOrClosedListener$1.visit(IResourceDelta) line: 102	
	ResourceDelta.accept(IResourceDeltaVisitor, int) line: 69	
	ResourceDelta.accept(IResourceDeltaVisitor, int) line: 80	
	ResourceDelta.accept(IResourceDeltaVisitor) line: 49	
	ProjectOpenedOrClosedListener.resourceChanged(IResourceChangeEvent) line: 87	
	ComposedResourceChangeListener.resourceChanged(IResourceChangeEvent) line: 29	
	NotificationManager$1.run() line: 291	
	SafeRunner.run(ISafeRunnable) line: 42	
	NotificationManager.notify(ResourceChangeListenerList$ListenerEntry[], IResourceChangeEvent, boolean) line: 285	
	NotificationManager.broadcastChanges(ElementTree, ResourceChangeEvent, boolean) line: 149	
	Workspace.broadcastPostChange() line: 396	
	Workspace.endOperation(ISchedulingRule, boolean, IProgressMonitor) line: 1531	
	RefreshJob(InternalWorkspaceJob).run(IProgressMonitor) line: 45	
	Worker.run() line: 53
Comment 1 Sven Efftinge CLA 2013-10-07 03:37:42 EDT
For backwards compatibility the code first tries to load a *.xtextbin file and if that doesn't exist (i.e. it throws the exception from comment #0) it looks for the old xmi version. See 

org.eclipse.xtext.service.GrammarProvider.getGrammar(Object)

I guess you have a language which you haven't regenerated recently so it still loads the grammar from *.xmi? Please reopen if I'm wrong.
Comment 2 Ed Willink CLA 2013-10-09 14:25:31 EDT
(In reply to Sven Efftinge from comment #1)
> I guess you have a language which you haven't regenerated recently so it
> still loads the grammar from *.xmi? Please reopen if I'm wrong.

That may be, but it's "classpath:/org/eclipse/xtext/Xtext.xtextbin" that is the URI of the problem resource.
Comment 3 Sven Efftinge CLA 2013-10-10 03:21:45 EDT
(In reply to Ed Willink from comment #2)
> (In reply to Sven Efftinge from comment #1)
> > I guess you have a language which you haven't regenerated recently so it
> > still loads the grammar from *.xmi? Please reopen if I'm wrong.
> 
> That may be, but it's "classpath:/org/eclipse/xtext/Xtext.xtextbin" that is
> the URI of the problem resource.

Could you check whether the file is contained in the jar(org.eclipse.xtext) you are using  and whether it has content?
Comment 4 Ed Willink CLA 2013-10-11 09:14:27 EDT
After instrumenting BinaryResourceImpl.EObjectInputStream.fill() it seems that for my grammar, a series of reads, none of which retuirn 0 or -1. Whereas for Xtext.xtextbin, a series of reads occur the last of which returns -1.

It would seem that the Xtext processing is attempting to read excessively.