Uploaded image for project: 'Swift'
  1. Swift
  2. SR-10828

Xcode 10.2.1 + Swift 4: NSForwarding object of class does not implement doesNotRecognizeSelector:

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      macOS 10.4.5

      Xcode 10.2.1 (10E1001)

      SWIFT_VERSION = 4

       

      Working configuration:

      Xcode 10.1 (10B61)

      SWIFT_VERSION = 4

      Description

      After migrating our code base to Xcode 10.2.1, I've started experiencing a crash on app start. Interestingly, if I build the same codebase using Xcode 10.1, app does not crash. 

       

      A complete stacktrace is available here: https://gist.github.com/beefon/3141c8e2c6857ef5a8f0207be6f22e14

      A topmost frame's `register read` provides the following contents: https://gist.github.com/beefon/224f0b6638476d3ad92a08994f5157f3

      If I choose `CALLING_SOME_+initialize_METHOD` frame and inspect registers, I can find an address of an object being messaged with `+initialize`. And if I `po (BOOL)[0x0bjectAddress respondsToSelector:@selector(initialize)`, it prints YES: https://gist.github.com/beefon/cdc4ef98de64a7bdcb6db0dcc6d84ea2

      By remembering ObjC, I assume it attempts to call +initialize, and then it attempts to forward that invocation.

       

      lldb does not print any logs, but if I understand correctly, the message says that TextFieldInputView class does not implement doesNotRecognizeSelector:. The problem is that TextFieldInputView subclasses WrapperView<T>, which in turn is actually UIView.

       

      How could I debug this and make my app not crash on start?

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            beefon Vladislav Alexeev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: