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

lldb for Linux on Swift 5.1.2: warning: Swift error in fallback scratch context: error: missing required module 'CNIOAtomics'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
      None

      Description

      Description

      When running the following 1 liner (runnable from macOS (with Docker for Mac installed) or Linux) I get a warning.

      cd /tmp && rm -rf swift-nio && git clone https://github.com/apple/swift-nio && cd swift-nio && git reset --hard f548a29a27d7e533f1714d2d282ca0d79f6086dd && docker run -it --rm -v "$PWD:$PWD" -w "$PWD" swift:5.1.2 swift build --build-tests && docker run -it --rm -v "$PWD:$PWD" -w "$PWD" --privileged swift:5.1.2 lldb  .build/debug/swift-nioPackageTests.xctest
      

      which can also be broken into multiple lines:

      cd /tmp
      rm -rf swift-nio
      git clone https://github.com/apple/swift-nio
      cd swift-nio
      git reset --hard f548a29a27d7e533f1714d2d282ca0d79f6086dd
      docker run -it --rm -v "$PWD:$PWD" -w "$PWD" swift:5.1.2 swift build --build-tests
      docker run -it --rm -v "$PWD:$PWD" -w "$PWD" --privileged swift:5.1.2 lldb  .build/debug/swift-nioPackageTests.xctest
      

      once lldb is started, please type

      (lldb) break set -f EventLoop.swift -l 857         # ignore the Unable to load module. warning
      (lldb) run NIOTests.ChannelTests/testHalfClosure
      

      Once lldb has hit the breakpoint, run

      (lldb) po ev
      

      and you'll see the output

      warning: Swift error in fallback scratch context: error: missing required module 'CNIOAtomics'
      
      
      note: This error message is displayed only once. If the error displayed above is due to conflicting search paths to Clang modules in different images of the debugged executable, this can slow down debugging of Swift code significantly, since a fresh Swift context has to be created every time a conflict is encountered.
      
      Unable to load module.
      Unable to load module.
      ▿ SelectorEvent<NIORegistration>
        ▿ registration : NIORegistration
          ▿ socketChannel : 2 elements
            ▿ .0 : SocketChannel { socket fd: 7, localAddress = Optional([IPv4]127.0.0.1/127.0.0.1:45650), remoteAddress = nil }
            ▿ .1 : SelectorEventSet
              - rawValue : 9
        ▿ io : SelectorEventSet
          - rawValue : 8
      

      To be honest, I'm quite happy with this output, however the warning

      warning: Swift error in fallback scratch context: error: missing required module 'CNIOAtomics'
      

      is probably not good news if debugging something in CNIOAtomics.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jw Johannes Weiss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: