Community
Participate
Working Groups
Build Identifier: Eclipse 3.6.1 with UML2 3.1.1.v201008191505 We have running several Threads/Jobs at the same time parsing model and diagram resources including UML2 models. All these jobs are read only working. Every job is using it's own ResourceSet to read the model files to prevent conflicts. There should be no 'thing' be shared between the jobs. But sometimes (all the time the jobs are working parallel) we get a deadlock. Looking into the thread stack i can see (at least) two threads blocked in org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(java.util.HashMap<K,V>).get(java.lang.Object). The CacheAdapter is the same instance in both threads although the model resource were loaded independent. So i suppose the CacheAdapter is designed as a singleton shared between all UML2 model instances, but not really capable to work in a mutithread environment. Now the most important parst of both thread stacks: Thread [main] (Suspended) owns: java.util.Collections$SynchronizedMap<K,V> (id=156) org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(java.util.HashMap<K,V>).get(java.lang.Object) line: 303 org.eclipse.uml2.common.util.CacheAdapter.selfAdapt(org.eclipse.emf.common.notify.Notification) line: 520 org.eclipse.uml2.common.util.CacheAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).notifyChanged(org.eclipse.emf.common.notify.Notification) line: 430 org.eclipse.uml2.common.util.CacheAdapter.notifyChanged(org.eclipse.emf.common.notify.Notification) line: 342 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.common.notify.impl.BasicNotifierImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 380 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).unload() line: 1646 ... Thread [Worker-2] (Suspended) org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(java.util.HashMap<K,V>).get(java.lang.Object) line: 303 org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer).getCollection(java.lang.Object) line: 1642 org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer).add(org.eclipse.emf.ecore.InternalEObject, org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject) line: 1710 org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer).add(org.eclipse.emf.ecore.InternalEObject, org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject) line: 156 org.eclipse.uml2.common.util.CacheAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer).add(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject) line: 165 org.eclipse.uml2.common.util.CacheAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).handleCrossReference(org.eclipse.emf.ecore.EReference, org.eclipse.emf.common.notify.Notification) line: 633 org.eclipse.uml2.common.util.CacheAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).selfAdapt(org.eclipse.emf.common.notify.Notification) line: 452 org.eclipse.uml2.common.util.CacheAdapter.selfAdapt(org.eclipse.emf.common.notify.Notification) line: 534 org.eclipse.uml2.common.util.CacheAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).notifyChanged(org.eclipse.emf.common.notify.Notification) line: 430 org.eclipse.uml2.common.util.CacheAdapter.notifyChanged(org.eclipse.emf.common.notify.Notification) line: 342 org.eclipse.uml2.uml.internal.impl.CommentImpl(org.eclipse.uml2.uml.internal.impl.ElementImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 974 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>(org.eclipse.emf.ecore.util.EcoreEList<E>).dispatchNotification(org.eclipse.emf.common.notify.Notification) line: 255 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>(org.eclipse.emf.common.notify.impl.NotifyingListImpl<E>).addUnique(int, E) line: 372 org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl(org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl).setValue(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, int) line: 1191 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).setFeatureValue(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, int) line: 2658 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).handleForwardReferences(boolean) line: 1149 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).endDocument() line: 1228 org.eclipse.uml2.uml.internal.resource.UMLHandler.endDocument() line: 55 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).endDocument(com.sun.org.apache.xerces.internal.xni.Augmentations) line: 737 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 516 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(boolean) line: 808 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 737 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.XMLParser).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 119 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).parse(org.xml.sax.InputSource) line: 1205 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(org.xml.sax.InputSource) line: 522 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl(javax.xml.parsers.SAXParser).parse(org.xml.sax.InputSource, org.xml.sax.helpers.DefaultHandler) line: 395 org.eclipse.uml2.uml.internal.resource.UMLLoadImpl(org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl).load(org.eclipse.emf.ecore.xmi.XMLResource, java.io.InputStream, java.util.Map<?,?>) line: 181 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl).doLoad(java.io.InputStream, java.util.Map<?,?>) line: 180 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1494 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.util.Map<?,?>) line: 1282 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoad(org.eclipse.emf.ecore.resource.Resource) line: 255 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoadHelper(org.eclipse.emf.ecore.resource.Resource) line: 270 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getResource(org.eclipse.emf.common.util.URI, boolean) line: 397 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getEObject(org.eclipse.emf.common.util.URI, boolean) line: 216 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.resource.ResourceSet) line: 202 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject) line: 262 org.eclipse.uml2.uml.internal.impl.PackageImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eResolveProxy(org.eclipse.emf.ecore.InternalEObject) line: 1483 org.eclipse.uml2.uml.internal.impl.PackageImportImpl.getImportedPackage() line: 238 org.eclipse.uml2.uml.internal.impl.PackageImportImpl.eGet(int, boolean, boolean) line: 432 org.eclipse.uml2.uml.internal.impl.PackageImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean, boolean) line: 1021 org.eclipse.uml2.uml.internal.impl.PackageImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean) line: 1013 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer$1(org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 409 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer).handleCrossReference(org.eclipse.emf.ecore.EObject) line: 1694 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.add(org.eclipse.emf.ecore.EObject) line: 146 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.ecore.EObject) line: 695 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.common.notify.Notifier) line: 677 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier) line: 380 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, org.eclipse.emf.common.notify.Adapter) line: 503 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, java.lang.Object) line: 1 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.ArrayDelegatingEList<E>).addUnique(E) line: 395 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.AbstractEList<E>).add(E) line: 307 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).addAdapter(org.eclipse.emf.common.notify.Notifier) line: 822 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.ecore.EObject) line: 703 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.common.notify.Notifier) line: 677 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier) line: 380 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, org.eclipse.emf.common.notify.Adapter) line: 503 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, java.lang.Object) line: 1 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.ArrayDelegatingEList<E>).addUnique(E) line: 395 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.AbstractEList<E>).add(E) line: 307 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).addAdapter(org.eclipse.emf.common.notify.Notifier) line: 822 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).selfAdapt(org.eclipse.emf.common.notify.Notification) line: 510 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.selfAdapt(org.eclipse.emf.common.notify.Notification) line: 92 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).notifyChanged(org.eclipse.emf.common.notify.Notification) line: 430 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.common.notify.impl.BasicNotifierImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 380 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1514 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).getPackageForURI(java.lang.String) line: 2542 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).getFactoryForPrefix(java.lang.String) line: 2422 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).createObjectByType(java.lang.String, java.lang.String, boolean) line: 1299 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).createTopObject(java.lang.String, java.lang.String) line: 1468 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).processElement(java.lang.String, java.lang.String, java.lang.String) line: 1019 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMIHandler).processElement(java.lang.String, java.lang.String, java.lang.String) line: 87 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).startElement(java.lang.String, java.lang.String, java.lang.String) line: 1001 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) line: 712 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMIHandler).startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) line: 169 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).startElement(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations) line: 501 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser).emptyElement(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations) line: 179 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanStartElement() line: 1343 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver).next() line: 2755 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next() line: 648 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 511 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(boolean) line: 808 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 737 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.XMLParser).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 119 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).parse(org.xml.sax.InputSource) line: 1205 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(org.xml.sax.InputSource) line: 522 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl(javax.xml.parsers.SAXParser).parse(org.xml.sax.InputSource, org.xml.sax.helpers.DefaultHandler) line: 395 org.eclipse.uml2.uml.internal.resource.UMLLoadImpl(org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl).load(org.eclipse.emf.ecore.xmi.XMLResource, java.io.InputStream, java.util.Map<?,?>) line: 181 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl).doLoad(java.io.InputStream, java.util.Map<?,?>) line: 180 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1494 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).getPackageForURI(java.lang.String) line: 2542 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).getFactoryForPrefix(java.lang.String) line: 2422 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).createObjectByType(java.lang.String, java.lang.String, boolean) line: 1299 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).createTopObject(java.lang.String, java.lang.String) line: 1468 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).processElement(java.lang.String, java.lang.String, java.lang.String) line: 1019 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMIHandler).processElement(java.lang.String, java.lang.String, java.lang.String) line: 87 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).startElement(java.lang.String, java.lang.String, java.lang.String) line: 1001 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMLHandler).startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) line: 712 org.eclipse.uml2.uml.internal.resource.UMLHandler(org.eclipse.emf.ecore.xmi.impl.XMIHandler).startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) line: 169 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).startElement(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations) line: 501 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser).emptyElement(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations) line: 179 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanStartElement() line: 1343 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver).next() line: 2755 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next() line: 648 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 511 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(boolean) line: 808 com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 737 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.XMLParser).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: 119 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).parse(org.xml.sax.InputSource) line: 1205 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(org.xml.sax.InputSource) line: 522 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl(javax.xml.parsers.SAXParser).parse(org.xml.sax.InputSource, org.xml.sax.helpers.DefaultHandler) line: 395 org.eclipse.uml2.uml.internal.resource.UMLLoadImpl(org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl).load(org.eclipse.emf.ecore.xmi.XMLResource, java.io.InputStream, java.util.Map<?,?>) line: 181 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl).doLoad(java.io.InputStream, java.util.Map<?,?>) line: 180 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1494 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.util.Map<?,?>) line: 1282 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoad(org.eclipse.emf.ecore.resource.Resource) line: 255 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoadHelper(org.eclipse.emf.ecore.resource.Resource) line: 270 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getResource(org.eclipse.emf.common.util.URI, boolean) line: 397 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getEObject(org.eclipse.emf.common.util.URI, boolean) line: 216 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.resource.ResourceSet) line: 202 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject) line: 262 org.eclipse.uml2.uml.internal.impl.ElementImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eResolveProxy(org.eclipse.emf.ecore.InternalEObject) line: 1483 org.eclipse.uml2.uml.internal.impl.ElementImportImpl.getImportedElement() line: 319 org.eclipse.uml2.uml.internal.impl.ElementImportImpl.eGet(int, boolean, boolean) line: 534 org.eclipse.uml2.uml.internal.impl.ElementImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean, boolean) line: 1021 org.eclipse.uml2.uml.internal.impl.ElementImportImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean) line: 1013 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer$1(org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 409 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer).handleCrossReference(org.eclipse.emf.ecore.EObject) line: 1694 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.add(org.eclipse.emf.ecore.EObject) line: 146 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.ecore.EObject) line: 695 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.common.notify.Notifier) line: 677 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier) line: 380 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, org.eclipse.emf.common.notify.Adapter) line: 503 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, java.lang.Object) line: 1 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.ArrayDelegatingEList<E>).addUnique(E) line: 395 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.AbstractEList<E>).add(E) line: 307 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).addAdapter(org.eclipse.emf.common.notify.Notifier) line: 822 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.ecore.EObject) line: 703 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.common.notify.Notifier) line: 677 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier) line: 380 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, org.eclipse.emf.common.notify.Adapter) line: 503 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, java.lang.Object) line: 1 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.ArrayDelegatingEList<E>).addUnique(E) line: 395 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.AbstractEList<E>).add(E) line: 307 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).addAdapter(org.eclipse.emf.common.notify.Notifier) line: 822 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).selfAdapt(org.eclipse.emf.common.notify.Notification) line: 510 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.selfAdapt(org.eclipse.emf.common.notify.Notification) line: 92 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).notifyChanged(org.eclipse.emf.common.notify.Notification) line: 430 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.common.notify.impl.BasicNotifierImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 380 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1514 org.eclipse.uml2.uml.internal.resource.UMLResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.util.Map<?,?>) line: 1282 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoad(org.eclipse.emf.ecore.resource.Resource) line: 255 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoadHelper(org.eclipse.emf.ecore.resource.Resource) line: 270 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getResource(org.eclipse.emf.common.util.URI, boolean) line: 397 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getEObject(org.eclipse.emf.common.util.URI, boolean) line: 216 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.resource.ResourceSet) line: 202 org.eclipse.emf.ecore.util.EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject) line: 262 org.eclipse.gmf.runtime.notation.impl.DiagramImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eResolveProxy(org.eclipse.emf.ecore.InternalEObject) line: 1483 org.eclipse.gmf.runtime.notation.impl.DiagramImpl(org.eclipse.gmf.runtime.notation.impl.ViewImpl).getElement() line: 348 org.eclipse.gmf.runtime.notation.impl.DiagramImpl.eGet(int, boolean, boolean) line: 330 org.eclipse.gmf.runtime.notation.impl.DiagramImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean, boolean) line: 1021 org.eclipse.gmf.runtime.notation.impl.DiagramImpl(org.eclipse.emf.ecore.impl.BasicEObjectImpl).eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean) line: 1013 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer$1(org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 409 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer(org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer).handleCrossReference(org.eclipse.emf.ecore.EObject) line: 1694 org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.add(org.eclipse.emf.ecore.EObject) line: 146 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.ecore.EObject) line: 695 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).setTarget(org.eclipse.emf.common.notify.Notifier) line: 677 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier) line: 380 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, org.eclipse.emf.common.notify.Adapter) line: 503 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didAdd(int, java.lang.Object) line: 1 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.ArrayDelegatingEList<E>).addUnique(E) line: 395 org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList(org.eclipse.emf.common.util.AbstractEList<E>).add(E) line: 307 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).addAdapter(org.eclipse.emf.common.notify.Notifier) line: 822 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).selfAdapt(org.eclipse.emf.common.notify.Notification) line: 510 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter.selfAdapt(org.eclipse.emf.common.notify.Notification) line: 92 org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter).notifyChanged(org.eclipse.emf.common.notify.Notification) line: 430 org.eclipse.gmf.runtime.emf.core.resources.GMFResource(org.eclipse.emf.common.notify.impl.BasicNotifierImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 380 org.eclipse.gmf.runtime.emf.core.resources.GMFResource(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.io.InputStream, java.util.Map<?,?>) line: 1514 org.eclipse.gmf.runtime.emf.core.resources.GMFResource(org.eclipse.emf.ecore.resource.impl.ResourceImpl).load(java.util.Map<?,?>) line: 1282 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoad(org.eclipse.emf.ecore.resource.Resource) line: 255 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).demandLoadHelper(org.eclipse.emf.ecore.resource.Resource) line: 270 org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain$AdapterFactoryEditingDomainResourceSet(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl).getResource(org.eclipse.emf.common.util.URI, boolean) line: 397 ... Reproducible: Always Steps to Reproduce: 1. Write a job loading/unloading UML2 model files in separate ResourceSet's. 2. Start more than one instance of that job parsing (load + unload) different (or same) model files again and again and again... 3. wait for deadlock
It seems to be a difference between the following two implementations for unloading the resource set: 1. Deadlock final ResourceSet resourceSet = editingDomain.getResourceSet(); for(final Iterator<Resource> it = resourceSet.getResources().iterator(); it.hasNext();) { final Resource tmpResource = it.next(); tmpResource.unload(); it.remove(); }// for 2. Currently no deadlock final ResourceSet resourceSet = editingDomain.getResourceSet(); for(final Iterator<Resource> it = resourceSet.getResources().iterator(); it.hasNext();) { final Resource tmpResource = it.next(); tmpResource.unload(); }// for resourceSet.getResources().clear();
Do the changes attached to bug 335125 address your issues?
After some months of observing: With workaround from issue 335125 and other changes (in our parts) the number of deadlocks is reduced, but just present.
Reducing the severity of this issue given that there is a (partial) workaround.
See also bug 335135, which is about data structure corruption (and subsequent exceptions or infinite loops - but no deadlocks). That one was worked around by using thread-specific CacheAdapters.
(In reply to comment #5) > See also bug 335135, which is about data structure corruption (and subsequent > exceptions or infinite loops - but no deadlocks). That one was worked around by > using thread-specific CacheAdapters. You are right, in most cases a infinite loop is the reason for our problems.
The changes described in bug 335125 are now available in an integration build. I don't think there's muce more that can be done in UML2 itself to address thread safety issues. Please re-open this bug if you believe otherwise.
Nice, thanks, Kenn!
We very recently ran into the same issue when migrating one of our tools to use Sphinx for loading UML models. We identified that the direct cause for this issue (which very much explains the stack trace within comment #1) is actually not a deadlock, but a life-lock, which is caused by the fact the the hash entries within InternalCrossReferencer may get corrupted during simultaneous loading of a model (from 2 different threads) in a sense that they actually form a cycle. Thereby, self-adapt can never be left again after both threads have called it (both are in an endless loop). We could reproduce this when we started a runtime-workspace where we had the Eclipse UML2 editor left open for a big model when closing it before; while Sphinx now automatically loaded the model during startup as well), however, we were not able to debug it properly (we already tried to use a condition breakpoint that checks when the hash map entries become cyclic, but evaluation was so slow that we could not reproduce it during debugging. I am thus not able to tell what the root cause for this is, only that the mess seems to happen when the InverseCrossReferencer is filled, not afterwards. Maybe that helps...
Alexander, did you try using thread-specific cache adapters? Rafael indicates in comment #5 that this may be a workaround for the problems you are seeing...
(In reply to Kenn Hussey from comment #10) > Alexander, did you try using thread-specific cache adapters? Rafael > indicates in comment #5 that this may be a workaround for the problems you > are seeing... Yes, we also tried this but ran into the problem my colleague Patrick reported in comment #9 of bug #335125, so this is no solution for us either. It seems as if: - CacheAdapter (including its nested InverseCrossReferencer) is not thread-safe (reported here) - not all parts of the framework know how to deal with thread-local cache adapters properly (see bug #335125) It would be fine if we could solve at least one of those...
I have pushed a new branch bugs/332057 with the following changes: Commit 143f8f0: A JUnit test suite, including two test methods that may be renamed by removing the leading underscore to run some performance statistics (see below). The principal test faithfully reproduces the live-lock on the circular hash-bucket corruption described in comment #9. Commit f59f382: A crude solution to this particular problem, introducing overrides in the CacheAdapter to synchronize critical sections that operate on the inverse cross referencer map. Performance Impact Analysis: Using the JUnit test suite, I collected some statistics on a 2x2 matrix of these dimensions: * original CacheAdapter vs "fixed" CacheAdapter (with additional synchronization) * parallel execution of a scenario on multiple threads vs execution of the same amount of work on a single thread The "work" performed in each scenario is loading and resolving all references in the UML metamodel in a discrete new resource set, then unloading everything in that resource set, 95 times. That is, 95 times in sequence on one thread or 5 times in sequence on each of 19 concurrent threads. In each cell of the 2x2 matrix, the test executed 11 runs of the scenario: once to warm up and then 10 more runs, on which the average running time was computed. The results are as follows: * single thread using original cache adapter: * mean: 29.75 seconds (std dev: 0.20 seconds) * parallel threads using original cache adapter (in the thread-local mode): * mean: 7.11 seconds (std dev: 0.32 seconds) * single thread using the "fixed" cache adapter: * mean: 29.51 seconds (std dev: 0.09 seconds) * parallel threads using the "fixed" cache adapter (singleton, not thread-local): * mean: 22.18 seconds (std dev: 2.57 seconds) So, as we can see, the performance of single-threaded applications is essentially the same with or without this fix. That is good, as it indicates that performance of most applications is not apparently regressed (I am assuming that most applications having multiple threads accessing models already have some external synchronization mechanisms in place that effectively serialize access to the models, anyways). However, the performance of the parallel test configuration is quite comparable to performance of the single-threaded configuration: parallelization provides some statistically significant gain (as indicated by the standard deviation) but the "fixed" CacheAdapter largely serializes its book-keeping. Note that I ran these tests on a 2012 Retina MacBook Pro with solid-state storage. Parallelization could conceivably make a bigger difference on other systems (especially with slower storage media). Finally, note that I write "fixed" in scare quotes because this, so far, addresses the specific use case described in the re-opened bug (comment #9) but there are probably other synchronization holes to be plugged that might show themselves in other use cases. Also, it may be worth investigating other approaches than this very simple introduction of new synchronized code blocks, which could provide more elegant/complete/performant solutions.
Thanks, Christian, the code looks good. But when I ran the tests, I witness a number of memory errors: Exception in thread "CacheAdapterTest-1" java.lang.OutOfMemoryError: Java heap space Does the launch config for the tests need to be updated to launch with more heap space memory?
(In reply to comment #13) > > Does the launch config for the tests need to be updated to launch with more heap > space memory? I've pushed a new commit 9787fb0 that adds heap sizing parameters to the launch configs and otherwise aligns them to actual run-time requirements. My local Hudson build completes normally on this commit, but it did before, too. Of course, most VMs default their max heap size according to the system memory available at the time they start up, so I wouldn't be surprised that the build at Eclipse had trouble. (although 19 concurrent instances of the UML metamodel and its dependencies shouldn't be *that* big ... right?)
Thanks, Christian. The changes have been merged/pushed to the ‘master’ branch in git and will be available in an integration build soon.
The fix is now available an integration build for UML2 5.0.