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-10200] NSForwarding: warning: object 0x102408108 of class 'Module.NonGenericFinalSwiftClass' does not implement methodSignatureForSelector: -- trouble ahead #52600
Comments
cc @slavapestov |
What OS version is this? CC @mikeash |
Xcode running on 10.14.3 (18D109) - project compiled with minimal deployment target iOS 10.3, and executed on an iPhone 6 Plus 12.1.1 (16C50). The crash happens randomly when I compile and run the project. I just have seen it the second time today. Working on the project the whole day without any issues, but this start appear now. (I have not working on the codebase that cases the crash.) |
Looks like it's failing to find the `+initialize` method on the class. `SwiftObject` has an empty `+initialize` so I'd guess that the superclass pointer isn't set up properly. Given that it's inconsistent, maybe there's a race. If you re-run without recompiling after a crash, does it reliably crash again, or is it still inconsistent? (This would distinguish between some intermittent compiler error and an intermittent runtime error.) |
I tried to run the project without re-compiling, it did crash on the first time I tried. I'm trying to see if I can obtain any crash logs. Then I tried running the project like 20 times and it did not crash so far. I don't really know what to to say. We cannot use thread sanitizer as the project and the code requires bluetooth, which the iOS simulator does not support. |
Crash logs would be great. If they contain anything sensitive, please feel free to file a Radar on bugreport.apple.com, attach them, and post the number here. If by any chance you can share a test case there, that would be nice too (but I understand that's not always possible). |
Okay I can confirm that it crashed, but that is unrelated crash where a project internal precondition triggered. |
I'll see if I find some time in the next week to reduce the sample to a small snippet that I can share, I cannot promise that it will reproduce the issue. It will at least give you an idea what I'm doing and where this exploded. |
Is the failure non-deterministic? @rjmccall fixed something similar recently but maybe there's another case that was not fixed. |
It seems so, I changed some code in the main app (where this code is inside a custom framework we build), re-compiled and run and it crashed randomly two times today. Second time happened a few hours later. |
Can there be any differences if I run the project in Swift 4.2 mode compared to an updated project in Swift 5 mode? |
Added another crash to the issue, it seems to crash on the dynamic cast. What I do here is cast `self` (which is a generic class) to a specific version where the generic type parameter is specified. In other words I want to do something like this `let this = self as? Self where T == SomeInterface`. |
Environment
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Additional Detail from JIRA
md5: 1b7b3667a0b982abf12099be628faeff
Issue Description:
I cannot post the exact code, this issue started top pop up randomly with the Swift 5 compiler in Swift 4.2 mode. It worked perfectly fine with the old compiler.
Part of the stack trace:
The code is running on a custom serial queue.
Edit:
New similar crash on a similar subtype:
The text was updated successfully, but these errors were encountered: