{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/424","repository_url":"https://api.github.com/repos/eclipse/eclipse-collections","labels_url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/424/comments","events_url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/424/events","html_url":"https://github.com/eclipse/eclipse-collections/issues/424","id":282920215,"number":424,"title":"entrySet() and values() removeIf() methods in both CHM are not thread-safe","user":{"login":"isopov","id":462800,"avatar_url":"https://avatars1.githubusercontent.com/u/462800?v=4","gravatar_id":"","url":"https://api.github.com/users/isopov","html_url":"https://github.com/isopov","followers_url":"https://api.github.com/users/isopov/followers","following_url":"https://api.github.com/users/isopov/following{/other_user}","gists_url":"https://api.github.com/users/isopov/gists{/gist_id}","starred_url":"https://api.github.com/users/isopov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isopov/subscriptions","organizations_url":"https://api.github.com/users/isopov/orgs","repos_url":"https://api.github.com/users/isopov/repos","events_url":"https://api.github.com/users/isopov/events{/privacy}","received_events_url":"https://api.github.com/users/isopov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-18T15:34:36Z","updated_at":"2017-12-19T16:19:54Z","closed_at":null,"author_association":"NONE","body":"Basically issue is the same as https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8078645 (there are two samples there counting duplicate issue) that is still present in java8 and fixed in java9.\r\nFor eclipse-collections this issue is present in ConcurrentHashMap and ConcurrentHashMapUnsafe running on both java8 and java9.\r\n\r\nHere is my sample revealing it - https://github.com/isopov/chm-jcstress\r\nYou can build it with\r\n`./mvnw clean package`\r\nAnd if have docker reproduce it easily on different java versions:\r\n```docker run -v `pwd`/target:/mnt/target openjdk:8u151-jre java -jar /mnt/target/chm-jcstress.jar```\r\nissues reproduced in both j.u.c.CHM and eclipse CHMs\r\n``` docker run -v `pwd`/target:/mnt/target openjdk:9.0.1-11-jre java -jar /mnt/target/chm-jcstress.jar```\r\nissues reproduced in eclipse CHMs only"},"comment":{"url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/comments/352808472","html_url":"https://github.com/eclipse/eclipse-collections/issues/424#issuecomment-352808472","issue_url":"https://api.github.com/repos/eclipse/eclipse-collections/issues/424","id":352808472,"user":{"login":"gs-rezaem","id":12956339,"avatar_url":"https://avatars2.githubusercontent.com/u/12956339?v=4","gravatar_id":"","url":"https://api.github.com/users/gs-rezaem","html_url":"https://github.com/gs-rezaem","followers_url":"https://api.github.com/users/gs-rezaem/followers","following_url":"https://api.github.com/users/gs-rezaem/following{/other_user}","gists_url":"https://api.github.com/users/gs-rezaem/gists{/gist_id}","starred_url":"https://api.github.com/users/gs-rezaem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gs-rezaem/subscriptions","organizations_url":"https://api.github.com/users/gs-rezaem/orgs","repos_url":"https://api.github.com/users/gs-rezaem/repos","events_url":"https://api.github.com/users/gs-rezaem/events{/privacy}","received_events_url":"https://api.github.com/users/gs-rezaem/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T16:19:54Z","updated_at":"2017-12-19T16:19:54Z","author_association":"CONTRIBUTOR","body":"@isopov I think I know the issue here. There is a bug in the test code. The map is initialized with zeros, so the following is possible:\r\n\r\nThread 2: put(0,0) (put is true because it's prepopulated)\r\nThread 1: put(0,1)\r\nThread 2: removeIf: false, as there is no 0 value.\r\n\r\nIf you add map.clear() before the CyclicBarrier and I can no longer see any System.outs."}}
{"actor":{"display_login":"gs-rezaem"}}