Skip to content
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-8149] NSPasteboard.PasteboardType.findPanelSearchOptions crashes compiler #50681

Open
amomchilov opened this issue Jun 29, 2018 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software serialization Area → compiler: Serialization & deserialization

Comments

@amomchilov
Copy link
Contributor

Previous ID SR-8149
Radar rdar://problem/41725279
Original Reporter @amomchilov
Type Bug

Attachment: Download

Environment

Minimal example project attached. CompilerCrash.zip

Uncomment ViewController.swift:16 and compile.

This bug exists in at least following toolchains:

  1. Xcode 9
  2. Xcode 10.0 Beta 2 (10L177m)
  3. Swift 4.2 Snapshot 2018-06-26 (a)
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, Serialization
Assignee None
Priority Medium

md5: cf2c2c0df41eaefd83c5d90fd9114aa5

relates to:

  • SR-7879 UIEdgeInsets.zero use crashes Xcode 10/Swift 4.2 compiler

Issue Description:

Any reference to NSPasteboard.PasteboardType.findPanelSearchOptions crashes the compiler. All other cases of the same enum seem to work fine.

 <unknown>:0: error: fatal error encountered while reading from module 'CompilerCrash'; please file a bug report with your project and the crash log
 * 
 ** 
 *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
 result is ambiguous
 0 swift 0x0000000111fa7b48 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
 1 swift 0x0000000111fa6d87 llvm::sys::RunSignalHandlers() + 39
 2 swift 0x0000000111fa81c2 SignalHandler(int) + 258
 3 libsystem_platform.dylib 0x00007fff57689d3a _sigtramp + 26
 4 libsystem_platform.dylib 000000000000000000 _sigtramp + 2828493536
 5 libsystem_c.dylib 0x00007fff5754b09d abort + 127
 6 swift 0x000000010f700b80 swift::ModuleFile::fatal(llvm::Error) + 704
 7 swift 0x000000010f7010bd swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 157
 8 swift 0x000000010f7272a4 swift::SILDeserializer::readGlobalVar(llvm::StringRef) + 1796
 9 swift 0x000000010f73751a swift::SILDeserializer::getAllSILGlobalVariables() + 74
 10 swift 0x000000010f7b93c7 swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 135
 11 swift 0x000000010e796284 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 12868
 12 swift 0x000000010e792022 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2962
 13 swift 0x000000010e74cc8e main + 1134
 14 libdyld.dylib 0x00007fff5748fb11 start + 1
 15 libdyld.dylib 0x000000000000003f start + 2830566703
 Stack dump:
 0. Program arguments: /Library/Developer/Toolchains/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-26-a.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/ViewController~partial.swiftmodule /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/Crash~partial.swiftmodule /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-apple-macosx10.13 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Products/Debug -F /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Products/Debug -enable-testing -g -module-cache-path /Users/Alex/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/CompilerCrash-generated-files.hmap -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/CompilerCrash-own-target-headers.hmap -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/CompilerCrash-all-target-headers.hmap -Xcc -iquote -Xcc /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/CompilerCrash-project-headers.hmap -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Products/Debug/include -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/DerivedSources/x86_64 -Xcc -I/Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/Alex/Desktop/CompilerCrash -emit-module-doc-path /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/CompilerCrash.swiftdoc -emit-objc-header-path /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/CompilerCrash-Swift.h -module-name CompilerCrash -o /Users/Alex/Library/Developer/Xcode/DerivedData/CompilerCrash-goasxzodyhnihzfejnfdcrxnzfgt/Build/Intermediates.noindex/CompilerCrash.build/Debug/CompilerCrash.build/Objects-normal/x86_64/CompilerCrash.swiftmodule 
 1. While deserializing SIL global "NSFindPanelSearchOptionsPboardType"
 error: Abort trap: 6
@amomchilov
Copy link
Contributor Author

Same error output, but caused by a different imported API. It's been resolved, but its solution doesn't fix this issue

@belkadan
Copy link
Contributor

belkadan commented Jul 2, 2018

Yeah, SR-7879 was a narrow fix. We've done some more general work since then, so this might be fixed by now as well. I'll take a look.

@swift-ci create

@belkadan
Copy link
Contributor

belkadan commented Jul 2, 2018

Nope, different issue, caused by AppKit having both NSFindPanelSearchOptionsPboardType and NSPasteboardTypeFindPanelSearchOptions.

@amomchilov
Copy link
Contributor Author

@belkadan Hey Jordan, do you have a fix in mind?

@belkadan
Copy link
Contributor

belkadan commented Jul 2, 2018

I'm talking with AppKit. Meanwhile, you can either keep compiling in Swift 4 mode, or write a little Objective-C helper function that returns the constant rather than going through the property.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

3 participants