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-1951] 3 segmentation faults after migrating code to Swift 3 #44560
Comments
This is still an issue with beta 2:
|
Have you been able to reduce the scope of the crasher, and maybe make a self-contained reproducer? |
Unfortunately no. The crash doesn't give me many clues about where the issue is exactly... |
This should be fixed by commit http://github.com/apple/swift/commit/2add29cf1b4d5c108dfb890f2ad83cb58019ee98 |
Thanks! I'll verify this in the next Xcode beta. |
This is still not fixed in Xcode 8 beta 4, Swift version 3.0 (swiftlang-800.0.41.2 clang-800.0.36)...
You can reproduce this by checking out the branch I mentioned. |
I just want to mention that this is completely blocking my ability to even build my app with Swift 3 (this is just one of the libraries I made for it), 4 betas later, and therefore not allowing me to potentially find even more issues. |
Also it looks like this is associated to a Radar, which is not publicly accessible. You might want to mark that as not-fixed too. |
The mentioned commit is not in beta 4. If I remember correctly you should be able to work around this by removing the closure in InMemoryCache.init(cacheName🙂 Instead of: return cache You could write: public init(cacheName: String) { |
These are the other 2 stack traces:
|
Reproduced on the swift-3.0-preview-4-branch: AsyncImageView/Renderers/ImageProcessingRenderer.swift Assertion failed: (!archetype->isPrimary() && "type metadata for primary archetype was not bound in context"), function emitArchetypeTypeMetadataRef, file /Users/arnold/Desktop/LLVMCompilerGitHub2/swift/lib/IRGen/GenArchetype.cpp, line 62. AsyncImageView/Renderers/MulticastedRenderer.swift: no relation found that declares conformance to target |
Yay |
The bug in ImageProcessingRenderer can be worked around by changing renderImageWithData to:
|
The bug in MulticastedRenderer can be worked around by reordering the type parameters 'Renderer' and 'Data'. diff --git a/AsyncImageView/Renderers/MulticastedRenderer.swift b/AsyncImageView/Renderers/MulticastedRenderer.swift
index 3d6f406..1493090 100644
--- a/AsyncImageView/Renderers/MulticastedRenderer.swift
+++ b/AsyncImageView/Renderers/MulticastedRenderer.swift
@@ -17,8 +17,8 @@ private typealias ImageProperty = Property<ImageResult?>
/// `RendererType` decorator which guarantees that images for a given `RenderDataType`
/// are only rendered once, and multicasted to every observer.
public final class MulticastedRenderer<
- Data: RenderDataType,
- Renderer: RendererType
+ Renderer: RendererType,
+ Data: RenderDataType
where
Renderer.Data == Data,
Renderer.Error == NoError
@@ -80,7 +80,7 @@ public final class MulticastedRenderer<
extension RendererType where Error == NoError {
/// Multicasts the results of this `RendererType`.
- public func multicasted() -> MulticastedRenderer<Self.Data, Self> {
+ public func multicasted() -> MulticastedRenderer<Self, Self.Data> {
return MulticastedRenderer(renderer: self)
}
} |
A fixe for the MulticastedRenderer crash is at apple/swift#4208 |
MulticastedRenderer needed another similar fix: apple/swift#4330 |
This is still not fixed in Xcode 8 GM, which is extremely disappointing. I reported this in beta 1, and the final version of Xcode has been released without a fix, which means that I can't release an update for my app in time. I honestly don't know why I even wasted my time to report this. |
I pushed the updated code to the branch (see description), so you can reproduce this yourself. |
I am sorry. Unfortunately, the mentioned changes did not make it into Xcode 8. We don't have a fix for the third issue yet. Do the workarounds I posted above (Aug 5 and 8) not work for you? I tested them with Xcode beta 4 and they seemed to work for me. |
The bug in Caching.swift is a new bug in the the type checker it should have noted the ambiguity error you get if you change valueForKey to:
/Users/arnold/Desktop/AsyncImageView_GM/AsyncImageView/Caching.swift:38:18: error: ambiguous reference to member 'value(forKey🙂' You can fix the ambiguity by changing the name of the CacheValue.value property (it was causing some ambiguity with NSObject.value(for...) to the following:
|
Filed https://bugs.swift.org/browse/SR-2592 for the type checker issue. |
Hey @NachoSoto, this bug is all fixed now right? |
I never disabled the workarounds in my code so I'm not 100% sure :/ But feel free to close this. |
Attachment: Download
Environment
Xcode 8.0 beta 1, 2, 3, and 4, and GM:
Additional Detail from JIRA
md5: f5182b809e24358511c8e911dd55764c
Issue Description:
Steps to reproduce:
Clone https://github.com/NachoSoto/AsyncImageView/
(`brew install carthage` if you don't have it installed, necessary to deal with rdar://19209161)
Check out branch swift3.
Compile AsyncImageView-iOS scheme.
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: