Open swift-ci opened 5 years ago
This does not crash for me on master.
@DougGregor, do you have the dup for this?
Comment by Kevin Lundberg (JIRA)
I attached a segfault for yesterday's 5.1 snapshot which looks like it had a slightly different assertion error than the compiler in beta 6 has. The development snapshot also has the bug with a slightly different assertion error too, which is also attached
Comment by Kevin Lundberg (JIRA)
I have a smaller example which exhibits the crash (using the compiler in Xcode 11 GM Seed), added to the description above.
It seems that structs can't handle generated code for projected values that are mutating gets. changing Foo to a class doesn't crash, or changing projectedValue's get to not be mutating also doesn't crash.
Might be fixed by https://github.com/apple/swift/pull/27109
It’s been cherry picked to 5.1 as well, could you verify using the next snapshot?
Comment by Kevin Lundberg (JIRA)
Thanks for the suggestion! I just tried using the 5.1 snapshot from yesterday, however it still crashes. Not with a segfault 11, but with an abort trap 6 with an assertion failure:
Assertion failed: (!selfParam.isIndirectMutating() && "passing unmaterialized r-value as inout argument"), function prepareAccessorObjectBaseArg, file /Users/buildnode/jenkins/workspace/oss-swift-5.1-package-osx/swift/lib/SILGen/SILGenApply.cpp, line 5943.
I've attached the full stack dump here, from compiling the updated reduced reproduction case: segfault-5.1-snapshot-9-11.txt
Edit: I just tried the trunk snapshot from 9/11 though, and that DID work. the crash on the 5/1 snapshot from yesterday and from 8/23 looks the same, so its probable that whatever fix was made to master wasn't applied to 5.1 by the time the most recent snapshot was made.
Comment by Kevin Lundberg (JIRA)
And yeah, it does look like this and SR-11393 are the same issue
Attachment: Download
Environment
Xcode 11 beta 6, on mac OS mojave 10.14.5Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash, PropertyWrappers | |Assignee | None | |Priority | Medium | md5: b0ae3adefac5b0119769526719ea31a4Issue Description:
When compiling a project that defines a property wrapper with a `projectedValue` property that happens to have a `mutating` getter, I hit a segmentation fault. changing the getter to not be `mutating` (and removing any code that made `mutating` a requirement) lets the compiler continue.
To reproduce, compile the SPM package attached to this issue, including the tests, (either in Xcode itself or with `swift build --build-tests`) and you'll see the attached segfault. If you change CopyOnWrite.swift by removing mutating and commenting the mutating-required code out, the compiler succeeds.
Edit: See the comment below, this is a smaller sample that exhibits the behavior: