{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/15840","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/15840/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/15840/comments","events_url":"https://api.github.com/repos/apple/swift/issues/15840/events","html_url":"https://github.com/apple/swift/pull/15840","id":312751792,"number":15840,"title":"Make CopyForwarding more conservative about shrinking lifetimes.","user":{"login":"atrick","id":2165663,"avatar_url":"https://avatars1.githubusercontent.com/u/2165663?v=4","gravatar_id":"","url":"https://api.github.com/users/atrick","html_url":"https://github.com/atrick","followers_url":"https://api.github.com/users/atrick/followers","following_url":"https://api.github.com/users/atrick/following{/other_user}","gists_url":"https://api.github.com/users/atrick/gists{/gist_id}","starred_url":"https://api.github.com/users/atrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrick/subscriptions","organizations_url":"https://api.github.com/users/atrick/orgs","repos_url":"https://api.github.com/users/atrick/repos","events_url":"https://api.github.com/users/atrick/events{/privacy}","received_events_url":"https://api.github.com/users/atrick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-04-10T02:32:30Z","updated_at":"2018-04-11T05:09:45Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/15840","html_url":"https://github.com/apple/swift/pull/15840","diff_url":"https://github.com/apple/swift/pull/15840.diff","patch_url":"https://github.com/apple/swift/pull/15840.patch"},"body":"Fixes <rdar://problem/39209102> [SR-7354]: Swift 4.1 Regression: EXC_BAD_ACCESS for Optimized Builds in Xcode 9.3\r\n\r\nCommentary:\r\n\r\nThe underlying problem is that CopyForwarding is an inherently\r\ndangerous pass by design that has been waiting for the SIL\r\nrepresentation to evolve to the point where it can be rewritten.\r\n\r\nThe regressions was caused by PredictableMemOps failing to preserve\r\nnormal patterns of ownership. When it forwards loads, it implicitly\r\nextends the lifetime of stored value\r\n\r\nstore %val to %addr\r\n...\r\nretain %val\r\n...\r\ndestroy_addr %addr\r\n\r\nCopyForwarding already tried to detect such violations of ownership\r\nrules and normally bypasses destroy hoisting in those cases. In this\r\ncase, it fails to detect the problem because PredictableMemOps has\r\nalready erased the load, so there's no evidence of the value's\r\nlifetime being extended.\r\n\r\nIt might have been nice if PredictableMemOps had transformed the\r\nretain %val into a retain %addr. However, for the immediate fix, we\r\ndon't want to change any existing behavior other than suppressing\r\noptimization. In the long term, CopyForwarding does not really make\r\nsense without SemanticSIL+SILOwnership and should be totally rewritten\r\nand greatly simplified at that point.\r\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/380328962","html_url":"https://github.com/apple/swift/pull/15840#issuecomment-380328962","issue_url":"https://api.github.com/repos/apple/swift/issues/15840","id":380328962,"user":{"login":"swift-ci","id":15467072,"avatar_url":"https://avatars0.githubusercontent.com/u/15467072?v=4","gravatar_id":"","url":"https://api.github.com/users/swift-ci","html_url":"https://github.com/swift-ci","followers_url":"https://api.github.com/users/swift-ci/followers","following_url":"https://api.github.com/users/swift-ci/following{/other_user}","gists_url":"https://api.github.com/users/swift-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-ci/subscriptions","organizations_url":"https://api.github.com/users/swift-ci/orgs","repos_url":"https://api.github.com/users/swift-ci/repos","events_url":"https://api.github.com/users/swift-ci/events{/privacy}","received_events_url":"https://api.github.com/users/swift-ci/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T05:09:45Z","updated_at":"2018-04-11T05:09:45Z","author_association":"CONTRIBUTOR","body":"**Build failed**\n[Swift Test OS X Platform](https://ci.swift.org/job/swift-PR-osx/4244/)\nGit Sha - 7ecf16a795e69d33fd6782383062c3108982ad15\n"}}
{"actor":{"display_login":"swift-ci"}}