New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-1096] swift2.2 generics property crash #43709
Comments
@slavapestov, is this a dup of the earlier issue with the ivar offset? |
Comment by Kazuhiro (JIRA) It looks a different problem. class SomeModel {
let str = "" // <- added
let entity = SomeEntity<Int>()
} |
Comment by neilwu (JIRA) Yep, I have met the same crash running on iOS7.1.2 with swift 2.2. let objectMirror = Mirror(reflecting: self) I create a small demo show show this crash with EVReflection. |
Just to confirm, this code was working in 2.1? |
Never mind, I see you added the "regression" label already. |
Comment by Kazuhiro (JIRA) Yep. I confirmed it's working on iPad2(iOS7.0.2) with Xcode7.2.1 . |
Can't reproduce. Please attach a complete demonstration project or storyboard and a crash log. |
Comment by TakuyaYokoyama (JIRA) I have attached the relevant files. Please confirm. |
Thanks, I'll take a look. |
Reproduced on 32-bit iOS 7.1.2 as shown in the crash log. Doesn't reproduce on 64-bit. I haven't tried iOS 8. Runtime is writing to read-only storage in _TEXT,_const. I haven't figured out what that storage is yet. This feels similar to SR-1055 where libobjc is writing to ivar offset variables that swiftc made read-only. |
Reduced test:
The store is here:
_globalIvarOffsets[0] is 12 and fieldOffsets[0] is 8. iOS 7 is the arclite path which may be relevant. 32-bit Swift object header is 3*sizeof(void*) = 12 instead of 2*sizeof(void*) = 8 which may be relevant. |
Found the bug. HeapObject.h and SwiftObject.mm disagree about SwiftObject's contents on 32-bit. |
Fixed in 41b12e7. I'll try to remember to add a comment here when the fix ships in Xcode; unfortunately we don't yet have a good process for that notification. |
Comment by Kazuhiro (JIRA) Thanks a lot! |
Comment by TakuyaYokoyama (JIRA) Thanks! I will continue to check this tickets. |
Comment by tianyouhui (JIRA) I'm sorry about when to explored to XCode? |
Comment by Andrew Naylor (JIRA) @gparker42 I noticed that 41b12e7 has been pulled into `master`, but not `swift-2.2`. Does this mean it won't be included in any further 2.2 releases? (It's absent from the 2.2.1 release). This bug prevents my team from releasing anything using Swift 2.2 as we must support iPhone 4 and anything we build is crashing on launch. |
Comment by Rebecca (JIRA) Still crashing with Xcode 7.3.1 (available just today) - do we know which version of Xcode the fix will be bundled in? @gparker42? |
We actually did see this working in Xcode 7.3.1, so it's possible there's another variation of the issue. (Sorry!) rebecca (JIRA User), mind filing a new bug with your project? (and anyone else who is still seeing this with a clean build in Xcode 7.3.1) |
We expect this to be fixed in Xcode 7.3.1 GM. It is not fixed in the 7.3.1 GM Seed (7D1012 iirc). Please verify that you are using Xcode 7.3.1 GM (build 7D1014). Then press the option key and Project > Clean Build Folder and rebuild. If you still see a crash then please update this bug and file a new Radar bug with a crash log and a demonstration project of any size. |
Comment by TakuyaYokoyama (JIRA) Thanks a lot! |
Attachment: Download
Environment
Xcode7.3 swift2.2
iPad2(iOS7.0.2) or iPhone4s(7.1.2)
Additional Detail from JIRA
md5: 24f887963495e893276816ee185deeef
is duplicated by:
Issue Description:
Hello. I'm sorry for my bad English.
Report the bug behavior of swift2.2.
Overview
VewController has property that has a GenericsClass property, crash at the time of execution.
Example
StackTrace
CounterMeasure
If change as follows, problem will not occur:
・change SomeEntity to Struct
・SomeEntity has no propery
・change SomeModel property to lazy
・SomeModel initialization in ViewDidLoad
The text was updated successfully, but these errors were encountered: