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

swiftc crash with -profile-generate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:
      None
    • Environment:

      Xcode 10.2 beta 2 (10P91b)
      You get this experience in Xcode if you check the box in Scheme -> Test -> Options -> Gather Code Coverage

      Description

      With this code:

      import UIKit
      UIAccessibility.voiceOverStatusDidChangeNotification
      

      Compiling it with this command:

      /Applications/Xcode-10.2.0b2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc \
       -sdk /Applications/Xcode-10.2.0b2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk \
       -target x86_64-apple-ios12.0-simulator \
       -profile-generate /tmp/foo.swift \
       -emit-module
      

      Crashes the compiler with this stack trace:

      <unknown>:0: error: fatal error encountered while reading from module 'foo'; please file a bug report with your project and the crash log
      
      *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
      result not found
      Cross-reference to module 'UIKit'
      ... UIAccessibility
      ... in an extension in module 'UIKit'
      ... GuidedAccessError
      
      Stack dump:
      0.	Program arguments: /Applications/Xcode-10.2.0b2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /var/folders/q5/7_wh20z93c74nj3tllwjl5nr0000gn/T/foo-1d1a9b.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-apple-ios12.0-simulator -enable-objc-interop -sdk /Applications/Xcode-10.2.0b2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -profile-generate -emit-module-doc-path foo.swiftdoc -module-name foo -o foo.swiftmodule 
      0  swift                    0x0000000111a6048a PrintStackTraceSignalHandler(void*) + 42
      1  swift                    0x0000000111a5fc6c SignalHandler(int) + 348
      2  libsystem_platform.dylib 0x00007fff6849eb3d _sigtramp + 29
      3  libsystem_platform.dylib 0x00000001141f2bc6 _sigtramp + 2882879654
      4  libsystem_c.dylib        0x00007fff6835c1c9 abort + 127
      5  swift                    0x000000010ebbcf40 swift::ModuleFile::fatal(llvm::Error) + 1856
      6  swift                    0x000000010ebd99ef swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 4591
      7  swift                    0x000000010ebf7808 swift::SILDeserializer::readWitnessTable(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILWitnessTable*) + 280
      8  swift                    0x000000010ec90f1d swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 589
      9  swift                    0x000000010d8d15d3 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 32531
      10 swift                    0x000000010d8c6097 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6823
      11 swift                    0x000000010d86602d main + 1261
      12 libdyld.dylib            0x00007fff682b3ed9 start + 1
      13 libdyld.dylib            0x0000000000000015 start + 2547302717
      <unknown>:0: error: unable to execute command: Abort trap: 6
      <unknown>:0: error: merge-module command failed due to signal 6 (use -v to see invocation)
      

      Removing the `-profile-generate` argument works around this crash

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            keith Keith Smiley
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: