{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/15074","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/15074/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/15074/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/15074/events","html_url":"https://github.com/dotnet/coreclr/issues/15074","id":274844549,"number":15074,"title":"[ARM32] CompareExchange working wrong in debug build with clang3.9","user":{"login":"Buyduck","id":20967326,"avatar_url":"https://avatars0.githubusercontent.com/u/20967326?v=4","gravatar_id":"","url":"https://api.github.com/users/Buyduck","html_url":"https://github.com/Buyduck","followers_url":"https://api.github.com/users/Buyduck/followers","following_url":"https://api.github.com/users/Buyduck/following{/other_user}","gists_url":"https://api.github.com/users/Buyduck/gists{/gist_id}","starred_url":"https://api.github.com/users/Buyduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Buyduck/subscriptions","organizations_url":"https://api.github.com/users/Buyduck/orgs","repos_url":"https://api.github.com/users/Buyduck/repos","events_url":"https://api.github.com/users/Buyduck/events{/privacy}","received_events_url":"https://api.github.com/users/Buyduck/received_events","type":"User","site_admin":false},"labels":[{"id":330967157,"url":"https://api.github.com/repos/dotnet/coreclr/labels/arch-arm32","name":"arch-arm32","color":"eb6420","default":false},{"id":198076301,"url":"https://api.github.com/repos/dotnet/coreclr/labels/area-PAL","name":"area-PAL","color":"d4c5f9","default":false},{"id":172143003,"url":"https://api.github.com/repos/dotnet/coreclr/labels/bug","name":"bug","color":"1d76db","default":true},{"id":192802699,"url":"https://api.github.com/repos/dotnet/coreclr/labels/os-linux","name":"os-linux","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/10","html_url":"https://github.com/dotnet/coreclr/milestone/10","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/10/labels","id":2344332,"number":10,"title":"2.1.0","description":".NET Core 2.1, next major release. See [official release dates](https://github.com/dotnet/core/blob/master/roadmap.md) for details.","creator":{"login":"karelz","id":5776068,"avatar_url":"https://avatars2.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":131,"closed_issues":1494,"state":"open","created_at":"2017-02-23T20:40:02Z","updated_at":"2018-03-17T18:12:22Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2017-11-17T12:05:56Z","updated_at":"2018-03-17T20:03:08Z","closed_at":"2018-02-15T10:56:42Z","author_association":"CONTRIBUTOR","body":"With next C# code:\r\n```\r\nusing System;\r\nusing System.Threading;\r\n\r\nclass Test\r\n{\r\n    static void Main()\r\n    {\r\n        long x = 322;\r\n        Console.WriteLine(x);\r\n        Interlocked.CompareExchange(ref x, 0, 0);\r\n        Console.WriteLine(x);\r\n    }\r\n}\r\n```\r\n\r\nWhile cross building debug version CoreCLR for ARM32 with clang3.9 got next result:\r\n```\r\njenkins@hoult-odroid:~/dotnet-arm$ ./overlayDBG39/corerun test.exe\r\n322\r\n0\r\n```\r\nAnd, while building with clang4.0 - everything is ok:\r\n```\r\njenkins@hoult-odroid:~/dotnet-arm$ ./overlayDBG40/corerun test.exe \r\n322\r\n322\r\n```\r\n\r\nWith Release version everything is ok. Seems, like in pal.h __sync_val_compare_and_swap() for some reason working wrong:\r\n```\r\n// See the 32-bit variant in interlock2.s\r\nEXTERN_C\r\nPALIMPORT\r\ninline\r\nLONGLONG\r\nPALAPI\r\nInterlockedCompareExchange64(\r\n    IN OUT LONGLONG volatile *Destination,\r\n    IN LONGLONG Exchange,\r\n    IN LONGLONG Comperand)\r\n{\r\n    return __sync_val_compare_and_swap(\r\n        Destination, /* The pointer to a variable whose value is to be compared with. */\r\n        Comperand, /* The value to be compared */\r\n        Exchange /* The value to be stored */);\r\n}\r\n```\r\n@alpencolt "},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/373948637","html_url":"https://github.com/dotnet/coreclr/issues/15074#issuecomment-373948637","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/15074","id":373948637,"user":{"login":"BruceForstall","id":10901265,"avatar_url":"https://avatars3.githubusercontent.com/u/10901265?v=4","gravatar_id":"","url":"https://api.github.com/users/BruceForstall","html_url":"https://github.com/BruceForstall","followers_url":"https://api.github.com/users/BruceForstall/followers","following_url":"https://api.github.com/users/BruceForstall/following{/other_user}","gists_url":"https://api.github.com/users/BruceForstall/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceForstall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceForstall/subscriptions","organizations_url":"https://api.github.com/users/BruceForstall/orgs","repos_url":"https://api.github.com/users/BruceForstall/repos","events_url":"https://api.github.com/users/BruceForstall/events{/privacy}","received_events_url":"https://api.github.com/users/BruceForstall/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T20:03:08Z","updated_at":"2018-03-17T20:03:08Z","author_association":"CONTRIBUTOR","body":"@janvorli Should we add documentation to https://github.com/dotnet/coreclr/blob/master/Documentation/building/linux-instructions.md indicating that Debug builds for ARM must use clang4.0 or later?\r\n\r\nShould we change build.sh to emit a warning (or error) if building arm debug without this?\r\n\r\nShould we try to get the official tools used to build ARM updated to 4.0 or later?\r\n\r\nThis problem is going to cause many Debug CI jobs for ARM Ubuntu to fail, as described in #16995."}}
{"actor":{"display_login":"BruceForstall"}}