{"action":"created","issue":{"url":"https://api.github.com/repos/kframework/k/issues/1539","labels_url":"https://api.github.com/repos/kframework/k/issues/1539/labels{/name}","comments_url":"https://api.github.com/repos/kframework/k/issues/1539/comments","events_url":"https://api.github.com/repos/kframework/k/issues/1539/events","html_url":"https://github.com/kframework/k/issues/1539","id":89501834,"number":1539,"title":"lack of synchronization when using the thread-unsafe cloning library","user":{"login":"yilongli","id":4922997,"avatar_url":"https://avatars.githubusercontent.com/u/4922997?v=3","gravatar_id":"","url":"https://api.github.com/users/yilongli","html_url":"https://github.com/yilongli","followers_url":"https://api.github.com/users/yilongli/followers","following_url":"https://api.github.com/users/yilongli/following{/other_user}","gists_url":"https://api.github.com/users/yilongli/gists{/gist_id}","starred_url":"https://api.github.com/users/yilongli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yilongli/subscriptions","organizations_url":"https://api.github.com/users/yilongli/orgs","repos_url":"https://api.github.com/users/yilongli/repos","events_url":"https://api.github.com/users/yilongli/events{/privacy}","received_events_url":"https://api.github.com/users/yilongli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kframework/k/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/kframework/k/labels/data-race","name":"data-race","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-19T08:11:54Z","updated_at":"2015-07-31T03:01:43Z","closed_at":null,"body":"Reported by RV-Predict:\r\n```\r\nData race on field java.util.LinkedList.$state: {{{\r\n    Concurrent write in thread T43 (locks held: {})\r\n ---->  at com.rits.cloning.Cloner.addAll(Cloner.java:594)\r\n        at com.rits.cloning.Cloner.allFields(Cloner.java:608)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:496)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:485)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.deepClone(Cloner.java:323)\r\n        at org.kframework.backend.java.symbolic.DeepCloner.clone(DeepCloner.java:30)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.constructNewSubjectTerm(PatternMatchRewriter.java:299)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.computeRewriteStep(PatternMatchRewriter.java:262)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.rewrite(PatternMatchRewriter.java:93)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.patternMatcherRewriteRun(JavaSymbolicExecutor.java:107)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.javaRewriteEngineRun(JavaSymbolicExecutor.java:134)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.run(JavaSymbolicExecutor.java:73)\r\n        at org.kframework.krun.tools.Executor$Tool.execute(Executor.java:169)\r\n        at org.kframework.krun.tools.Executor$Tool.run(Executor.java:125)\r\n        at org.kframework.transformation.TransformationCompositionProvider$2.run(TransformationCompositionProvider.java:120)\r\n        at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:118)\r\n        at org.kframework.main.FrontEnd.main(FrontEnd.java:52)\r\n        at org.kframework.main.Main.runApplication(Main.java:109)\r\n        at org.kframework.kserver.KServerFrontEnd.run(KServerFrontEnd.java:119)\r\n        at org.kframework.main.Main.nailMain(Main.java:70)\r\n    T43 is created by T12\r\n        at com.martiansoftware.nailgun.NGSessionPool.take(NGSessionPool.java:85)\r\n\r\n    Concurrent read in thread T57 (locks held: {})\r\n ---->  at com.rits.cloning.Cloner.cloneInternal(Cloner.java:497)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:485)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)\r\n        at com.rits.cloning.Cloner.deepClone(Cloner.java:323)\r\n        at org.kframework.backend.java.symbolic.DeepCloner.clone(DeepCloner.java:30)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.constructNewSubjectTerm(PatternMatchRewriter.java:299)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.computeRewriteStep(PatternMatchRewriter.java:262)\r\n        at org.kframework.backend.java.symbolic.PatternMatchRewriter.rewrite(PatternMatchRewriter.java:93)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.patternMatcherRewriteRun(JavaSymbolicExecutor.java:107)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.javaRewriteEngineRun(JavaSymbolicExecutor.java:134)\r\n        at org.kframework.backend.java.symbolic.JavaSymbolicExecutor.run(JavaSymbolicExecutor.java:73)\r\n        at org.kframework.krun.tools.Executor$Tool.execute(Executor.java:169)\r\n        at org.kframework.krun.tools.Executor$Tool.run(Executor.java:125)\r\n        at org.kframework.transformation.TransformationCompositionProvider$2.run(TransformationCompositionProvider.java:120)\r\n        at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:118)\r\n        at org.kframework.main.FrontEnd.main(FrontEnd.java:52)\r\n        at org.kframework.main.Main.runApplication(Main.java:109)\r\n        at org.kframework.kserver.KServerFrontEnd.run(KServerFrontEnd.java:119)\r\n        at org.kframework.main.Main.nailMain(Main.java:70)\r\n    T57 is created by T12\r\n        at com.martiansoftware.nailgun.NGSessionPool.take(NGSessionPool.java:85)\r\n}}}\r\n```"},"comment":{"url":"https://api.github.com/repos/kframework/k/issues/comments/126551068","html_url":"https://github.com/kframework/k/issues/1539#issuecomment-126551068","issue_url":"https://api.github.com/repos/kframework/k/issues/1539","id":126551068,"user":{"login":"yilongli","id":4922997,"avatar_url":"https://avatars.githubusercontent.com/u/4922997?v=3","gravatar_id":"","url":"https://api.github.com/users/yilongli","html_url":"https://github.com/yilongli","followers_url":"https://api.github.com/users/yilongli/followers","following_url":"https://api.github.com/users/yilongli/following{/other_user}","gists_url":"https://api.github.com/users/yilongli/gists{/gist_id}","starred_url":"https://api.github.com/users/yilongli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yilongli/subscriptions","organizations_url":"https://api.github.com/users/yilongli/orgs","repos_url":"https://api.github.com/users/yilongli/repos","events_url":"https://api.github.com/users/yilongli/events{/privacy}","received_events_url":"https://api.github.com/users/yilongli/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T03:01:43Z","updated_at":"2015-07-31T03:01:43Z","body":"This is unfortunately a false positive. The cloning library is indeed thread-safe:\r\nhttps://github.com/kostaskougios/cloning/blob/master/wiki/Usage.md\r\n\r\nAfter reading the source code of [Cloner.java] (https://github.com/kostaskougios/cloning/blob/f7a225ff9b397220503633fdd66bc3ad9ba936a6/src/main/java/com/rits/cloning/Cloner.java), I conclude that the RV-Predict output the false positive because it missed the HB edge between ```ConcurrentHashMap fieldsCache.put & get```. This was only fixed recently."}}