{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/xtext-core/issues/906","repository_url":"https://api.github.com/repos/eclipse/xtext-core","labels_url":"https://api.github.com/repos/eclipse/xtext-core/issues/906/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/xtext-core/issues/906/comments","events_url":"https://api.github.com/repos/eclipse/xtext-core/issues/906/events","html_url":"https://github.com/eclipse/xtext-core/issues/906","id":369513660,"node_id":"MDU6SXNzdWUzNjk1MTM2NjA=","number":906,"title":"ConcurrentModificationException in AllRulesCache.findInEmfObject()","user":{"login":"ckulla","id":177320,"node_id":"MDQ6VXNlcjE3NzMyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/177320?v=4","gravatar_id":"","url":"https://api.github.com/users/ckulla","html_url":"https://github.com/ckulla","followers_url":"https://api.github.com/users/ckulla/followers","following_url":"https://api.github.com/users/ckulla/following{/other_user}","gists_url":"https://api.github.com/users/ckulla/gists{/gist_id}","starred_url":"https://api.github.com/users/ckulla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckulla/subscriptions","organizations_url":"https://api.github.com/users/ckulla/orgs","repos_url":"https://api.github.com/users/ckulla/repos","events_url":"https://api.github.com/users/ckulla/events{/privacy}","received_events_url":"https://api.github.com/users/ckulla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/eclipse/xtext-core/milestones/8","html_url":"https://github.com/eclipse/xtext-core/milestone/8","labels_url":"https://api.github.com/repos/eclipse/xtext-core/milestones/8/labels","id":3209201,"node_id":"MDk6TWlsZXN0b25lMzIwOTIwMQ==","number":8,"title":"Release_2.16","description":"","creator":{"login":"cdietrich","id":238736,"node_id":"MDQ6VXNlcjIzODczNg==","avatar_url":"https://avatars2.githubusercontent.com/u/238736?v=4","gravatar_id":"","url":"https://api.github.com/users/cdietrich","html_url":"https://github.com/cdietrich","followers_url":"https://api.github.com/users/cdietrich/followers","following_url":"https://api.github.com/users/cdietrich/following{/other_user}","gists_url":"https://api.github.com/users/cdietrich/gists{/gist_id}","starred_url":"https://api.github.com/users/cdietrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdietrich/subscriptions","organizations_url":"https://api.github.com/users/cdietrich/orgs","repos_url":"https://api.github.com/users/cdietrich/repos","events_url":"https://api.github.com/users/cdietrich/events{/privacy}","received_events_url":"https://api.github.com/users/cdietrich/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":42,"state":"open","created_at":"2018-03-22T12:47:39Z","updated_at":"2018-10-17T11:40:20Z","due_on":null,"closed_at":null},"comments":26,"created_at":"2018-10-12T11:35:01Z","updated_at":"2018-10-17T12:19:14Z","closed_at":null,"author_association":"NONE","body":"I see from time to time a `ConcurrentModificationException` while parsing files with Xtext 2.14.0.\r\n\r\n```\r\njava.util.ConcurrentModificationException\r\n\tat org.eclipse.emf.common.util.ArrayDelegatingEList$EIterator.checkModCount(ArrayDelegatingEList.java:883)\r\n\tat org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:699)\r\n\tat org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:685)\r\n\tat org.eclipse.xtext.service.AllRulesCache.findInEmfObject(AllRulesCache.java:64)\r\n\tat org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.createAllRules(AbstractInternalAntlrParser.java:239)\r\n\tat org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.registerRules(AbstractInternalAntlrParser.java:232)\r\n\tat com.<>.parser.antlr.internal.Internal<>Parser.<init>(Internal<>Parser.java:124)\r\n\tat com.<>.parser.antlr.<>Parser.createParser(<>Parser.java:25)\r\n\tat com.<>.parser.antlr.<>Parser.createParser(<>Parser.java:1)\r\n\tat org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:92)\r\n\tat org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)\r\n\tat org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)\r\n\tat org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:33)\r\n\tat org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:176)\r\n\tat org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:100)\r\n\tat org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1563)\r\n\tat org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1342)\r\n\tat org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)\r\n\tat org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)\r\n\tat org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)\r\n```\r\n\r\nThis happens in a multithreaded application, where files are parsed concurrently on differnet threads.\r\nThe application is a kind of background daemon for code generation in a C++ build system.\r\nIt happens only sporadically. \r\n\r\nThe EMF adapters list of the grammar object seems to get modified on another thread while looking up the `AllRulesCache` instance in `AbstractInternalAntlrParser.createAllRules()`."},"comment":{"url":"https://api.github.com/repos/eclipse/xtext-core/issues/comments/430605617","html_url":"https://github.com/eclipse/xtext-core/issues/906#issuecomment-430605617","issue_url":"https://api.github.com/repos/eclipse/xtext-core/issues/906","id":430605617,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDYwNTYxNw==","user":{"login":"ckulla","id":177320,"node_id":"MDQ6VXNlcjE3NzMyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/177320?v=4","gravatar_id":"","url":"https://api.github.com/users/ckulla","html_url":"https://github.com/ckulla","followers_url":"https://api.github.com/users/ckulla/followers","following_url":"https://api.github.com/users/ckulla/following{/other_user}","gists_url":"https://api.github.com/users/ckulla/gists{/gist_id}","starred_url":"https://api.github.com/users/ckulla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckulla/subscriptions","organizations_url":"https://api.github.com/users/ckulla/orgs","repos_url":"https://api.github.com/users/ckulla/repos","events_url":"https://api.github.com/users/ckulla/events{/privacy}","received_events_url":"https://api.github.com/users/ckulla/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T12:19:14Z","updated_at":"2018-10-17T12:19:14Z","author_association":"NONE","body":"Eager attaching would mean that the `GrammarProvider` needs to know about the adapters of several other classes. This would increases coupling of the classes. We see this already with the AllRulesCache approach.\r\n\r\nAnother approach would be to protect lookup and manipulation of the grammar adapters from concurrent read and write. Either with synchronized code blocks or a `ReadWriteLock`."}}
{"actor":{"display_login":"ckulla"}}